gtk+ r21751 - in trunk: . gtk
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r21751 - in trunk: . gtk
- Date: Sun, 2 Nov 2008 05:01:24 +0000 (UTC)
Author: matthiasc
Date: Sun Nov 2 05:01:23 2008
New Revision: 21751
URL: http://svn.gnome.org/viewvc/gtk+?rev=21751&view=rev
Log:
2008-11-02 Matthias Clasen <mclasen redhat com>
* gtk/gtkimagemenuitem.c: Make it possible to overrule the
gtk-menu-images setting.
* gtk/gtkaction.c (connect_proxy): Show the image before adding
it to the image menu item.
Modified:
trunk/ChangeLog
trunk/gtk/gtkaction.c
trunk/gtk/gtkimagemenuitem.c
Modified: trunk/gtk/gtkaction.c
==============================================================================
--- trunk/gtk/gtkaction.c (original)
+++ trunk/gtk/gtkaction.c Sun Nov 2 05:01:23 2008
@@ -749,9 +749,9 @@
if (!image)
{
image = gtk_image_new ();
+ gtk_widget_show (image);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (proxy),
image);
- gtk_widget_show (image);
}
if (action->private_data->stock_id &&
Modified: trunk/gtk/gtkimagemenuitem.c
==============================================================================
--- trunk/gtk/gtkimagemenuitem.c (original)
+++ trunk/gtk/gtkimagemenuitem.c Sun Nov 2 05:01:23 2008
@@ -42,6 +42,7 @@
GtkRequisition *requisition);
static void gtk_image_menu_item_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
+static void gtk_image_menu_item_map (GtkWidget *widget);
static void gtk_image_menu_item_remove (GtkContainer *container,
GtkWidget *child);
static void gtk_image_menu_item_toggle_size_request (GtkMenuItem *menu_item,
@@ -85,6 +86,7 @@
widget_class->screen_changed = gtk_image_menu_item_screen_changed;
widget_class->size_request = gtk_image_menu_item_size_request;
widget_class->size_allocate = gtk_image_menu_item_size_allocate;
+ widget_class->map = gtk_image_menu_item_map;
container_class->forall = gtk_image_menu_item_forall;
container_class->remove = gtk_image_menu_item_remove;
@@ -172,6 +174,19 @@
}
static void
+gtk_image_menu_item_map (GtkWidget *widget)
+{
+ GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (widget);
+
+ GTK_WIDGET_CLASS (gtk_image_menu_item_parent_class)->map (widget);
+
+ if (image_menu_item->image)
+ g_object_set (image_menu_item->image,
+ "visible", show_image (image_menu_item),
+ NULL);
+}
+
+static void
gtk_image_menu_item_destroy (GtkObject *object)
{
GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (object);
@@ -197,7 +212,7 @@
*requisition = 0;
- if (image_menu_item->image && show_image (image_menu_item))
+ if (image_menu_item->image && GTK_WIDGET_VISIBLE (image_menu_item->image))
{
GtkRequisition image_requisition;
guint toggle_spacing;
@@ -237,10 +252,8 @@
pack_dir = GTK_PACK_DIRECTION_LTR;
image_menu_item = GTK_IMAGE_MENU_ITEM (widget);
-
- if (image_menu_item->image &&
- GTK_WIDGET_VISIBLE (image_menu_item->image) &&
- show_image (image_menu_item))
+
+ if (image_menu_item->image && GTK_WIDGET_VISIBLE (image_menu_item->image))
{
GtkRequisition child_requisition;
@@ -284,7 +297,7 @@
GTK_WIDGET_CLASS (gtk_image_menu_item_parent_class)->size_allocate (widget, allocation);
- if (image_menu_item->image && show_image (image_menu_item))
+ if (image_menu_item->image && GTK_WIDGET_VISIBLE (image_menu_item->image))
{
gint x, y, offset;
GtkRequisition child_requisition;
@@ -486,7 +499,6 @@
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
}
- gtk_widget_show (image);
return item;
}
@@ -518,7 +530,7 @@
return;
gtk_widget_set_parent (image, GTK_WIDGET (image_menu_item));
- g_object_set (image,
+ g_object_set (image,
"visible", show_image (image_menu_item),
"no-show-all", TRUE,
NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]