diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/Theme.hpp | 6 | ||||
-rw-r--r-- | include/Utils.hpp | 1 | ||||
-rw-r--r-- | include/gui/GlobalSettingsPage.hpp | 3 | ||||
-rw-r--r-- | include/gui/Image.hpp | 29 | ||||
-rw-r--r-- | include/gui/Utils.hpp | 4 |
5 files changed, 38 insertions, 5 deletions
diff --git a/include/Theme.hpp b/include/Theme.hpp index 90dd8cf..bda8dd4 100644 --- a/include/Theme.hpp +++ b/include/Theme.hpp @@ -43,6 +43,12 @@ namespace gsr { mgl::Texture save_texture; mgl::Texture screenshot_texture; + mgl::Texture ps4_home_texture; + mgl::Texture ps4_dpad_up_texture; + mgl::Texture ps4_dpad_down_texture; + mgl::Texture ps4_dpad_left_texture; + mgl::Texture ps4_dpad_right_texture; + double double_click_timeout_seconds = 0.4; // Reloads fonts diff --git a/include/Utils.hpp b/include/Utils.hpp index f7d8538..19700df 100644 --- a/include/Utils.hpp +++ b/include/Utils.hpp @@ -4,7 +4,6 @@ #include <string_view> #include <map> #include <string> -#include <optional> namespace gsr { struct KeyValue { diff --git a/include/gui/GlobalSettingsPage.hpp b/include/gui/GlobalSettingsPage.hpp index d0a0336..c261ab6 100644 --- a/include/gui/GlobalSettingsPage.hpp +++ b/include/gui/GlobalSettingsPage.hpp @@ -59,7 +59,8 @@ namespace gsr { std::unique_ptr<List> create_stream_hotkey_options(); std::unique_ptr<List> create_screenshot_hotkey_options(); std::unique_ptr<List> create_hotkey_control_buttons(); - std::unique_ptr<Subsection> create_hotkey_subsection(ScrollablePage *parent_page); + std::unique_ptr<Subsection> create_keyboard_hotkey_subsection(ScrollablePage *parent_page); + std::unique_ptr<Subsection> create_controller_hotkey_subsection(ScrollablePage *parent_page); std::unique_ptr<Button> create_exit_program_button(); std::unique_ptr<Button> create_go_back_to_old_ui_button(); std::unique_ptr<Subsection> create_application_options_subsection(ScrollablePage *parent_page); diff --git a/include/gui/Image.hpp b/include/gui/Image.hpp new file mode 100644 index 0000000..d72c5c1 --- /dev/null +++ b/include/gui/Image.hpp @@ -0,0 +1,29 @@ +#pragma once + +#include "Widget.hpp" + +#include <mglpp/graphics/Sprite.hpp> + +namespace gsr { + class Image : public Widget { + public: + enum class ScaleBehavior { + SCALE, + CLAMP + }; + + // Set size to {0.0f, 0.0f} for no limit. The image is scaled to the size while keeping its aspect ratio + Image(mgl::Texture *texture, mgl::vec2f size, ScaleBehavior scale_behavior); + Image(const Image&) = delete; + Image& operator=(const Image&) = delete; + + bool on_event(mgl::Event &event, mgl::Window &window, mgl::vec2f offset) override; + void draw(mgl::Window &window, mgl::vec2f offset) override; + + mgl::vec2f get_size() override; + private: + mgl::Sprite sprite; + mgl::vec2f size; + ScaleBehavior scale_behavior; + }; +}
\ No newline at end of file diff --git a/include/gui/Utils.hpp b/include/gui/Utils.hpp index 35b2bb7..542e4ea 100644 --- a/include/gui/Utils.hpp +++ b/include/gui/Utils.hpp @@ -3,9 +3,6 @@ #include <mglpp/system/vec.hpp> #include <mglpp/graphics/Color.hpp> -#include <functional> -#include <string_view> - namespace mgl { class Window; } @@ -16,4 +13,5 @@ namespace gsr { double get_frame_delta_seconds(); void set_frame_delta_seconds(double frame_delta); mgl::vec2f scale_keep_aspect_ratio(mgl::vec2f from, mgl::vec2f to); + mgl::vec2f clamp_keep_aspect_ratio(mgl::vec2f from, mgl::vec2f to); }
\ No newline at end of file |