gnome-media r4066 - in trunk/gnome-volume-control: . src
- From: mccann svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-media r4066 - in trunk/gnome-volume-control: . src
- Date: Wed, 19 Nov 2008 19:06:38 +0000 (UTC)
Author: mccann
Date: Wed Nov 19 19:06:38 2008
New Revision: 4066
URL: http://svn.gnome.org/viewvc/gnome-media?rev=4066&view=rev
Log:
2008-11-19 William Jon McCann <jmccann redhat com>
* src/gvc-sound-theme-chooser.c (constrain_list_size),
(setup_list_size_constraint), (gvc_sound_theme_chooser_init):
Make the initial size of the scrolled window more reasonable.
Modified:
trunk/gnome-volume-control/ChangeLog
trunk/gnome-volume-control/src/gvc-sound-theme-chooser.c
Modified: trunk/gnome-volume-control/src/gvc-sound-theme-chooser.c
==============================================================================
--- trunk/gnome-volume-control/src/gvc-sound-theme-chooser.c (original)
+++ trunk/gnome-volume-control/src/gvc-sound-theme-chooser.c Wed Nov 19 19:06:38 2008
@@ -1309,6 +1309,32 @@
}
static void
+constrain_list_size (GtkWidget *widget,
+ GtkRequisition *requisition,
+ GtkWidget *to_size)
+{
+ GtkRequisition req;
+ int max_height;
+
+ /* constrain height to be the tree height up to a max */
+ max_height = (gdk_screen_get_height (gtk_widget_get_screen (widget))) / 4;
+
+ gtk_widget_size_request (to_size, &req);
+
+ requisition->height = MIN (req.height, max_height);
+}
+
+static void
+setup_list_size_constraint (GtkWidget *widget,
+ GtkWidget *to_size)
+{
+ g_signal_connect (widget,
+ "size-request",
+ G_CALLBACK (constrain_list_size),
+ to_size);
+}
+
+static void
gvc_sound_theme_chooser_init (GvcSoundThemeChooser *chooser)
{
GtkWidget *box;
@@ -1340,6 +1366,8 @@
chooser);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ setup_list_size_constraint (scrolled_window, chooser->priv->treeview);
+
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]