[Xfce4-commits] [apps/xfce4-notifyd] 12/29: Replace GtkNotebook with GtkStack

noreply at xfce.org noreply at xfce.org
Sun Jan 29 20:52:02 CET 2017


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

ochosi pushed a commit to branch master
in repository apps/xfce4-notifyd.

commit 06e54ae39ed99db83d016fb16288bf298fd4f164
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Fri Jan 6 12:27:20 2017 +0100

    Replace GtkNotebook with GtkStack
---
 xfce4-notifyd-config/main.c                     | 23 ++------
 xfce4-notifyd-config/xfce4-notifyd-config.glade | 78 ++++++++++---------------
 2 files changed, 36 insertions(+), 65 deletions(-)

diff --git a/xfce4-notifyd-config/main.c b/xfce4-notifyd-config/main.c
index d32d580..8769749 100644
--- a/xfce4-notifyd-config/main.c
+++ b/xfce4-notifyd-config/main.c
@@ -44,12 +44,11 @@
 
 typedef struct
 {
-  GtkWidget *log_tab;
-  GtkWidget *log_level;
-  GtkWidget *log_level_label;
-  GtkWidget *log_level_apps;
-  GtkWidget *log_level_apps_label;
-  GtkWidget *infobar_label;
+    GtkWidget *log_level;
+    GtkWidget *log_level_label;
+    GtkWidget *log_level_apps;
+    GtkWidget *log_level_apps_label;
+    GtkWidget *infobar_label;
 } NotificationLogWidgets;
 
 static void
@@ -459,18 +458,12 @@ xfce4_notifyd_log_activated (GtkSwitch *log_switch,
     const char *format = "<b>Currently only urgent notifications are shown.</b>\nNotification logging is \%s.";
     char *markup;
 
-    markup = g_markup_printf_escaped (format, state ? "enabled" : "disabled");
-
-    if (state == TRUE)
-        gtk_widget_show (log_widgets->log_tab);
-    else
-        gtk_widget_hide (log_widgets->log_tab);
-
     gtk_switch_set_state (GTK_SWITCH (log_switch), state);
     gtk_widget_set_sensitive (GTK_WIDGET (log_widgets->log_level), state);
     gtk_widget_set_sensitive (GTK_WIDGET (log_widgets->log_level_label), state);
     gtk_widget_set_sensitive (GTK_WIDGET (log_widgets->log_level_apps), state);
     gtk_widget_set_sensitive (GTK_WIDGET (log_widgets->log_level_apps_label), state);
+    markup = g_markup_printf_escaped (format, state ? "enabled" : "disabled");
     gtk_label_set_markup (GTK_LABEL (log_widgets->infobar_label), markup);
     g_free (markup);
 }
@@ -618,14 +611,12 @@ xfce4_notifyd_config_setup_dialog(GtkBuilder *builder)
     GtkWidget *theme_combo;
     GtkWidget *position_combo;
     GtkWidget *help_button;
-    GtkWidget *notify_notebook;
     GtkWidget *known_applications_scrolled_window;
     GtkWidget *known_applications_listbox;
     GtkWidget *placeholder_label;
     GtkWidget *do_not_disturb_switch;
     GtkWidget *do_not_disturb_info;
     GtkWidget *log_switch;
-    GtkWidget *log_tab;
     GtkWidget *log_scrolled_window;
     GtkWidget *log_listbox;
     GtkWidget *clear_log_button;
@@ -732,8 +723,6 @@ xfce4_notifyd_config_setup_dialog(GtkBuilder *builder)
                       G_CALLBACK (xfce4_notifyd_known_applications_changed), known_applications_listbox);
 
     /* Notification log settings */
-    notify_notebook = GTK_WIDGET (gtk_builder_get_object (builder, "notify_notebook"));
-    log_widgets.log_tab = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notify_notebook), -1);
     log_widgets.log_level = GTK_WIDGET (gtk_builder_get_object (builder, "log_level"));
     log_widgets.log_level_label = GTK_WIDGET (gtk_builder_get_object (builder, "log_level_label"));
     log_widgets.log_level_apps = GTK_WIDGET (gtk_builder_get_object (builder, "log_level_apps"));
diff --git a/xfce4-notifyd-config/xfce4-notifyd-config.glade b/xfce4-notifyd-config/xfce4-notifyd-config.glade
index cb7e6f6..3771062 100644
--- a/xfce4-notifyd-config/xfce4-notifyd-config.glade
+++ b/xfce4-notifyd-config/xfce4-notifyd-config.glade
@@ -140,12 +140,27 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="border_width">6</property>
+            <property name="orientation">vertical</property>
             <child>
-              <object class="GtkNotebook" id="notify_notebook">
+              <object class="GtkStackSwitcher" id="stack_switcher">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
+                <property name="can_focus">False</property>
+                <property name="halign">center</property>
+                <property name="stack">stack</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkStack" id="stack">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="transition_type">slide-left-right</property>
                 <child>
-                  <object class="GtkGrid" id="grid3">
+                  <object class="GtkGrid" id="general">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="margin_left">12</property>
@@ -380,19 +395,13 @@
                       </packing>
                     </child>
                   </object>
-                </child>
-                <child type="tab">
-                  <object class="GtkLabel" id="label11">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">General</property>
-                  </object>
                   <packing>
-                    <property name="tab_fill">False</property>
+                    <property name="name">general</property>
+                    <property name="title" translatable="yes">General</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkGrid" id="grid1">
+                  <object class="GtkGrid" id="appearance">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="margin_left">12</property>
@@ -585,22 +594,13 @@
                     </child>
                   </object>
                   <packing>
+                    <property name="name">appearance</property>
+                    <property name="title" translatable="yes">Appearance</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
-                <child type="tab">
-                  <object class="GtkLabel" id="label6">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">Appearance</property>
-                  </object>
-                  <packing>
-                    <property name="position">1</property>
-                    <property name="tab_fill">False</property>
-                  </packing>
-                </child>
                 <child>
-                  <object class="GtkGrid" id="grid2">
+                  <object class="GtkGrid" id="applications">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="margin_left">12</property>
@@ -638,22 +638,13 @@
                     </child>
                   </object>
                   <packing>
+                    <property name="name">applications</property>
+                    <property name="title" translatable="yes">Applications</property>
                     <property name="position">2</property>
                   </packing>
                 </child>
-                <child type="tab">
-                  <object class="GtkLabel" id="label7">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">Applications</property>
-                  </object>
-                  <packing>
-                    <property name="position">2</property>
-                    <property name="tab_fill">False</property>
-                  </packing>
-                </child>
                 <child>
-                  <object class="GtkGrid" id="grid4">
+                  <object class="GtkGrid" id="log">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="margin_left">12</property>
@@ -706,25 +697,16 @@
                     </child>
                   </object>
                   <packing>
+                    <property name="name">log</property>
+                    <property name="title" translatable="yes">Log</property>
                     <property name="position">3</property>
                   </packing>
                 </child>
-                <child type="tab">
-                  <object class="GtkLabel" id="label8">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">Log</property>
-                  </object>
-                  <packing>
-                    <property name="position">3</property>
-                    <property name="tab_fill">False</property>
-                  </packing>
-                </child>
               </object>
               <packing>
                 <property name="expand">True</property>
                 <property name="fill">True</property>
-                <property name="position">0</property>
+                <property name="position">1</property>
               </packing>
             </child>
           </object>

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


More information about the Xfce4-commits mailing list