Gentoo Archives: gentoo-commits

From: "Nirbheek Chauhan (nirbheek)" <nirbheek@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in x11-libs/gtk+/files: gtk+-3.2.2-toolbutton-icon-widget-GtkMisc.patch
Date: Wed, 16 Nov 2011 23:45:00
Message-Id: 20111116234446.5CF142004C@flycatcher.gentoo.org
1 nirbheek 11/11/16 23:44:46
2
3 Added: gtk+-3.2.2-toolbutton-icon-widget-GtkMisc.patch
4 Log:
5 Fix abort when icon widgets on gtktoolbuttons aren't GtkMisc, needed by gnome-boxes
6
7 (Portage version: 2.2.0_alpha74/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 x11-libs/gtk+/files/gtk+-3.2.2-toolbutton-icon-widget-GtkMisc.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-libs/gtk+/files/gtk+-3.2.2-toolbutton-icon-widget-GtkMisc.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-libs/gtk+/files/gtk+-3.2.2-toolbutton-icon-widget-GtkMisc.patch?rev=1.1&content-type=text/plain
14
15 Index: gtk+-3.2.2-toolbutton-icon-widget-GtkMisc.patch
16 ===================================================================
17 From 5cf0450c69f7bbdb0d1ca22ec54355e3b3e8c9c2 Mon Sep 17 00:00:00 2001
18 From: Cosimo Cecchi <cosimoc@×××××.org>
19 Date: Tue, 27 Sep 2011 21:06:59 +0000
20 Subject: toolbutton: don't force the icon widget to be a GtkMisc
21
22 There's really no reason the icon widget must be a GtkMisc. You might
23 want to use e.g. a GtkSpinner.
24 ---
25 diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c
26 index 8ee5fdf..934ca61 100644
27 --- a/gtk/gtktoolbutton.c
28 +++ b/gtk/gtktoolbutton.c
29 @@ -972,9 +972,9 @@ gtk_tool_button_new_from_stock (const gchar *stock_id)
30 /**
31 * gtk_tool_button_new:
32 * @label: (allow-none): a string that will be used as label, or %NULL
33 - * @icon_widget: (allow-none): a #GtkMisc widget that will be used as icon widget, or %NULL
34 + * @icon_widget: (allow-none): a widget that will be used as the button contents, or %NULL
35 *
36 - * Creates a new %GtkToolButton using @icon_widget as icon and @label as
37 + * Creates a new %GtkToolButton using @icon_widget as contents and @label as
38 * label.
39 *
40 * Return value: A new #GtkToolButton
41 @@ -987,7 +987,7 @@ gtk_tool_button_new (GtkWidget *icon_widget,
42 {
43 GtkToolButton *button;
44
45 - g_return_val_if_fail (icon_widget == NULL || GTK_IS_MISC (icon_widget), NULL);
46 + g_return_val_if_fail (icon_widget == NULL || GTK_IS_WIDGET (icon_widget), NULL);
47
48 button = g_object_new (GTK_TYPE_TOOL_BUTTON,
49 "label", label,
50 diff --git a/tests/testtoolbar.c b/tests/testtoolbar.c
51 index 16d847a..aafac3d 100644
52 --- a/tests/testtoolbar.c
53 +++ b/tests/testtoolbar.c
54 @@ -680,6 +680,12 @@ main (gint argc, gchar **argv)
55 add_item_to_list (store, item, "Terminal");
56 gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
57
58 + image = gtk_spinner_new ();
59 + gtk_spinner_start (GTK_SPINNER (image));
60 + item = gtk_tool_button_new (image, "Spinner");
61 + add_item_to_list (store, item, "Spinner");
62 + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
63 +
64 hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
65 gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
66 gtk_container_add (GTK_CONTAINER (vbox), hbox);
67 --
68 cgit v0.9.0.2