notifications: Move adjustment widget into GtkBuilder file

This commit is contained in:
Robert Ancell 2020-12-04 09:47:42 +13:00 committed by Benjamin Berg
parent 7e89c293b0
commit ba80822797
2 changed files with 5 additions and 4 deletions

View file

@ -39,6 +39,7 @@ struct _CcNotificationsPanel {
CcPanel parent_instance; CcPanel parent_instance;
GtkListBox *app_listbox; GtkListBox *app_listbox;
GtkAdjustment *focus_adjustment;
CcListRow *lock_screen_row; CcListRow *lock_screen_row;
GtkScrolledWindow *main_scrolled_window; GtkScrolledWindow *main_scrolled_window;
GtkBox *main_box; GtkBox *main_box;
@ -52,8 +53,6 @@ struct _CcNotificationsPanel {
GHashTable *known_applications; GHashTable *known_applications;
GtkAdjustment *focus_adjustment;
GList *sections; GList *sections;
GList *sections_reverse; GList *sections_reverse;
@ -184,8 +183,6 @@ cc_notifications_panel_init (CcNotificationsPanel *panel)
panel->lock_screen_row, panel->lock_screen_row,
"active", G_SETTINGS_BIND_DEFAULT); "active", G_SETTINGS_BIND_DEFAULT);
panel->focus_adjustment = gtk_scrolled_window_get_vadjustment (panel->main_scrolled_window);
gtk_container_set_focus_vadjustment (GTK_CONTAINER (panel->main_box), panel->focus_adjustment); gtk_container_set_focus_vadjustment (GTK_CONTAINER (panel->main_box), panel->focus_adjustment);
panel->sections = g_list_append (panel->sections, panel->options_listbox); panel->sections = g_list_append (panel->sections, panel->options_listbox);
@ -238,6 +235,7 @@ cc_notifications_panel_class_init (CcNotificationsPanelClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/notifications/cc-notifications-panel.ui"); gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/notifications/cc-notifications-panel.ui");
gtk_widget_class_bind_template_child (widget_class, CcNotificationsPanel, app_listbox); gtk_widget_class_bind_template_child (widget_class, CcNotificationsPanel, app_listbox);
gtk_widget_class_bind_template_child (widget_class, CcNotificationsPanel, focus_adjustment);
gtk_widget_class_bind_template_child (widget_class, CcNotificationsPanel, lock_screen_row); gtk_widget_class_bind_template_child (widget_class, CcNotificationsPanel, lock_screen_row);
gtk_widget_class_bind_template_child (widget_class, CcNotificationsPanel, main_scrolled_window); gtk_widget_class_bind_template_child (widget_class, CcNotificationsPanel, main_scrolled_window);
gtk_widget_class_bind_template_child (widget_class, CcNotificationsPanel, main_box); gtk_widget_class_bind_template_child (widget_class, CcNotificationsPanel, main_box);

View file

@ -9,6 +9,7 @@
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property> <property name="hscrollbar_policy">never</property>
<property name="shadow_type">none</property> <property name="shadow_type">none</property>
<property name="vadjustment">focus_adjustment</property>
<child> <child>
<object class="GtkViewport"> <object class="GtkViewport">
<property name="visible">True</property> <property name="visible">True</property>
@ -131,4 +132,6 @@
<object class="GtkSizeGroup" id="sizegroup1"> <object class="GtkSizeGroup" id="sizegroup1">
<property name="mode">both</property> <property name="mode">both</property>
</object> </object>
<object class="GtkAdjustment" id="focus_adjustment">
</object>
</interface> </interface>