gtk+ r21745 - in trunk: . gtk
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r21745 - in trunk: . gtk
- Date: Sat, 1 Nov 2008 04:32:40 +0000 (UTC)
Author: matthiasc
Date: Sat Nov 1 04:32:40 2008
New Revision: 21745
URL: http://svn.gnome.org/viewvc/gtk+?rev=21745&view=rev
Log:
Bug 322934 â Replace menu's proxy icons with empty space hiding icons
* gtk/gtkmenu.c (gtk_menu_size_request): Use consistent padding
regardless of imagees or checks being in the menu. Also add
padding on the right edge.
Proposal by Luca Ferretti, patch by Jon McCann
Modified:
trunk/ChangeLog
trunk/gtk/gtkmenu.c
Modified: trunk/gtk/gtkmenu.c
==============================================================================
--- trunk/gtk/gtkmenu.c (original)
+++ trunk/gtk/gtkmenu.c Sat Nov 1 04:32:40 2008
@@ -31,6 +31,8 @@
#include "gtkaccellabel.h"
#include "gtkaccelmap.h"
#include "gtkbindings.h"
+#include "gtkcheckmenuitem.h"
+#include <gobject/gvaluecollector.h>
#include "gtkmain.h"
#include "gtkmarshalers.h"
#include "gtkmenu.h"
@@ -2429,10 +2431,26 @@
priv->heights[t] = MAX (priv->heights[t], part);
}
+ /* if the menu doesn't include any images or check items
+ * reserve the space so that all menus are consistent */
+ if (max_toggle_size == 0)
+ {
+ guint toggle_spacing;
+ guint indicator_size;
+
+ gtk_style_get (widget->style,
+ GTK_TYPE_CHECK_MENU_ITEM,
+ "toggle-spacing", &toggle_spacing,
+ "indicator-size", &indicator_size,
+ NULL);
+
+ max_toggle_size = indicator_size + toggle_spacing;
+ }
+
for (i = 0; i < gtk_menu_get_n_rows (menu); i++)
requisition->height += priv->heights[i];
- requisition->width += max_toggle_size + max_accel_width;
+ requisition->width += 2 * max_toggle_size + max_accel_width;
requisition->width *= gtk_menu_get_n_columns (menu);
gtk_widget_style_get (GTK_WIDGET (menu),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]