diff options
author | Matthias Clasen <mclasen@redhat.com> | 2007-01-29 03:24:09 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2007-01-29 03:24:09 +0000 |
commit | 94eb8c9b15494f6c6cc0bf4b9e1291512304e94a (patch) | |
tree | bbbfa13fd8c1c79c600e2f940ce0b94b9906f571 | |
parent | f0cb7200632814610734a5112273bf8d70bc8cd8 (diff) | |
download | gtk+-94eb8c9b15494f6c6cc0bf4b9e1291512304e94a.tar.gz |
Reinstate gtk_toolbar_content_new_compatibility() that was mistakenly
2007-01-28 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktoolbar.c: Reinstate gtk_toolbar_content_new_compatibility()
that was mistakenly "cleaned up" a while ago. Also
revert a problematic change to the screen_changed
handler. (#401598, Søren Sandmann)
svn path=/trunk/; revision=17232
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | gtk/gtktoolbar.c | 69 |
2 files changed, 72 insertions, 4 deletions
@@ -1,5 +1,12 @@ 2007-01-28 Matthias Clasen <mclasen@redhat.com> + * gtk/gtktoolbar.c: Reinstate gtk_toolbar_content_new_compatibility() + that was mistakenly "cleaned up" a while ago. Also + revert a problematic change to the screen_changed + handler. (#401598, Søren Sandmann) + +2007-01-28 Matthias Clasen <mclasen@redhat.com> + * gtk/gtkframe.c (gtk_frame_size_allocation): Fix a problem with large y thickness. (#136592, Xan Lopez) diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c index 8a37dc8500..55384e245e 100644 --- a/gtk/gtktoolbar.c +++ b/gtk/gtktoolbar.c @@ -38,6 +38,7 @@ #include "gtkseparatortoolitem.h" #include "gtkmenu.h" #include "gtkradiobutton.h" +#include "gtktoolbar.h" #include "gtkbindings.h" #include <gdk/gdkkeysyms.h> #include "gtkmarshalers.h" @@ -242,6 +243,12 @@ static ToolbarContent *toolbar_content_new_tool_item (GtkToolbar GtkToolItem *item, gboolean is_placeholder, gint pos); +static ToolbarContent *toolbar_content_new_compatibility (GtkToolbar *toolbar, + GtkToolbarChildType type, + GtkWidget *widget, + GtkWidget *icon, + GtkWidget *label, + gint pos); static void toolbar_content_remove (ToolbarContent *content, GtkToolbar *toolbar); static void toolbar_content_free (ToolbarContent *content); @@ -1444,6 +1451,7 @@ gtk_toolbar_size_allocate (GtkWidget *widget, GtkRequisition arrow_requisition; gboolean overflowing; gboolean size_changed; + gdouble elapsed; GtkAllocation item_area; GtkShadowType shadow_type; @@ -1727,6 +1735,7 @@ gtk_toolbar_size_allocate (GtkWidget *widget, } } + elapsed = g_timer_elapsed (priv->timer, NULL); for (list = priv->content, i = 0; list != NULL; list = list->next, ++i) { ToolbarContent *content = list->data; @@ -2073,13 +2082,13 @@ gtk_toolbar_screen_changed (GtkWidget *widget, toolbar); priv->settings = g_object_ref (settings); - - style_change_notify (toolbar); - icon_size_change_notify (toolbar); - animation_change_notify (toolbar); } else priv->settings = NULL; + + style_change_notify (toolbar); + icon_size_change_notify (toolbar); + animation_change_notify (toolbar); } static int @@ -3737,6 +3746,7 @@ internal_insert_element (GtkToolbar *toolbar, gboolean use_stock) { GtkWidget *box; + ToolbarContent *content; char *free_me = NULL; GtkWidget *child_widget; @@ -3846,6 +3856,9 @@ internal_insert_element (GtkToolbar *toolbar, tooltip_text, tooltip_private_text); } + content = toolbar_content_new_compatibility (toolbar, type, child_widget, + child_icon, child_label, position); + if (free_me) g_free (free_me); @@ -3920,6 +3933,54 @@ toolbar_content_new_tool_item (GtkToolbar *toolbar, return content; } +static ToolbarContent * +toolbar_content_new_compatibility (GtkToolbar *toolbar, + GtkToolbarChildType type, + GtkWidget *widget, + GtkWidget *icon, + GtkWidget *label, + gint pos) +{ + ToolbarContent *content; + GtkToolbarChild *child; + GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar); + + content = g_new0 (ToolbarContent, 1); + + child = &(content->u.compatibility.child); + + content->type = COMPATIBILITY; + child->type = type; + child->widget = widget; + child->icon = icon; + child->label = label; + + if (type != GTK_TOOLBAR_CHILD_SPACE) + { + gtk_widget_set_parent (child->widget, GTK_WIDGET (toolbar)); + } + else + { + content->u.compatibility.space_visible = TRUE; + gtk_widget_queue_resize (GTK_WIDGET (toolbar)); + } + + if (type == GTK_TOOLBAR_CHILD_BUTTON || + type == GTK_TOOLBAR_CHILD_TOGGLEBUTTON || + type == GTK_TOOLBAR_CHILD_RADIOBUTTON) + { + set_child_packing_and_visibility (toolbar, child); + } + + priv->content = g_list_insert (priv->content, content, pos); + toolbar->children = g_list_insert (toolbar->children, child, pos); + priv->need_rebuild = TRUE; + + toolbar->num_children++; + + return content; +} + static void toolbar_content_remove (ToolbarContent *content, GtkToolbar *toolbar) |