mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-06 19:00:12 +00:00
printing: Fix page drawing
We were drawing frames around our drawing areas.
This commit is contained in:
parent
8e1ef3620a
commit
41cd4c812e
@ -807,8 +807,8 @@ gtk_print_unix_dialog_init (GtkPrintUnixDialog *dialog)
|
|||||||
draw_page,
|
draw_page,
|
||||||
dialog, NULL);
|
dialog, NULL);
|
||||||
|
|
||||||
gtk_css_node_set_name (gtk_widget_get_css_node (priv->collate_image), I_("paper"));
|
gtk_css_node_set_name (gtk_widget_get_css_node (priv->collate_image), I_("drawing"));
|
||||||
gtk_css_node_set_name (gtk_widget_get_css_node (priv->page_layout_preview), I_("paper"));
|
gtk_css_node_set_name (gtk_widget_get_css_node (priv->page_layout_preview), I_("drawing"));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -2243,6 +2243,7 @@ paint_page (GtkWidget *widget,
|
|||||||
text_y = 21;
|
text_y = 21;
|
||||||
|
|
||||||
context = gtk_widget_get_style_context (widget);
|
context = gtk_widget_get_style_context (widget);
|
||||||
|
gtk_style_context_save_named (context, "paper");
|
||||||
|
|
||||||
gtk_render_background (context, cr, x, y, width, height);
|
gtk_render_background (context, cr, x, y, width, height);
|
||||||
gtk_render_frame (context, cr, x, y, width, height);
|
gtk_render_frame (context, cr, x, y, width, height);
|
||||||
@ -2253,6 +2254,8 @@ paint_page (GtkWidget *widget,
|
|||||||
cairo_set_font_size (cr, 9);
|
cairo_set_font_size (cr, 9);
|
||||||
cairo_move_to (cr, x + text_x, y + text_y);
|
cairo_move_to (cr, x + text_x, y + text_y);
|
||||||
cairo_show_text (cr, text);
|
cairo_show_text (cr, text);
|
||||||
|
|
||||||
|
gtk_style_context_restore (context);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -2324,9 +2327,8 @@ gtk_print_unix_dialog_style_updated (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;
|
||||||
|
|
||||||
gtk_widget_set_size_request (priv->collate_image,
|
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (priv->collate_image), (50 + 20) * scale);
|
||||||
(50 + 20) * scale,
|
gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (priv->collate_image), (15 + 26) * scale);
|
||||||
(15 + 26) * scale);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2798,6 +2800,7 @@ draw_page (GtkDrawingArea *da,
|
|||||||
}
|
}
|
||||||
|
|
||||||
context = gtk_widget_get_style_context (widget);
|
context = gtk_widget_get_style_context (widget);
|
||||||
|
gtk_style_context_save_named (context, "paper");
|
||||||
gtk_style_context_get_color (context, &color);
|
gtk_style_context_get_color (context, &color);
|
||||||
|
|
||||||
pos_x = (width - w) / 2;
|
pos_x = (width - w) / 2;
|
||||||
@ -3085,6 +3088,8 @@ draw_page (GtkDrawingArea *da,
|
|||||||
cairo_line_to (cr, pos_x + w + 0.5, pos_y + h + shadow_offset + RULER_DISTANCE + RULER_RADIUS);
|
cairo_line_to (cr, pos_x + w + 0.5, pos_y + h + shadow_offset + RULER_DISTANCE + RULER_RADIUS);
|
||||||
cairo_stroke (cr);
|
cairo_stroke (cr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gtk_style_context_restore (context);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -3412,16 +3412,21 @@ levelbar {
|
|||||||
* Print dialog *
|
* Print dialog *
|
||||||
*****************/
|
*****************/
|
||||||
printdialog {
|
printdialog {
|
||||||
paper {
|
drawing {
|
||||||
color: $fg_color;
|
color: $fg_color;
|
||||||
border: 1px solid $borders_color;
|
|
||||||
background: white;
|
background: white;
|
||||||
|
border: none;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
||||||
&:backdrop {
|
&:backdrop {
|
||||||
color: $backdrop_fg_color;
|
color: $backdrop_fg_color;
|
||||||
border-color: $backdrop_borders_color;
|
border-color: $backdrop_borders_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
paper {
|
||||||
|
border: 1px solid $borders_color;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialog-action-box { margin: 12px; }
|
.dialog-action-box { margin: 12px; }
|
||||||
|
Loading…
Reference in New Issue
Block a user