diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-10-27 13:56:03 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-10-27 13:59:17 +0100 |
commit | 80ff6582a95854712221bf4c84252584566ac041 (patch) | |
tree | 50a4c72cf29b7c30b4bbc7c6b8c73523cd8e4a00 /include | |
parent | 59dfd87c21026ef4dc713c3e0648cfa89d534557 (diff) |
Fix window not visible in fullscreen applications
Diffstat (limited to 'include')
-rw-r--r-- | include/Overlay.hpp | 10 | ||||
-rw-r--r-- | include/Theme.hpp | 17 |
2 files changed, 17 insertions, 10 deletions
diff --git a/include/Overlay.hpp b/include/Overlay.hpp index d5a8fb6..c580a12 100644 --- a/include/Overlay.hpp +++ b/include/Overlay.hpp @@ -32,13 +32,14 @@ namespace gsr { class Overlay { public: - Overlay(mgl::Window &window, std::string resources_path, GsrInfo gsr_info, egl_functions egl_funcs, mgl::Color bg_color); + Overlay(std::string resources_path, GsrInfo gsr_info, egl_functions egl_funcs, mgl::Color bg_color); Overlay(const Overlay&) = delete; Overlay& operator=(const Overlay&) = delete; ~Overlay(); - void on_event(mgl::Event &event, mgl::Window &window); - void draw(mgl::Window &window); + void handle_events(); + void on_event(mgl::Event &event); + void draw(); void show(); void hide(); @@ -80,7 +81,8 @@ namespace gsr { KeyBindingCallback callback; }; - mgl::Window &window; + std::unique_ptr<mgl::Window> window; + mgl::Event event; std::string resources_path; GsrInfo gsr_info; egl_functions egl_funcs; diff --git a/include/Theme.hpp b/include/Theme.hpp index f7e0ce4..23bcbb7 100644 --- a/include/Theme.hpp +++ b/include/Theme.hpp @@ -18,10 +18,6 @@ namespace gsr { float window_width = 0.0f; float window_height = 0.0f; - mgl::Color tint_color = mgl::Color(118, 185, 0); - mgl::Color page_bg_color = mgl::Color(38, 43, 47); - mgl::Color text_color = mgl::Color(255, 255, 255); - mgl::MemoryMappedFile body_font_file; mgl::MemoryMappedFile title_font_file; mgl::Font body_font; @@ -50,8 +46,17 @@ namespace gsr { bool set_window_size(mgl::vec2i window_size); }; - bool init_theme(const GsrInfo &gsr_info, const std::string &resources_path); + bool init_theme(const std::string &resources_path); void deinit_theme(); - Theme& get_theme(); + + struct ColorTheme { + mgl::Color tint_color = mgl::Color(118, 185, 0); + mgl::Color page_bg_color = mgl::Color(38, 43, 47); + mgl::Color text_color = mgl::Color(255, 255, 255); + }; + + bool init_color_theme(const GsrInfo &gsr_info); + void deinit_color_theme(); + ColorTheme& get_color_theme(); }
\ No newline at end of file |