From cca66b9ec4e494c1d919bff0f71a820d8afab1fa Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:24:48 +0200 Subject: Adding upstream version 1.2.2. Signed-off-by: Daniel Baumann --- src/ui/widget/page-size-preview.h | 50 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/ui/widget/page-size-preview.h (limited to 'src/ui/widget/page-size-preview.h') diff --git a/src/ui/widget/page-size-preview.h b/src/ui/widget/page-size-preview.h new file mode 100644 index 0000000..093e79b --- /dev/null +++ b/src/ui/widget/page-size-preview.h @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Author: + * Michael Kowalski + * + * Copyright (C) 2021 Authors + * + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + +#ifndef INKSCAPE_UI_WIDGET_PAGE_SIZE_PREVIEW_H +#define INKSCAPE_UI_WIDGET_PAGE_SIZE_PREVIEW_H + +#include + +namespace Inkscape { +namespace UI { +namespace Widget { + +class PageSizePreview : public Gtk::DrawingArea { +public: + PageSizePreview(); + // static PageSizePreview* create(); + + void set_desk_color(unsigned int rgba); + void set_page_color(unsigned int rgba); + void set_border_color(unsigned int rgba); + void draw_border(bool border); + void enable_drop_shadow(bool shadow); + void set_page_size(double width, double height); + void enable_checkerboard(bool checkerboard); + + ~PageSizePreview() override = default; + +private: + bool on_draw(const Cairo::RefPtr& ctx) override; + unsigned int _border_color = 0x0000001f; + unsigned int _page_color = 0xffffff00; + unsigned int _desk_color = 0xc8c8c8ff; + bool _draw_border = true; + bool _draw_shadow = true; + bool _draw_checkerboard = false; + double _width = 10; + double _height = 7; +}; + +} } } // namespace Inkscape/Widget/UI + +#endif // INKSCAPE_UI_WIDGET_PAGE_SIZE_PREVIEW_H + -- cgit v1.2.3