diff options
author | Victor Kareh <[email protected]> | 2019-05-23 12:55:13 -0400 |
---|---|---|
committer | Victor Kareh <[email protected]> | 2019-06-05 10:49:37 -0400 |
commit | 37db3c9e5d07ad8b813107be7cd4ae622793e2aa (patch) | |
tree | e2a8ca5cd8ba51da2f7f8855345c9502449b6b99 /src/ui/preview-widget.c | |
parent | 87da4bbb52c4540475896bb2af48b154ee1c6751 (diff) | |
download | marco-37db3c9e5d07ad8b813107be7cd4ae622793e2aa.tar.bz2 marco-37db3c9e5d07ad8b813107be7cd4ae622793e2aa.tar.xz |
theme-viewer: Fix invisible borders
https://bugzilla.gnome.org/show_bug.cgi?id=662895
upstream commit:
https://gitlab.gnome.org/GNOME/metacity/commit/6836a621
Diffstat (limited to 'src/ui/preview-widget.c')
-rw-r--r-- | src/ui/preview-widget.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/ui/preview-widget.c b/src/ui/preview-widget.c index e40db6c6..e6e08073 100644 --- a/src/ui/preview-widget.c +++ b/src/ui/preview-widget.c @@ -211,8 +211,8 @@ meta_preview_draw (GtkWidget *widget, border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); gtk_widget_get_allocation (widget, &allocation); - client_width = allocation.width - preview->borders.visible.left - preview->borders.visible.right - border_width * 2; - client_height = allocation.height - preview->borders.visible.top - preview->borders.visible.bottom - border_width * 2; + client_width = allocation.width - preview->borders.total.left - preview->borders.total.right - border_width * 2; + client_height = allocation.height - preview->borders.total.top - preview->borders.total.bottom - border_width * 2; if (client_width < 0) client_width = 1; @@ -254,7 +254,7 @@ meta_preview_get_preferred_width (GtkWidget *widget, ensure_info (preview); - *minimum = *natural = preview->borders.visible.left + preview->borders.visible.right; + *minimum = *natural = preview->borders.total.left + preview->borders.total.right; child = gtk_bin_get_child (GTK_BIN (preview)); if (child && gtk_widget_get_visible (child)) @@ -290,7 +290,7 @@ meta_preview_get_preferred_height (GtkWidget *widget, ensure_info (preview); - *minimum = *natural = preview->borders.visible.top + preview->borders.visible.bottom; + *minimum = *natural = preview->borders.total.top + preview->borders.total.bottom; child = gtk_bin_get_child (GTK_BIN (preview)); if (child && gtk_widget_get_visible (child)) @@ -335,11 +335,12 @@ meta_preview_size_allocate (GtkWidget *widget, gtk_widget_get_visible (child)) { gtk_widget_get_allocation (widget, &widget_allocation); - child_allocation.x = widget_allocation.x + border_width + preview->borders.visible.left; - child_allocation.y = widget_allocation.y + border_width + preview->borders.visible.top; + child_allocation.x = widget_allocation.x + border_width + preview->borders.total.left; + child_allocation.y = widget_allocation.y + border_width + preview->borders.total.top; + + child_allocation.width = MAX (1, widget_allocation.width - border_width * 2 - preview->borders.total.left - preview->borders.total.right); + child_allocation.height = MAX (1, widget_allocation.height - border_width * 2 - preview->borders.total.top - preview->borders.total.bottom); - child_allocation.width = MAX (1, widget_allocation.width - border_width * 2 - preview->borders.visible.left - preview->borders.visible.right); - child_allocation.height = MAX (1, widget_allocation.height - border_width * 2 - preview->borders.visible.top - preview->borders.visible.bottom); gtk_widget_size_allocate (gtk_bin_get_child (GTK_BIN (widget)), &child_allocation); } } |