[Xfce4-commits] [xfce/xfce4-panel] 06/06: Make "don't reserve space" sensitive only when autohiding is disabled

noreply at xfce.org noreply at xfce.org
Fri Sep 5 02:12:40 CEST 2014


This is an automated email from the git hooks/post-receive script.

andrzejr pushed a commit to branch master
in repository xfce/xfce4-panel.

commit 5866e9521f3e525fb548612d505efc56fef7ed06
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Tue Jul 29 11:57:53 2014 +0200

    Make "don't reserve space" sensitive only when autohiding is disabled
    
    This configuration option only makes sense when not hiding a panel
    automatically, so whenever one of the two autohide behaviors is enabled,
    the option is now greyed out in the UI.
---
 panel/panel-preferences-dialog.c |   35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/panel/panel-preferences-dialog.c b/panel/panel-preferences-dialog.c
index 3c70978..5104985 100644
--- a/panel/panel-preferences-dialog.c
+++ b/panel/panel-preferences-dialog.c
@@ -60,6 +60,8 @@ static void                     panel_preferences_dialog_bindings_add
 static void                     panel_preferences_dialog_bindings_update        (PanelPreferencesDialog *dialog);
 static void                     panel_preferences_dialog_output_changed         (GtkComboBox            *combobox,
                                                                                  PanelPreferencesDialog *dialog);
+static void                     panel_preferences_dialog_autohide_changed       (GtkComboBox            *combobox,
+                                                                                 PanelPreferencesDialog *dialog);
 static void                     panel_preferences_dialog_bg_style_changed       (PanelPreferencesDialog *dialog);
 static void                     panel_preferences_dialog_bg_image_file_set      (GtkFileChooserButton   *button,
                                                                                  PanelPreferencesDialog *dialog);
@@ -280,6 +282,12 @@ panel_preferences_dialog_init (PanelPreferencesDialog *dialog)
       g_signal_connect (G_OBJECT (object), "changed",
                         G_CALLBACK (panel_preferences_dialog_output_changed),
                         dialog);
+
+  /* connect the autohide behavior changed signal */
+  object = gtk_builder_get_object (GTK_BUILDER (dialog), "autohide-behavior");
+  panel_return_if_fail (GTK_IS_COMBO_BOX (object));
+  g_signal_connect (G_OBJECT (object), "changed",
+      G_CALLBACK (panel_preferences_dialog_autohide_changed), dialog);
 }
 
 
@@ -568,6 +576,11 @@ panel_preferences_dialog_bindings_update (PanelPreferencesDialog *dialog)
   g_object_set (G_OBJECT (object), "visible", n_monitors > 1, NULL);
 
   g_free (output_name);
+
+  /* update sensitivity of "don't reserve space on borders" option */
+  object = gtk_builder_get_object (GTK_BUILDER (dialog), "autohide-behavior");
+  panel_return_if_fail (GTK_IS_COMBO_BOX (object));
+  panel_preferences_dialog_autohide_changed (GTK_COMBO_BOX (object), dialog);
 }
 
 
@@ -603,6 +616,28 @@ panel_preferences_dialog_output_changed (GtkComboBox            *combobox,
 
 
 static void
+panel_preferences_dialog_autohide_changed (GtkComboBox            *combobox,
+                                           PanelPreferencesDialog *dialog)
+{
+  GObject *object;
+
+  panel_return_if_fail (GTK_IS_COMBO_BOX (combobox));
+  panel_return_if_fail (PANEL_IS_PREFERENCES_DIALOG (dialog));
+  panel_return_if_fail (PANEL_WINDOW (dialog->active));
+
+  object = gtk_builder_get_object (GTK_BUILDER (dialog), "disable-struts");
+  panel_return_if_fail (GTK_IS_WIDGET (object));
+
+  /* make "don't reserve space on borders" sensitive only when autohide is disabled */
+  if (gtk_combo_box_get_active (combobox) == 0)
+    gtk_widget_set_sensitive (GTK_WIDGET (object), TRUE);
+  else
+    gtk_widget_set_sensitive (GTK_WIDGET (object), FALSE);
+}
+
+
+
+static void
 panel_preferences_dialog_bg_style_changed (PanelPreferencesDialog *dialog)
 {
   gint      active;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list