[digikam] digikam: The "hide thumbbar in fullscreen mode" setting was not respected in albumUI,

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[digikam] digikam: The "hide thumbbar in fullscreen mode" setting was not respected in albumUI,

Andi Clemens
Git commit a97fcf4183ca64147befaa6fc5abd6ce79d14b70 by Andi Clemens.
Committed on 21/10/2011 at 13:44.
Pushed by aclemens into branch 'master'.

The "hide thumbbar in fullscreen mode" setting was not respected in albumUI,
only in the image editor.
Also the state before entering fullscreen mode was not restored properly, e.g.
the toolbar was shown, although the user might have hidden it in the first
place.

While fixing the issue, I asked myself: We do we have these two fullscreen mode
settings in the editor window page of the setup dialog? They are used for
albumUI as well (maybe even for lighttable?).

Shouldn't these settings be moved to the "General" page?
Also, an action is missing in the context menu for returning from the
fullscreen mode if the toolbar is hidden. How should a normal user know the
shortcut for this action?
At least my parents wouldn't know it, and I guess they can be considered as
"normal users" ;-)

Andi

CCMAIL:[hidden email]

M  +47   -10   digikam/main/digikamapp.cpp
M  +2    -0    digikam/main/digikamapp.h
M  +5    -0    digikam/views/digikamview.cpp
M  +1    -0    digikam/views/digikamview.h

http://commits.kde.org/digikam/a97fcf4183ca64147befaa6fc5abd6ce79d14b70

diff --git a/digikam/main/digikamapp.cpp b/digikam/main/digikamapp.cpp
index b438278..c1bf22f 100644
--- a/digikam/main/digikamapp.cpp
+++ b/digikam/main/digikamapp.cpp
@@ -2567,6 +2567,9 @@ void DigikamApp::slotConfNotifications()
 
 void DigikamApp::slotToggleFullScreen()
 {
+    static bool wasThumbBarVisible = true;
+    static bool wasToolbBarVisible = true;
+
     if (d->fullScreen)
     {
         setWindowState( windowState() & ~Qt::WindowFullScreen ); // reset
@@ -2574,20 +2577,39 @@ void DigikamApp::slotToggleFullScreen()
         slotShowMenuBar();
         statusBar()->show();
 
-        QList<KToolBar*> toolbars = toolBars();
-        foreach (KToolBar* toolbar, toolbars)
+        showToolBars();
+        KToolBar* mainToolBar = toolBar("mainToolBar");
+        if (mainToolBar)
         {
-            toolbar->show();
+            if (wasToolbBarVisible)
+            {
+                mainToolBar->show();
+            }
+            else
+            {
+                mainToolBar->hide();
+            }
         }
 
+        showThumbBar(wasThumbBarVisible);
+
         d->view->showSideBars();
 
         d->fullScreen = false;
     }
     else
     {
-        KConfigGroup group         = d->config->group("ImageViewer Settings");
-        bool fullScreenHideToolBar = group.readEntry("FullScreen Hide ToolBar", false);
+        wasThumbBarVisible = d->view->isThumbBarVisible();
+        wasToolbBarVisible = true;
+        KToolBar* mainToolBar = toolBar("mainToolBar");
+        if (mainToolBar)
+        {
+            wasToolbBarVisible = mainToolBar->isVisible();
+        }
+
+        KConfigGroup group          = d->config->group("ImageViewer Settings");
+        bool fullScreenHideToolBar  = group.readEntry("FullScreen Hide ToolBar", false);
+        bool fullScreenHideThumbBar = group.readEntry("FullScreenHideThumbBar", true);
 
         setWindowState( windowState() | Qt::WindowFullScreen ); // set
 
@@ -2596,11 +2618,12 @@ void DigikamApp::slotToggleFullScreen()
 
         if (fullScreenHideToolBar)
         {
-            QList<KToolBar*> toolbars = toolBars();
-            foreach (KToolBar* toolbar, toolbars)
-            {
-                toolbar->hide();
-            }
+            showToolBars(false);
+        }
+
+        if (fullScreenHideThumbBar)
+        {
+            showThumbBar(false);
         }
 
         d->view->hideSideBars();
@@ -3376,6 +3399,20 @@ void DigikamApp::slotComponentsInfo()
     showDigikamComponentsInfo();
 }
 
+void DigikamApp::showToolBars(bool show)
+{
+    QList<KToolBar*> toolbars = toolBars();
+    foreach (KToolBar* toolbar, toolbars)
+    {
+        show ? toolbar->show() : toolbar->hide();
+    }
+}
+
+void DigikamApp::showThumbBar(bool show)
+{
+    d->view->toggleShowBar(show);
+}
+
 #ifdef USE_SCRIPT_IFACE
 void DigikamApp::slotScriptConsole()
 {
diff --git a/digikam/main/digikamapp.h b/digikam/main/digikamapp.h
index b828e15..7b5ba2f 100644
--- a/digikam/main/digikamapp.h
+++ b/digikam/main/digikamapp.h
@@ -164,6 +164,8 @@ private:
     void updateCameraMenu();
     void updateQuickImportAction();
     void initGui();
+    void showToolBars(bool show=true);
+    void showThumbBar(bool show=true);
 
 private Q_SLOTS:
 
diff --git a/digikam/views/digikamview.cpp b/digikam/views/digikamview.cpp
index 6404ab6..f4128e9 100644
--- a/digikam/views/digikamview.cpp
+++ b/digikam/views/digikamview.cpp
@@ -1870,6 +1870,11 @@ void DigikamView::toggleShowBar(bool b)
     d->stackedview->thumbBarDock()->showThumbBar(b);
 }
 
+bool DigikamView::isThumbBarVisible()
+{
+    return d->stackedview->thumbBarDock()->isVisible();
+}
+
 void DigikamView::setRecurseAlbums(bool recursive)
 {
     d->iconView->imageAlbumModel()->setRecurseAlbums(recursive);
diff --git a/digikam/views/digikamview.h b/digikam/views/digikamview.h
index cf4d8e9..9ea8049 100644
--- a/digikam/views/digikamview.h
+++ b/digikam/views/digikamview.h
@@ -71,6 +71,7 @@ public:
     void hideSideBars();
     void setThumbSize(int size);
     void toggleShowBar(bool);
+    bool isThumbBarVisible();
     void setRecurseAlbums(bool recursive);
     void setRecurseTags(bool recursive);
 

_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: [digikam] digikam: The "hide thumbbar in fullscreen mode" setting was not respected in albumUI,

Andi Clemens
I have not yet managed to restore the thumbbar properly, maybe Gilles or  
Marcel can help me here?
The problem is that if the thumbbar was shown before going into  
fullscreen, it will be shown when returning from fullscreen, even in  
albumUI / iconview mode (where the thumbbar is normally disabled and never  
shown).

I found the method ThumbBarDock::restoreVisibility(), but it doesn't seem  
to work here.
Any ideas how to restore the thumbbar, but only show it in previewmode,  
not in mediaplayer and iconview mode?

Andi


On Mon, 24 Oct 2011 22:18:09 +0200, Andi Clemens  
<[hidden email]> wrote:

> Git commit a97fcf4183ca64147befaa6fc5abd6ce79d14b70 by Andi Clemens.
> Committed on 21/10/2011 at 13:44.
> Pushed by aclemens into branch 'master'.
>
> The "hide thumbbar in fullscreen mode" setting was not respected in  
> albumUI,
> only in the image editor.
> Also the state before entering fullscreen mode was not restored  
> properly, e.g.
> the toolbar was shown, although the user might have hidden it in the  
> first
> place.
>
> While fixing the issue, I asked myself: We do we have these two  
> fullscreen mode
> settings in the editor window page of the setup dialog? They are used for
> albumUI as well (maybe even for lighttable?).
>
> Shouldn't these settings be moved to the "General" page?
> Also, an action is missing in the context menu for returning from the
> fullscreen mode if the toolbar is hidden. How should a normal user know  
> the
> shortcut for this action?
> At least my parents wouldn't know it, and I guess they can be considered  
> as
> "normal users" ;-)
>
> Andi
>
> CCMAIL:[hidden email]
>
> M  +47   -10   digikam/main/digikamapp.cpp
> M  +2    -0    digikam/main/digikamapp.h
> M  +5    -0    digikam/views/digikamview.cpp
> M  +1    -0    digikam/views/digikamview.h
>
> http://commits.kde.org/digikam/a97fcf4183ca64147befaa6fc5abd6ce79d14b70
>
> diff --git a/digikam/main/digikamapp.cpp b/digikam/main/digikamapp.cpp
> index b438278..c1bf22f 100644
> --- a/digikam/main/digikamapp.cpp
> +++ b/digikam/main/digikamapp.cpp
> @@ -2567,6 +2567,9 @@ void DigikamApp::slotConfNotifications()
> void DigikamApp::slotToggleFullScreen()
>  {
> +    static bool wasThumbBarVisible = true;
> +    static bool wasToolbBarVisible = true;
> +
>      if (d->fullScreen)
>      {
>          setWindowState( windowState() & ~Qt::WindowFullScreen ); //  
> reset
> @@ -2574,20 +2577,39 @@ void DigikamApp::slotToggleFullScreen()
>          slotShowMenuBar();
>          statusBar()->show();
> -        QList<KToolBar*> toolbars = toolBars();
> -        foreach (KToolBar* toolbar, toolbars)
> +        showToolBars();
> +        KToolBar* mainToolBar = toolBar("mainToolBar");
> +        if (mainToolBar)
>          {
> -            toolbar->show();
> +            if (wasToolbBarVisible)
> +            {
> +                mainToolBar->show();
> +            }
> +            else
> +            {
> +                mainToolBar->hide();
> +            }
>          }
> +        showThumbBar(wasThumbBarVisible);
> +
>          d->view->showSideBars();
>         d->fullScreen = false;
>      }
>      else
>      {
> -        KConfigGroup group         = d->config->group("ImageViewer  
> Settings");
> -        bool fullScreenHideToolBar = group.readEntry("FullScreen Hide  
> ToolBar", false);
> +        wasThumbBarVisible = d->view->isThumbBarVisible();
> +        wasToolbBarVisible = true;
> +        KToolBar* mainToolBar = toolBar("mainToolBar");
> +        if (mainToolBar)
> +        {
> +            wasToolbBarVisible = mainToolBar->isVisible();
> +        }
> +
> +        KConfigGroup group          = d->config->group("ImageViewer  
> Settings");
> +        bool fullScreenHideToolBar  = group.readEntry("FullScreen Hide  
> ToolBar", false);
> +        bool fullScreenHideThumbBar =  
> group.readEntry("FullScreenHideThumbBar", true);
>         setWindowState( windowState() | Qt::WindowFullScreen ); // set
> @@ -2596,11 +2618,12 @@ void DigikamApp::slotToggleFullScreen()
>         if (fullScreenHideToolBar)
>          {
> -            QList<KToolBar*> toolbars = toolBars();
> -            foreach (KToolBar* toolbar, toolbars)
> -            {
> -                toolbar->hide();
> -            }
> +            showToolBars(false);
> +        }
> +
> +        if (fullScreenHideThumbBar)
> +        {
> +            showThumbBar(false);
>          }
>         d->view->hideSideBars();
> @@ -3376,6 +3399,20 @@ void DigikamApp::slotComponentsInfo()
>      showDigikamComponentsInfo();
>  }
> +void DigikamApp::showToolBars(bool show)
> +{
> +    QList<KToolBar*> toolbars = toolBars();
> +    foreach (KToolBar* toolbar, toolbars)
> +    {
> +        show ? toolbar->show() : toolbar->hide();
> +    }
> +}
> +
> +void DigikamApp::showThumbBar(bool show)
> +{
> +    d->view->toggleShowBar(show);
> +}
> +
>  #ifdef USE_SCRIPT_IFACE
>  void DigikamApp::slotScriptConsole()
>  {
> diff --git a/digikam/main/digikamapp.h b/digikam/main/digikamapp.h
> index b828e15..7b5ba2f 100644
> --- a/digikam/main/digikamapp.h
> +++ b/digikam/main/digikamapp.h
> @@ -164,6 +164,8 @@ private:
>      void updateCameraMenu();
>      void updateQuickImportAction();
>      void initGui();
> +    void showToolBars(bool show=true);
> +    void showThumbBar(bool show=true);
> private Q_SLOTS:
> diff --git a/digikam/views/digikamview.cpp  
> b/digikam/views/digikamview.cpp
> index 6404ab6..f4128e9 100644
> --- a/digikam/views/digikamview.cpp
> +++ b/digikam/views/digikamview.cpp
> @@ -1870,6 +1870,11 @@ void DigikamView::toggleShowBar(bool b)
>      d->stackedview->thumbBarDock()->showThumbBar(b);
>  }
> +bool DigikamView::isThumbBarVisible()
> +{
> +    return d->stackedview->thumbBarDock()->isVisible();
> +}
> +
>  void DigikamView::setRecurseAlbums(bool recursive)
>  {
>      d->iconView->imageAlbumModel()->setRecurseAlbums(recursive);
> diff --git a/digikam/views/digikamview.h b/digikam/views/digikamview.h
> index cf4d8e9..9ea8049 100644
> --- a/digikam/views/digikamview.h
> +++ b/digikam/views/digikamview.h
> @@ -71,6 +71,7 @@ public:
>      void hideSideBars();
>      void setThumbSize(int size);
>      void toggleShowBar(bool);
> +    bool isThumbBarVisible();
>      void setRecurseAlbums(bool recursive);
>      void setRecurseTags(bool recursive);
>
> _______________________________________________
> Digikam-devel mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/digikam-devel


--
Using Opera's revolutionary email client: http://www.opera.com/mail/
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: [digikam] digikam: The "hide thumbbar in fullscreen mode" setting was not respected in albumUI,

Marcel Wiesweg

> I have not yet managed to restore the thumbbar properly, maybe Gilles or
> Marcel can help me here?
> The problem is that if the thumbbar was shown before going into
> fullscreen, it will be shown when returning from fullscreen, even in
> albumUI / iconview mode (where the thumbbar is normally disabled and never
> shown).
>
> I found the method ThumbBarDock::restoreVisibility(), but it doesn't seem
> to work here.
> Any ideas how to restore the thumbbar, but only show it in previewmode,
> not in mediaplayer and iconview mode?

Dirty solution: There must be code which shows the thumbbar in mode a and
hides it when entering  b or c, depending on the current state. Move it to a
method, call this method when needed and when returning from full screen?

Marcel
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel