diff options
author | Timm Bäder <mail@baedert.org> | 2017-07-08 10:33:45 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-07-19 21:27:15 -0400 |
commit | 097ab2baed1e5cc77956cdb12c13c0b2933fe50e (patch) | |
tree | acc04c0ef851a023079ed1ae46cd5087952028be /gtk | |
parent | e2e91bf9bc7808de7079474ec6c9e4f3e13d30c7 (diff) | |
download | gtk+-097ab2baed1e5cc77956cdb12c13c0b2933fe50e.tar.gz |
widget: Draw css box after pushing a opacity node
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkwidget.c | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index b85313b1bb..f9a1111ff6 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -15360,21 +15360,6 @@ gtk_widget_snapshot (GtkWidget *widget, _gtk_widget_get_allocation (widget, &allocation); - if (!GTK_IS_WINDOW (widget) && - !GTK_IS_POPOVER (widget)) - { - gtk_snapshot_offset (snapshot, margin.left, margin.top); - gtk_css_style_snapshot_background (style, - snapshot, - allocation.width - margin.left - margin.right, - allocation.height - margin.top - margin.bottom); - gtk_css_style_snapshot_border (style, - snapshot, - allocation.width - margin.left - margin.right, - allocation.height - margin.top - margin.bottom); - gtk_snapshot_offset (snapshot, - margin.left, - margin.top); - } - if (mode == RENDER_DRAW) { cairo_t *cr; @@ -15390,6 +15375,20 @@ gtk_widget_snapshot (GtkWidget *widget, if (opacity < 1.0) gtk_snapshot_push_opacity (snapshot, opacity, "Opacity<%s,%f>", G_OBJECT_TYPE_NAME (widget), opacity); + if (!GTK_IS_WINDOW (widget)) + { + gtk_snapshot_offset (snapshot, margin.left, margin.top); + gtk_css_style_snapshot_background (style, + snapshot, + allocation.width - margin.left - margin.right, + allocation.height - margin.top - margin.bottom); + gtk_css_style_snapshot_border (style, + snapshot, + allocation.width - margin.left - margin.right, + allocation.height - margin.top - margin.bottom); + gtk_snapshot_offset (snapshot, - margin.left, - margin.top); + } + /* Offset to content allocation */ gtk_snapshot_offset (snapshot, margin.left + padding.left + border.left, margin.top + border.top + padding.top); klass->snapshot (widget, snapshot); @@ -15410,19 +15409,21 @@ gtk_widget_snapshot (GtkWidget *widget, cairo_destroy (cr); } + + if (gtk_widget_has_visible_focus (widget)) + { + gtk_snapshot_offset (snapshot, margin.left, margin.top); + gtk_css_style_snapshot_outline (style, + snapshot, + allocation.width - margin.left - margin.right, + allocation.height - margin.top - margin.bottom); + gtk_snapshot_offset (snapshot, - margin.left, - margin.top); + } + if (opacity < 1.0) gtk_snapshot_pop (snapshot); } - if (gtk_widget_has_visible_focus (widget)) - { - gtk_snapshot_offset (snapshot, margin.left, margin.top); - gtk_css_style_snapshot_outline (style, - snapshot, - allocation.width - margin.left - margin.right, - allocation.height - margin.top - margin.bottom); - gtk_snapshot_offset (snapshot, - margin.left, - margin.top); - } gtk_css_filter_value_pop_snapshot (filter_value, snapshot); |