summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2009-01-26 03:01:01 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2009-01-26 03:01:01 +0000
commit49061dd178c71ab298e31f560d544f829cda3f24 (patch)
tree18b88e177a8d6c72b714aa797ee1a726b730e68f
parentcea413caa18afabdd2009fb979ca2b98f252b504 (diff)
downloadgdk-pixbuf-49061dd178c71ab298e31f560d544f829cda3f24.tar.gz
More action-related fixes
svn path=/trunk/; revision=22218
-rw-r--r--ChangeLog11
-rw-r--r--gtk/gtkrecentchoosermenu.c5
-rw-r--r--gtk/gtktoggletoolbutton.c12
-rw-r--r--gtk/gtktoolbutton.c3
-rw-r--r--gtk/gtktoolitem.c10
-rw-r--r--gtk/gtktoolitem.h4
6 files changed, 35 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 6e69a3ff5..e2050e6e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2009-01-25 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtktoolitem.[hc]: Export the function to create a proxy
+ menuitem from the action for use in subclasses.
+
+ * gtk/gtktoolbutton.c:
+ * gtk/gtktoggletoolbutton.c: Use it here.
+
+ * gtk/gtkrecentchoosermenu.c: Avoid temporary empty state that
+ can lead to a recent action proxy menu being erroneously hidden.
+
+2009-01-25 Matthias Clasen <mclasen@redhat.com>
+
* gtk/gtkradioaction.c: Set draw-as-radio to TRUE.
2009-01-24 Matthias Clasen <mclasen@redhat.com>
diff --git a/gtk/gtkrecentchoosermenu.c b/gtk/gtkrecentchoosermenu.c
index bc02aa6df..e658eef06 100644
--- a/gtk/gtkrecentchoosermenu.c
+++ b/gtk/gtkrecentchoosermenu.c
@@ -970,6 +970,8 @@ idle_populate_func (gpointer data)
return FALSE;
}
+ else
+ gtk_widget_hide (pdata->placeholder);
pdata->n_items = g_list_length (pdata->items);
pdata->loaded_items = 0;
@@ -1056,9 +1058,8 @@ gtk_recent_chooser_menu_populate (GtkRecentChooserMenu *menu)
priv->icon_size = get_icon_size_for_widget (GTK_WIDGET (menu));
- /* remove our menu items first and hide the placeholder */
+ /* remove our menu items first */
gtk_recent_chooser_menu_dispose_items (menu);
- gtk_widget_hide (priv->placeholder);
priv->populate_id = gdk_threads_add_idle_full (G_PRIORITY_HIGH_IDLE + 30,
idle_populate_func,
diff --git a/gtk/gtktoggletoolbutton.c b/gtk/gtktoggletoolbutton.c
index c527c136b..062a2d082 100644
--- a/gtk/gtktoggletoolbutton.c
+++ b/gtk/gtktoggletoolbutton.c
@@ -201,10 +201,16 @@ gtk_toggle_tool_button_create_menu_proxy (GtkToolItem *item)
GtkStockItem stock_item;
gboolean use_mnemonic = TRUE;
const char *label;
+ GtkWidget *label_widget;
+ const gchar *label_text;
+ const gchar *stock_id;
- GtkWidget *label_widget = gtk_tool_button_get_label_widget (tool_button);
- const gchar *label_text = gtk_tool_button_get_label (tool_button);
- const gchar *stock_id = gtk_tool_button_get_stock_id (tool_button);
+ if (_gtk_tool_item_create_menu_proxy (item))
+ return TRUE;
+
+ label_widget = gtk_tool_button_get_label_widget (tool_button);
+ label_text = gtk_tool_button_get_label (tool_button);
+ stock_id = gtk_tool_button_get_stock_id (tool_button);
if (GTK_IS_LABEL (label_widget))
{
diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c
index 6c00662b4..c99169a22 100644
--- a/gtk/gtktoolbutton.c
+++ b/gtk/gtktoolbutton.c
@@ -642,6 +642,9 @@ gtk_tool_button_create_menu_proxy (GtkToolItem *item)
gboolean use_mnemonic = TRUE;
const char *label;
+ if (_gtk_tool_item_create_menu_proxy (item))
+ return TRUE;
+
if (GTK_IS_LABEL (button->priv->label_widget))
{
label = gtk_label_get_label (GTK_LABEL (button->priv->label_widget));
diff --git a/gtk/gtktoolitem.c b/gtk/gtktoolitem.c
index 54b60e792..6360c444a 100644
--- a/gtk/gtktoolitem.c
+++ b/gtk/gtktoolitem.c
@@ -127,8 +127,6 @@ static gboolean gtk_tool_item_real_set_tooltip (GtkToolItem *tool_item,
const gchar *tip_text,
const gchar *tip_private);
-static gboolean gtk_tool_item_create_menu_proxy (GtkToolItem *item);
-
static void gtk_tool_item_activatable_interface_init (GtkActivatableIface *iface);
static void gtk_tool_item_activatable_update (GtkActivatable *activatable,
GtkAction *action,
@@ -169,7 +167,7 @@ gtk_tool_item_class_init (GtkToolItemClass *klass)
widget_class->size_allocate = gtk_tool_item_size_allocate;
widget_class->parent_set = gtk_tool_item_parent_set;
- klass->create_menu_proxy = gtk_tool_item_create_menu_proxy;
+ klass->create_menu_proxy = _gtk_tool_item_create_menu_proxy;
klass->set_tooltip = gtk_tool_item_real_set_tooltip;
g_object_class_install_property (object_class,
@@ -554,8 +552,8 @@ gtk_tool_item_size_allocate (GtkWidget *widget,
}
}
-static gboolean
-gtk_tool_item_create_menu_proxy (GtkToolItem *item)
+gboolean
+_gtk_tool_item_create_menu_proxy (GtkToolItem *item)
{
GtkWidget *menu_item;
gboolean visible_overflown;
@@ -574,6 +572,8 @@ gtk_tool_item_create_menu_proxy (GtkToolItem *item)
}
else
gtk_tool_item_set_proxy_menu_item (item, "gtk-action-menu-item", NULL);
+
+ return TRUE;
}
return FALSE;
diff --git a/gtk/gtktoolitem.h b/gtk/gtktoolitem.h
index 5432a2b6c..a81b06bb8 100644
--- a/gtk/gtktoolitem.h
+++ b/gtk/gtktoolitem.h
@@ -128,6 +128,10 @@ void gtk_tool_item_rebuild_menu (GtkToolItem *tool_item);
void gtk_tool_item_toolbar_reconfigured (GtkToolItem *tool_item);
+/* private */
+
+gboolean _gtk_tool_item_create_menu_proxy (GtkToolItem *tool_item);
+
G_END_DECLS
#endif /* __GTK_TOOL_ITEM_H__ */