power: Don't set the vadjustment

This is useless as GtkScrolledwindow already does it on the viewport it
creates.
This commit is contained in:
Adrien Plazas 2021-01-08 16:00:25 +01:00 committed by Robert Ancell
parent 5168e924cf
commit f986fedf49
2 changed files with 2 additions and 11 deletions

View file

@ -91,8 +91,6 @@ struct _CcPowerPanel
GtkListBoxRow *kbd_brightness_row; GtkListBoxRow *kbd_brightness_row;
CcBrightnessScale *kbd_brightness_scale; CcBrightnessScale *kbd_brightness_scale;
GtkSizeGroup *level_sizegroup; GtkSizeGroup *level_sizegroup;
GtkScrolledWindow *main_scroll;
HdyClamp *main_box;
GtkListBoxRow *mobile_row; GtkListBoxRow *mobile_row;
GtkSwitch *mobile_switch; GtkSwitch *mobile_switch;
GtkComboBox *power_button_combo; GtkComboBox *power_button_combo;
@ -136,8 +134,6 @@ struct _CcPowerPanel
#ifdef HAVE_NETWORK_MANAGER #ifdef HAVE_NETWORK_MANAGER
NMClient *nm_client; NMClient *nm_client;
#endif #endif
GtkAdjustment *focus_adjustment;
}; };
CC_PANEL_REGISTER (CcPowerPanel, cc_power_panel) CC_PANEL_REGISTER (CcPowerPanel, cc_power_panel)
@ -1661,8 +1657,6 @@ cc_power_panel_class_init (CcPowerPanelClass *klass)
gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, kbd_brightness_row); gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, kbd_brightness_row);
gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, kbd_brightness_scale); gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, kbd_brightness_scale);
gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, level_sizegroup); gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, level_sizegroup);
gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, main_scroll);
gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, main_box);
gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, mobile_row); gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, mobile_row);
gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, mobile_switch); gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, mobile_switch);
gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, power_button_combo); gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, power_button_combo);
@ -1775,7 +1769,4 @@ cc_power_panel_init (CcPowerPanel *self)
G_CALLBACK (up_client_changed), self, G_CONNECT_SWAPPED); G_CALLBACK (up_client_changed), self, G_CONNECT_SWAPPED);
} }
up_client_changed (self); up_client_changed (self);
self->focus_adjustment = gtk_scrolled_window_get_vadjustment (self->main_scroll);
gtk_container_set_focus_vadjustment (GTK_CONTAINER (self->main_box), self->focus_adjustment);
} }

View file

@ -113,12 +113,12 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <child>
<object class="GtkScrolledWindow" id="main_scroll"> <object class="GtkScrolledWindow">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="hscrollbar_policy">never</property> <property name="hscrollbar_policy">never</property>
<child> <child>
<object class="HdyClamp" id="main_box"> <object class="HdyClamp">
<property name="visible">True</property> <property name="visible">True</property>
<property name="margin_top">32</property> <property name="margin_top">32</property>
<property name="margin_bottom">32</property> <property name="margin_bottom">32</property>