summaryrefslogtreecommitdiff
path: root/gtk/gtktoolbar.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2017-07-11 09:58:21 +0200
committerMatthias Clasen <mclasen@redhat.com>2017-07-19 21:27:16 -0400
commit36ab70ddf5dbe993eb995bd9157f347258765922 (patch)
tree508f0ca9cf6b4fc990e88b0a5892b50f594890fe /gtk/gtktoolbar.c
parent95bd58ac00ede771ca80684e143fffdc61ff2194 (diff)
downloadgtk+-36ab70ddf5dbe993eb995bd9157f347258765922.tar.gz
widget: Add baseline and out_clip parameters to size-allocate
Since setting a clip is mandatory for almost all widgets, we can as well change the size-allocate signature to include a out_clip parameter, just like GtkCssGadget did. And since we now always propagate baselines, we might as well pass that one on to size-allocate. This way we can also make sure to transform the clip returned from size-allocate to parent-coordinates, i.e. the same coordinate space priv->allocation is in.
Diffstat (limited to 'gtk/gtktoolbar.c')
-rw-r--r--gtk/gtktoolbar.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index f8fa09dc01..1244cfba40 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -194,7 +194,9 @@ static void gtk_toolbar_get_property (GObject *object,
static void gtk_toolbar_snapshot (GtkWidget *widget,
GtkSnapshot *snapshot);
static void gtk_toolbar_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation);
+ const GtkAllocation *allocation,
+ int baseline,
+ GtkAllocation *out_clip);
static void gtk_toolbar_style_updated (GtkWidget *widget);
static gboolean gtk_toolbar_focus (GtkWidget *widget,
GtkDirectionType dir);
@@ -1263,8 +1265,10 @@ rebuild_menu (GtkToolbar *toolbar)
}
static void
-gtk_toolbar_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation)
+gtk_toolbar_size_allocate (GtkWidget *widget,
+ const GtkAllocation *allocation,
+ int baseline,
+ GtkAllocation *out_clip)
{
GtkToolbar *toolbar = GTK_TOOLBAR (widget);
GtkToolbarPrivate *priv = toolbar->priv;
@@ -1571,8 +1575,7 @@ gtk_toolbar_size_allocate (GtkWidget *widget,
if (need_arrow)
{
- gtk_widget_size_allocate (GTK_WIDGET (priv->arrow_button),
- &arrow_allocation);
+ gtk_widget_size_allocate (GTK_WIDGET (priv->arrow_button), &arrow_allocation, -1, out_clip);
gtk_widget_show (GTK_WIDGET (priv->arrow_button));
}
else
@@ -1585,8 +1588,6 @@ gtk_toolbar_size_allocate (GtkWidget *widget,
g_free (allocations);
g_free (new_states);
-
- gtk_widget_set_clip (widget, allocation);
}
static void
@@ -3117,9 +3118,10 @@ static void
toolbar_content_size_allocate (ToolbarContent *content,
GtkAllocation *allocation)
{
+ GtkAllocation clip;
+
content->allocation = *allocation;
- gtk_widget_size_allocate (GTK_WIDGET (content->item),
- allocation);
+ gtk_widget_size_allocate (GTK_WIDGET (content->item), allocation, -1, &clip);
}
static void