mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 22:10:08 +00:00
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:
parent
f0cb720063
commit
94eb8c9b15
@ -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>
|
2007-01-28 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkframe.c (gtk_frame_size_allocation): Fix a
|
* gtk/gtkframe.c (gtk_frame_size_allocation): Fix a
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#include "gtkseparatortoolitem.h"
|
#include "gtkseparatortoolitem.h"
|
||||||
#include "gtkmenu.h"
|
#include "gtkmenu.h"
|
||||||
#include "gtkradiobutton.h"
|
#include "gtkradiobutton.h"
|
||||||
|
#include "gtktoolbar.h"
|
||||||
#include "gtkbindings.h"
|
#include "gtkbindings.h"
|
||||||
#include <gdk/gdkkeysyms.h>
|
#include <gdk/gdkkeysyms.h>
|
||||||
#include "gtkmarshalers.h"
|
#include "gtkmarshalers.h"
|
||||||
@ -242,6 +243,12 @@ static ToolbarContent *toolbar_content_new_tool_item (GtkToolbar
|
|||||||
GtkToolItem *item,
|
GtkToolItem *item,
|
||||||
gboolean is_placeholder,
|
gboolean is_placeholder,
|
||||||
gint pos);
|
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,
|
static void toolbar_content_remove (ToolbarContent *content,
|
||||||
GtkToolbar *toolbar);
|
GtkToolbar *toolbar);
|
||||||
static void toolbar_content_free (ToolbarContent *content);
|
static void toolbar_content_free (ToolbarContent *content);
|
||||||
@ -1444,6 +1451,7 @@ gtk_toolbar_size_allocate (GtkWidget *widget,
|
|||||||
GtkRequisition arrow_requisition;
|
GtkRequisition arrow_requisition;
|
||||||
gboolean overflowing;
|
gboolean overflowing;
|
||||||
gboolean size_changed;
|
gboolean size_changed;
|
||||||
|
gdouble elapsed;
|
||||||
GtkAllocation item_area;
|
GtkAllocation item_area;
|
||||||
GtkShadowType shadow_type;
|
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)
|
for (list = priv->content, i = 0; list != NULL; list = list->next, ++i)
|
||||||
{
|
{
|
||||||
ToolbarContent *content = list->data;
|
ToolbarContent *content = list->data;
|
||||||
@ -2073,13 +2082,13 @@ gtk_toolbar_screen_changed (GtkWidget *widget,
|
|||||||
toolbar);
|
toolbar);
|
||||||
|
|
||||||
priv->settings = g_object_ref (settings);
|
priv->settings = g_object_ref (settings);
|
||||||
|
|
||||||
style_change_notify (toolbar);
|
|
||||||
icon_size_change_notify (toolbar);
|
|
||||||
animation_change_notify (toolbar);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
priv->settings = NULL;
|
priv->settings = NULL;
|
||||||
|
|
||||||
|
style_change_notify (toolbar);
|
||||||
|
icon_size_change_notify (toolbar);
|
||||||
|
animation_change_notify (toolbar);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -3737,6 +3746,7 @@ internal_insert_element (GtkToolbar *toolbar,
|
|||||||
gboolean use_stock)
|
gboolean use_stock)
|
||||||
{
|
{
|
||||||
GtkWidget *box;
|
GtkWidget *box;
|
||||||
|
ToolbarContent *content;
|
||||||
char *free_me = NULL;
|
char *free_me = NULL;
|
||||||
|
|
||||||
GtkWidget *child_widget;
|
GtkWidget *child_widget;
|
||||||
@ -3846,6 +3856,9 @@ internal_insert_element (GtkToolbar *toolbar,
|
|||||||
tooltip_text, tooltip_private_text);
|
tooltip_text, tooltip_private_text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
content = toolbar_content_new_compatibility (toolbar, type, child_widget,
|
||||||
|
child_icon, child_label, position);
|
||||||
|
|
||||||
if (free_me)
|
if (free_me)
|
||||||
g_free (free_me);
|
g_free (free_me);
|
||||||
|
|
||||||
@ -3920,6 +3933,54 @@ toolbar_content_new_tool_item (GtkToolbar *toolbar,
|
|||||||
return content;
|
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
|
static void
|
||||||
toolbar_content_remove (ToolbarContent *content,
|
toolbar_content_remove (ToolbarContent *content,
|
||||||
GtkToolbar *toolbar)
|
GtkToolbar *toolbar)
|
||||||
|
Loading…
Reference in New Issue
Block a user