mouse: Set min-content-height on the scrolled window

Set a minimum content height of 490px for the panel when the
allocated height is smaller than 490px.

490 is an estimated value for the panels to properly fit on netbook
screens. See https://wiki.gnome.org/Design/SystemSettings#Notes

This also drops the max-content-height limit for the scrolled window,
as it is no longer necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=771743
This commit is contained in:
Felipe Borges 2016-10-17 15:01:21 +02:00 committed by Bastien Nocera
parent 8916a8a603
commit 6b3233359c
2 changed files with 16 additions and 1 deletions

View file

@ -312,6 +312,20 @@ device_changed (GsdDeviceManager *device_manager,
show_touchpad_enabling_switch (d));
}
static void
on_content_size_changed (GtkWidget *widget,
GtkAllocation *allocation,
gpointer data)
{
if (allocation->height < 490) {
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (widget),
GTK_POLICY_NEVER, GTK_POLICY_NEVER);
} else {
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (widget),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (widget), 490);
}
}
static void
cc_mouse_properties_finalize (GObject *object)
@ -380,6 +394,8 @@ cc_mouse_properties_init (CcMouseProperties *object)
gtk_container_add (GTK_CONTAINER (object), WID ("scrolled-window"));
setup_dialog (d);
g_signal_connect (WID ("scrolled-window"), "size-allocate", G_CALLBACK (on_content_size_changed), NULL);
}
GtkWidget *

View file

@ -21,7 +21,6 @@
<property name="can_focus">True</property>
<property name="shadow_type">none</property>
<property name="hscrollbar_policy">never</property>
<property name="max_content_height">440</property>
<child>
<object class="GtkBox" id="prefs_widget">
<property name="visible">True</property>