Mercurial > pidgin.yaz
comparison src/gtkmenutray.c @ 11787:c9188d3eb9d3
[gaim-migrate @ 14078]
GtkMenuTray now set's it's minimum height to the height of GTK_ICON_SIZE_MENU. This removes the need for the blank menu item which ended up leaving an empty space when other items were added.
committer: Tailor Script <tailor@pidgin.im>
author | Gary Kramlich <grim@reaperworld.com> |
---|---|
date | Mon, 24 Oct 2005 03:37:31 +0000 |
parents | 767e3c0c5062 |
children | 7d2d926704aa |
comparison
equal
deleted
inserted
replaced
11786:2c8216659a84 | 11787:c9188d3eb9d3 |
---|---|
17 * along with this program; if not, write to the Free Software | 17 * along with this program; if not, write to the Free Software |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 */ | 19 */ |
20 #include "gtkmenutray.h" | 20 #include "gtkmenutray.h" |
21 | 21 |
22 #include <gtk/gtkiconfactory.h> | |
23 #include <gtk/gtkversion.h> | |
24 | |
22 /****************************************************************************** | 25 /****************************************************************************** |
23 * Enums | 26 * Enums |
24 *****************************************************************************/ | 27 *****************************************************************************/ |
25 enum { | 28 enum { |
26 PROP_ZERO = 0, | 29 PROP_ZERO = 0, |
115 g_object_class_install_property(object_class, PROP_BOX, pspec); | 118 g_object_class_install_property(object_class, PROP_BOX, pspec); |
116 } | 119 } |
117 | 120 |
118 static void | 121 static void |
119 gaim_gtk_menu_tray_init(GaimGtkMenuTray *menu_tray) { | 122 gaim_gtk_menu_tray_init(GaimGtkMenuTray *menu_tray) { |
123 GtkWidget *widget = GTK_WIDGET(menu_tray); | |
124 GtkSettings *settings; | |
125 gint height = -1; | |
126 | |
120 gtk_menu_item_set_right_justified(GTK_MENU_ITEM(menu_tray), TRUE); | 127 gtk_menu_item_set_right_justified(GTK_MENU_ITEM(menu_tray), TRUE); |
121 | 128 |
122 if(!GTK_IS_WIDGET(menu_tray->tray)) | 129 if(!GTK_IS_WIDGET(menu_tray->tray)) |
123 menu_tray->tray = gtk_hbox_new(FALSE, 0); | 130 menu_tray->tray = gtk_hbox_new(FALSE, 0); |
131 | |
132 #if GTK_CHECK_VERSION(2,2,0) | |
133 settings = | |
134 gtk_settings_get_for_screen(gtk_widget_get_screen(widget)); | |
135 #else | |
136 settings = gtk_settings_get_default(); | |
137 #endif | |
138 | |
139 if(gtk_icon_size_lookup_for_settings(settings, GTK_ICON_SIZE_MENU, | |
140 NULL, &height)) | |
141 { | |
142 gtk_widget_set_size_request(widget, -1, height); | |
143 } | |
124 | 144 |
125 gtk_container_add(GTK_CONTAINER(menu_tray), menu_tray->tray); | 145 gtk_container_add(GTK_CONTAINER(menu_tray), menu_tray->tray); |
126 | 146 |
127 gtk_widget_show(menu_tray->tray); | 147 gtk_widget_show(menu_tray->tray); |
128 } | 148 } |