generic-poky/meta/recipes-gnome/gtk+/gtk+-2.12.7/combo-arrow-size.patch

70 lines
2.3 KiB
Diff
Raw Normal View History

recipes: Add Upstream-Status to multiple recipes gtk+: Add Upstream-Status ed: Add Upstream-Status gnome-common: Add Upstream-Status libmatchbox: Add Upstream-Status matchbox-wm: Add Upstream-Status x11vnc: Add Upstream-Status xtscal: Add Upstream-Status eds-dbus: Add Upstream-Status matchbox-desktop: Add Upstream-Status matchbox-keyboard: Add Upstream-Status matchbox-stroke: Add Upstream-Status matchbox-theme-sato: Add Upstream-Status owl-video-widget: Add Upstream-Status beecrypt: Add Upstream-Status gnome-icon-theme: Add Upstream-Status tslib: Add Upstream-Status libowl-av: Add Upstream-Status sato-icon-theme: Add Upstream-Status web-webkit: Add Upstream-Status metacity: Add Upstream-Status apr: Add Upstream-Status gdk-pixbuf: Add Upstream-Status pcmanfm: Add Upstream-Status gpgme: Add Upstream-Status eee-acpi-scripts: Add Upstream-Status libgalago: Add Upstream-Status python-pygtk: Add Upstream-Status gnome-mime-data: Add Upstream-Status clutter: Add Upstream-Status clutter-gtk: Add Upstream-Status tidy: Add Upstream-Status mutter: Add Upstream-Status xcursor-transparent-theme: Add Upstream-Status leafpad: Add Upstream-Status matchbox-config-gtk: Add Upstream-Status contacts: Add Upstream-Status dates: Add Upstream-Status web: Add Upstream-Status webkit: Add Upstream-Status - Also removed empty fix_im.patch apr-util: Add Upstream-Status libcroco: Add Upstream-Status liboil: Add Upstream-Status libxslt: Add Upstream-Status libglade: Add Upstream-Status gnome-terminal: Add Upstream-Status xev: Add Upstream-Status claws-mail: Add Upstream-Status clipboard-manager: Add Upstream-Status epdfview: Add Upstream-Status kf: Add Upstream-Status qemu: Add Upstream-Status clutter-gst: Add Upstream-Status table: Add Upstream-Status matchbox-panel-2: Add Upstream-Status (From OE-Core rev: 10bdb737c2c4c6996fd035849109a1e07580a6b9) Signed-off-by: Zhai Edwin <edwin.zhai@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-12 00:08:05 +00:00
Upstream-Status: Inappropriate [enable feature]
Index: gtk/gtkcombobox.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcombobox.c,v
retrieving revision 1.185
diff -u -p -r1.185 gtkcombobox.c
--- gtk/gtkcombobox.c 12 Oct 2006 13:48:07 -0000 1.185
+++ gtk/gtkcombobox.c 1 Nov 2006 19:01:09 -0000
@@ -756,6 +756,25 @@ gtk_combo_box_class_init (GtkComboBoxCla
FALSE,
GTK_PARAM_READABLE));
+ /**
+ * GtkComboBox:arrow-size:
+ *
+ * Sets the minimum size of the arrow in the combo box. Note
+ * that the arrow size is coupled to the font size, so in case
+ * a larger font is used, the arrow will be larger than set
+ * by arrow size.
+ *
+ * Since: 2.12
+ */
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("arrow-size",
+ P_("Arrow Size"),
+ P_("The minimum size of the arrow in the combo box"),
+ 0,
+ G_MAXINT,
+ 15,
+ GTK_PARAM_READABLE));
+
g_type_class_add_private (object_class, sizeof (GtkComboBoxPrivate));
}
@@ -1897,7 +1916,12 @@ gtk_combo_box_size_request (GtkWidget
{
gint width, height;
gint focus_width, focus_pad;
+ gint font_size;
+ gint arrow_size;
GtkRequisition bin_req;
+ PangoContext *context;
+ PangoFontMetrics *metrics;
+ PangoFontDescription *font_desc;
GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
@@ -1910,7 +1934,20 @@ gtk_combo_box_size_request (GtkWidget
gtk_widget_style_get (GTK_WIDGET (widget),
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
+ "arrow-size", &arrow_size,
NULL);
+
+ font_desc = GTK_BIN (widget)->child->style->font_desc;
+ context = gtk_widget_get_pango_context (widget);
+ metrics = pango_context_get_metrics (context, font_desc,
+ pango_context_get_language (context));
+ font_size = PANGO_PIXELS (pango_font_metrics_get_ascent (metrics) +
+ pango_font_metrics_get_descent (metrics));
+ pango_font_metrics_unref (metrics);
+
+ arrow_size = MAX (arrow_size, font_size);
+
+ gtk_widget_set_size_request (combo_box->priv->arrow, arrow_size, arrow_size);
if (!combo_box->priv->tree_view)
{