mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-17 23:50:16 +00:00
print: Center sheet drawing vertically
Center the page ordering indicator vertically, relative to the checkboxes next to it.
This commit is contained in:
parent
7866d4ba21
commit
99c65b1587
@ -2241,6 +2241,7 @@ draw_collate_cb (GtkWidget *widget,
|
|||||||
gboolean collate, reverse, rtl;
|
gboolean collate, reverse, rtl;
|
||||||
gint copies;
|
gint copies;
|
||||||
gint text_x;
|
gint text_x;
|
||||||
|
gint x1, x2, p1, p2, y;
|
||||||
|
|
||||||
collate = dialog_get_collate (dialog);
|
collate = dialog_get_collate (dialog);
|
||||||
reverse = dialog_get_reverse (dialog);
|
reverse = dialog_get_reverse (dialog);
|
||||||
@ -2250,22 +2251,39 @@ draw_collate_cb (GtkWidget *widget,
|
|||||||
|
|
||||||
gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &size, NULL);
|
gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &size, NULL);
|
||||||
scale = size / 48.0;
|
scale = size / 48.0;
|
||||||
text_x = rtl ? 4 : 11;
|
|
||||||
|
|
||||||
if (copies == 1)
|
y = (gtk_widget_get_allocated_height (widget) - (26 * scale + 10)) / 2;
|
||||||
|
if (rtl)
|
||||||
{
|
{
|
||||||
paint_page (widget, cr, scale, rtl ? 40: 15, 5, reverse ? "1" : "2", text_x);
|
x1 = gtk_widget_get_allocated_width (widget) - 30 * scale;
|
||||||
paint_page (widget, cr, scale, rtl ? 50: 5, 15, reverse ? "2" : "1", text_x);
|
x2 = gtk_widget_get_allocated_width (widget) - 65 * scale;
|
||||||
|
p1 = 0;
|
||||||
|
p2 = 10;
|
||||||
|
text_x = 4;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
paint_page (widget, cr, scale, rtl ? 40: 15, 5, collate == reverse ? "1" : "2", text_x);
|
x1 = 0;
|
||||||
paint_page (widget, cr, scale, rtl ? 50: 5, 15, reverse ? "2" : "1", text_x);
|
x2 = 35;
|
||||||
|
p1 = 10;
|
||||||
paint_page (widget, cr, scale, rtl ? 5 : 50, 5, reverse ? "1" : "2", text_x);
|
p2 = 0;
|
||||||
paint_page (widget, cr, scale, rtl ? 15 : 40, 15, collate == reverse ? "2" : "1", text_x);
|
text_x = 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (copies == 1)
|
||||||
|
{
|
||||||
|
paint_page (widget, cr, scale, x1 + p1, y, reverse ? "1" : "2", text_x);
|
||||||
|
paint_page (widget, cr, scale, x1 + p2, y + 10, reverse ? "2" : "1", text_x);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
paint_page (widget, cr, scale, x1 + p1, y, collate == reverse ? "1" : "2", text_x);
|
||||||
|
paint_page (widget, cr, scale, x1 + p2, y + 10, reverse ? "2" : "1", text_x);
|
||||||
|
|
||||||
|
paint_page (widget, cr, scale, x2 + p1, y, reverse ? "1" : "2", text_x);
|
||||||
|
paint_page (widget, cr, scale, x2 + p2, y + 10, collate == reverse ? "2" : "1", text_x);
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user