115 guint32 select_color = 0x000000cc;
123 border_on_top =
false;
125 border_color = select_color;
130 if (rect->get_name() ==
"margin") {
131 rect->set_stroke(margin_color);
133 rect->set_visible(vis);
139 if (rect->get_name() ==
"bleed") {
140 rect->set_stroke(bleed_color);
141 bool vis = bleed && *bleed !=
size;
142 rect->set_visible(vis);
144 rect->set_rect(*bleed);
149 rect->set_rect(
size);
151 bool is_foreground = (rect->get_name() ==
"foreground");
153 if (is_foreground == border_on_top) {
154 rect->set_visible(
true);
155 rect->set_stroke(
is_selected ? select_color : border_color);
157 rect->set_visible(
false);
158 rect->set_stroke(0x0);
161 if (!is_foreground) {
162 rect->set_visible(
true);
177 rect->set_shadow(0x0, 0);
192 uint32_t foreground = 0xffffffff;
193 uint32_t background = 0x00000099;
194 uint32_t selected = 0x0e5bf199;
201 foreground = 0x000000ff;
202 background = 0xffffff99;
203 selected = 0x50afe7ff;
213 std::string bullet =
is_selected ?
" \u2022 " :
" ";
214 txt = bullet + txt + bullet;
218 label->set_fontsize(fontsize);
219 label->set_fill(foreground);
221 label->set_bg_radius(radius);
222 label->set_anchor(anchor);
223 label->set_coord(coord);
224 label->set_visible(!txt.empty());
225 label->set_text(std::move(txt));
226 label->set_border(4.0);
std::vector< CanvasItemPtr< CanvasItem > > canvas_items
void update(Geom::Rect size, Geom::OptRect margin, Geom::OptRect bleed, const char *txt, bool outline, bool is_yaxisdown)
Update the visual representation of a page on screen.
void _updateTextItem(CanvasItemText *label, Geom::Rect page, std::string txt, bool is_yaxisdown)
Update the page's textual label.
void add(Geom::Rect size, CanvasItemGroup *background_group, CanvasItemGroup *foreground_group)
Add the page canvas to the given canvas item groups (canvas view is implicit)
void set_guides_visible(bool show)
bool setPageColor(Color const &border, Color const &bg, Color const &canvas, Color const &margin, Color const &bleed)
void remove(UI::Widget::Canvas *canvas)
Hide the page in the given canvas widget.
bool setLabelStyle(const std::string &style)
bool setShadow(int shadow)
bool setOnTop(bool on_top)
Geom::PathVector outline(Geom::Path const &input, double width, double miter, LineJoinType join, LineCapType butt, double tolerance)
Strokes the path given by input.