[nautilus/wip/csoriano/destktop-split2: 49/60] toolbar: use widget visibility instead of desktop special casing



commit 7664ff48fe88a16c9e95c1517780c62c60d7efa0
Author: Carlos Soriano <csoriano gnome org>
Date:   Thu Mar 31 15:36:44 2016 +0200

    toolbar: use widget visibility instead of desktop special casing
    
    We need to avoid showing the operations popover in the desktop, or
    basically in any window that has the disable-chrome property set.
    
    We can check inside the toolbar if the toolbar itself is hidden in order
    to know whether it makes sense to show the operations popover.
    
    In this way we don't relay in special casing subclasses of the window.

 src/nautilus-toolbar.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c
index ac4221f..657a308 100644
--- a/src/nautilus-toolbar.c
+++ b/src/nautilus-toolbar.c
@@ -30,7 +30,6 @@
 #include "nautilus-window.h"
 #include "nautilus-progress-info-widget.h"
 #include "nautilus-application.h"
-#include "nautilus-desktop-window.h"
 
 #include <libnautilus-private/nautilus-global-preferences.h>
 #include <libnautilus-private/nautilus-ui-utilities.h>
@@ -600,8 +599,11 @@ update_operations (NautilusToolbar *self)
                                                TRUE);
                 gtk_widget_queue_draw (self->priv->operations_icon);
 
-                /* Show the popover at start to increase visibility */
-                if (!NAUTILUS_IS_DESKTOP_WINDOW (self->priv->window)) {
+                /* Show the popover at start to increase visibility.
+                 * Check whether the toolbar is visible or not before showing the
+                 * popover. This can happens if the window has the disables-chrome
+                 * property set. */
+                if (gtk_widget_get_visible (GTK_WIDGET (self))) {
                         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->priv->operations_button),
                                                       TRUE);
                 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]