cgv
Loading...
Searching...
No Matches
themed_canvas_overlay.h
1#pragma once
2
3#include <cgv/gui/theme_info.h>
4#include <cgv_overlay/canvas_overlay.h>
5
6#include "lib_begin.h"
7
8namespace cgv {
9namespace overlay {
10
12private:
13 int padding_ = 8;
14
15 cgv::g2d::shape2d_style container_style_;
16
17protected:
20
21 void begin_content(cgv::render::context& ctx, bool clear_frame_buffer = true);
22
23 virtual void init_styles() override {}
24
25 void init_container_style(const cgv::gui::theme_info& theme);
26
28 cgv::g2d::irect get_content_rectangle() const;
29
30 int padding() const { return padding_; }
31
32public:
34 themed_canvas_overlay();
35
36 bool init(cgv::render::context& ctx) override;
37
38 virtual void handle_theme_change(const cgv::gui::theme_info& theme) override;
39
40 bool get_background_visible() const { return background_visible_; }
41 void set_background_visible(bool flag);
42};
43
44typedef cgv::data::ref_ptr<canvas_overlay> canvas_overlay_ptr;
45
46} // namespace overlay
47} // namespace cgv
48
49#include <cgv/config/lib_end.h>
canvas_overlay()
creates an overlay in the bottom left corner with zero size using a canvas for 2d drawing
bool background_visible_
whether the background is visible (true by default)
themed_canvas_overlay()
creates an overlay in the bottom left corner with zero size using a canvas for 2d drawing
base class for all drawables, which is independent of the used rendering API.
Definition context.h:670
this header is dependency free
Definition print.h:11