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
This commit is contained in:
Matthias Clasen 2007-01-29 03:24:09 +00:00 committed by Matthias Clasen
parent f0cb720063
commit 94eb8c9b15
2 changed files with 72 additions and 4 deletions

View File

@ -1,3 +1,10 @@
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

View File

@ -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);
}
else
priv->settings = NULL;
style_change_notify (toolbar);
icon_size_change_notify (toolbar);
animation_change_notify (toolbar);
}
else
priv->settings = NULL;
}
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)