[gnome-control-center/gbsneto/panel-headerbar-cleanup: 15/19] window: Remove panel headerbar widgetry




commit 4209c510da67ebdac1fcab2fb0f6723fe127cef8
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Jan 19 19:27:12 2022 -0300

    window: Remove panel headerbar widgetry
    
    Now that panels handle their own titlebars, remove the corresponding
    widgetry from CcWindow.

 shell/cc-window.c  | 22 ----------------------
 shell/cc-window.ui | 45 ---------------------------------------------
 2 files changed, 67 deletions(-)
---
diff --git a/shell/cc-window.c b/shell/cc-window.c
index 6c525badd..589f5a45a 100644
--- a/shell/cc-window.c
+++ b/shell/cc-window.c
@@ -50,14 +50,10 @@ struct _CcWindow
 {
   AdwApplicationWindow parent;
 
-  GtkRevealer       *back_revealer;
   GtkMessageDialog  *development_warning_dialog;
   AdwHeaderBar      *header;
   AdwLeaflet        *main_leaflet;
-  AdwHeaderBar      *panel_headerbar;
   CcPanelList       *panel_list;
-  AdwWindowTitle    *panel_title_widget;
-  GtkStack          *panel_titlebar_stack;
   GtkButton         *previous_button;
   GtkSearchBar      *search_bar;
   GtkToggleButton   *search_button;
@@ -65,8 +61,6 @@ struct _CcWindow
   GtkBox            *sidebar_box;
   AdwWindowTitle    *sidebar_title_widget;
   GtkStack          *stack;
-  GtkBox            *top_left_box;
-  GtkBox            *top_right_box;
 
   GtkWidget  *current_panel;
   char       *current_panel_id;
@@ -170,9 +164,6 @@ activate_panel (CcWindow          *self,
   gtk_widget_show (self->current_panel);
   gtk_stack_set_visible_child_name (self->stack, id);
 
-  /* set the title of the window */
-  adw_window_title_set_title (self->panel_title_widget, name);
-
   sidebar_widget = cc_panel_get_sidebar_widget (CC_PANEL (self->current_panel));
   cc_panel_list_add_sidebar_widget (self->panel_list, sidebar_widget);
   /* Ensure we show the panel when the leaflet is folded and a sidebar widget's
@@ -525,12 +516,6 @@ search_entry_activate_cb (CcWindow *self)
   gtk_search_bar_set_search_mode (self->search_bar, !changed);
 }
 
-static void
-back_button_clicked_cb (CcWindow *self)
-{
-  adw_leaflet_navigate (self->main_leaflet, ADW_NAVIGATION_DIRECTION_BACK);
-}
-
 static void
 previous_button_clicked_cb (CcWindow *self)
 {
@@ -797,14 +782,10 @@ cc_window_class_init (CcWindowClass *klass)
 
   gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/ControlCenter/gtk/cc-window.ui");
 
-  gtk_widget_class_bind_template_child (widget_class, CcWindow, back_revealer);
   gtk_widget_class_bind_template_child (widget_class, CcWindow, development_warning_dialog);
   gtk_widget_class_bind_template_child (widget_class, CcWindow, header);
   gtk_widget_class_bind_template_child (widget_class, CcWindow, main_leaflet);
-  gtk_widget_class_bind_template_child (widget_class, CcWindow, panel_headerbar);
   gtk_widget_class_bind_template_child (widget_class, CcWindow, panel_list);
-  gtk_widget_class_bind_template_child (widget_class, CcWindow, panel_title_widget);
-  gtk_widget_class_bind_template_child (widget_class, CcWindow, panel_titlebar_stack);
   gtk_widget_class_bind_template_child (widget_class, CcWindow, previous_button);
   gtk_widget_class_bind_template_child (widget_class, CcWindow, search_bar);
   gtk_widget_class_bind_template_child (widget_class, CcWindow, search_button);
@@ -812,10 +793,7 @@ cc_window_class_init (CcWindowClass *klass)
   gtk_widget_class_bind_template_child (widget_class, CcWindow, sidebar_box);
   gtk_widget_class_bind_template_child (widget_class, CcWindow, sidebar_title_widget);
   gtk_widget_class_bind_template_child (widget_class, CcWindow, stack);
-  gtk_widget_class_bind_template_child (widget_class, CcWindow, top_left_box);
-  gtk_widget_class_bind_template_child (widget_class, CcWindow, top_right_box);
 
-  gtk_widget_class_bind_template_callback (widget_class, back_button_clicked_cb);
   gtk_widget_class_bind_template_callback (widget_class, on_main_leaflet_folded_changed_cb);
   gtk_widget_class_bind_template_callback (widget_class, on_development_warning_dialog_responded_cb);
   gtk_widget_class_bind_template_callback (widget_class, previous_button_clicked_cb);
diff --git a/shell/cc-window.ui b/shell/cc-window.ui
index 45a160dda..6f0f3f979 100644
--- a/shell/cc-window.ui
+++ b/shell/cc-window.ui
@@ -116,51 +116,6 @@
             <property name="hexpand">True</property>
             <property name="vexpand">True</property>
 
-            <!-- Panel titlebar -->
-            <child>
-              <object class="GtkStack" id="panel_titlebar_stack">
-                <property name="hexpand">True</property>
-                <child>
-                  <object class="AdwHeaderBar" id="panel_headerbar">
-                    <property name="hexpand">True</property>
-                    <property name="show-start-title-buttons" bind-source="main_leaflet" 
bind-property="folded" bind-flags="sync-create"/>
-                    <property name="show-end-title-buttons">True</property>
-                    <property name="title-widget">
-                      <object class="AdwWindowTitle" id="panel_title_widget" />
-                    </property>
-                    <child>
-                      <object class="GtkRevealer" id="back_revealer">
-                        <property name="transition-type">crossfade</property>
-                        <property name="transition-duration" bind-source="main_leaflet" 
bind-property="mode-transition-duration" bind-flags="bidirectional|sync-create"/>
-                        <property name="visible" bind-source="main_leaflet" bind-property="folded" 
bind-flags="sync-create"/>
-                        <property name="reveal-child" bind-source="main_leaflet" bind-property="folded" 
bind-flags="sync-create"/>
-                        <child>
-                          <object class="GtkButton" id="back">
-                            <property name="receives_default">False</property>
-                            <property name="valign">center</property>
-                            <property name="icon-name">go-previous-symbolic</property>
-                            <signal name="clicked" handler="back_button_clicked_cb" object="CcWindow" 
swapped="yes" />
-                            <style>
-                              <class name="image-button"/>
-                            </style>
-                            <accessibility>
-                              <property name="label" translatable="yes">Back</property>
-                            </accessibility>
-                          </object>
-                        </child>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="GtkBox" id="top_left_box" />
-                    </child>
-                    <child type="end">
-                      <object class="GtkBox" id="top_right_box" />
-                    </child>
-                  </object>
-                </child>
-              </object>
-            </child>
-
             <child>
               <object class="GtkStack" id="stack">
                 <property name="hexpand">True</property>


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