mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
theme-viewer: Fix invisible borders
https://bugzilla.gnome.org/show_bug.cgi?id=662895
This commit is contained in:
parent
efc90173b1
commit
0b7f2f8cd3
@ -203,8 +203,8 @@ meta_preview_draw (GtkWidget *widget,
|
|||||||
ensure_info (preview);
|
ensure_info (preview);
|
||||||
cairo_save (cr);
|
cairo_save (cr);
|
||||||
|
|
||||||
client_width = allocation.width - preview->borders.visible.left - preview->borders.visible.right;
|
client_width = allocation.width - preview->borders.total.left - preview->borders.total.right;
|
||||||
client_height = allocation.height - preview->borders.visible.top - preview->borders.visible.bottom;
|
client_height = allocation.height - preview->borders.total.top - preview->borders.total.bottom;
|
||||||
|
|
||||||
if (client_width < 0)
|
if (client_width < 0)
|
||||||
client_width = 1;
|
client_width = 1;
|
||||||
@ -246,7 +246,7 @@ meta_preview_get_preferred_width (GtkWidget *widget,
|
|||||||
|
|
||||||
ensure_info (preview);
|
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));
|
child = gtk_bin_get_child (GTK_BIN (preview));
|
||||||
if (child && gtk_widget_get_visible (child))
|
if (child && gtk_widget_get_visible (child))
|
||||||
@ -277,7 +277,7 @@ meta_preview_get_preferred_height (GtkWidget *widget,
|
|||||||
|
|
||||||
ensure_info (preview);
|
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));
|
child = gtk_bin_get_child (GTK_BIN (preview));
|
||||||
if (child && gtk_widget_get_visible (child))
|
if (child && gtk_widget_get_visible (child))
|
||||||
@ -314,11 +314,11 @@ meta_preview_size_allocate (GtkWidget *widget,
|
|||||||
if (child && gtk_widget_get_visible (child))
|
if (child && gtk_widget_get_visible (child))
|
||||||
{
|
{
|
||||||
gtk_widget_get_allocation (widget, &widget_allocation);
|
gtk_widget_get_allocation (widget, &widget_allocation);
|
||||||
child_allocation.x = widget_allocation.x + preview->borders.visible.left;
|
child_allocation.x = widget_allocation.x + preview->borders.total.left;
|
||||||
child_allocation.y = widget_allocation.y + preview->borders.visible.top;
|
child_allocation.y = widget_allocation.y + preview->borders.total.top;
|
||||||
|
|
||||||
child_allocation.width = MAX (1, widget_allocation.width - preview->borders.visible.left - preview->borders.visible.right);
|
child_allocation.width = MAX (1, widget_allocation.width - preview->borders.total.left - preview->borders.total.right);
|
||||||
child_allocation.height = MAX (1, widget_allocation.height - preview->borders.visible.top - preview->borders.visible.bottom);
|
child_allocation.height = MAX (1, widget_allocation.height - preview->borders.total.top - preview->borders.total.bottom);
|
||||||
|
|
||||||
gtk_widget_size_allocate (child, &child_allocation);
|
gtk_widget_size_allocate (child, &child_allocation);
|
||||||
}
|
}
|
||||||
|
@ -1013,8 +1013,8 @@ run_theme_benchmark (void)
|
|||||||
*/
|
*/
|
||||||
pixmap = gdk_window_create_similar_surface (gtk_widget_get_window (widget),
|
pixmap = gdk_window_create_similar_surface (gtk_widget_get_window (widget),
|
||||||
CAIRO_CONTENT_COLOR,
|
CAIRO_CONTENT_COLOR,
|
||||||
client_width + borders.visible.left + borders.visible.right,
|
client_width + borders.total.left + borders.total.right,
|
||||||
client_height + borders.visible.top + borders.visible.bottom);
|
client_height + borders.total.top + borders.total.bottom);
|
||||||
|
|
||||||
cr = cairo_create (pixmap);
|
cr = cairo_create (pixmap);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user