[libhandy/wip/exalm/css: 13/17] header-bar: Account for box-shadow when clipping
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy/wip/exalm/css: 13/17] header-bar: Account for box-shadow when clipping
- Date: Wed, 27 May 2020 11:01:35 +0000 (UTC)
commit d1aebcad2985b3681ca3d87c395e1b0dae9716a3
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Thu May 21 00:23:15 2020 +0500
header-bar: Account for box-shadow when clipping
Fixes https://gitlab.gnome.org/GNOME/libhandy/issues/274.
src/hdy-header-bar.c | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/src/hdy-header-bar.c b/src/hdy-header-bar.c
index aceedda3..b8f60768 100644
--- a/src/hdy-header-bar.c
+++ b/src/hdy-header-bar.c
@@ -1431,6 +1431,7 @@ hdy_header_bar_size_allocate (GtkWidget *widget,
HdyHeaderBarPrivate *priv = hdy_header_bar_get_instance_private (self);
GtkAllocation *allocations;
GtkAllocation title_allocation;
+ GtkAllocation clip;
gint nvis_children;
GList *l;
gint i;
@@ -1443,6 +1444,13 @@ hdy_header_bar_size_allocate (GtkWidget *widget,
GtkWidget *decoration_box[2] = { priv->titlebar_start_box, priv->titlebar_end_box };
gint decoration_width[2] = { 0 };
+ gtk_render_background_get_clip (gtk_widget_get_style_context (widget),
+ allocation->x,
+ allocation->y,
+ allocation->width,
+ allocation->height,
+ &clip);
+
gtk_widget_set_allocation (widget, allocation);
if (gtk_widget_get_realized (widget))
@@ -1557,6 +1565,8 @@ hdy_header_bar_size_allocate (GtkWidget *widget,
gtk_widget_size_allocate (priv->custom_title, &title_allocation);
else if (priv->label_box != NULL)
gtk_widget_size_allocate (priv->label_box, &title_allocation);
+
+ gtk_widget_set_clip (widget, &clip);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]