From dc70bd27f217413bbda33b4092a3a52a6f1905d5 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 18 Mar 2025 19:13:16 +0100 Subject: Add controller button icons in hotkeys, separate keyboard hotkeys and controller hotkeys --- README.md | 5 ++++- images/ps4_dpad_down.png | Bin 0 -> 1496 bytes images/ps4_dpad_left.png | Bin 0 -> 1487 bytes images/ps4_dpad_right.png | Bin 0 -> 1497 bytes images/ps4_dpad_up.png | Bin 0 -> 1482 bytes images/ps4_home.png | Bin 0 -> 1811 bytes include/Theme.hpp | 6 ++++++ include/Utils.hpp | 1 - include/gui/GlobalSettingsPage.hpp | 3 ++- include/gui/Image.hpp | 29 +++++++++++++++++++++++++++ include/gui/Utils.hpp | 4 +--- meson.build | 1 + src/Theme.cpp | 15 ++++++++++++++ src/gui/GlobalSettingsPage.cpp | 39 ++++++++++++++++++++++++++++--------- src/gui/Image.cpp | 39 +++++++++++++++++++++++++++++++++++++ src/gui/Utils.cpp | 7 +++++++ 16 files changed, 134 insertions(+), 15 deletions(-) create mode 100644 images/ps4_dpad_down.png create mode 100644 images/ps4_dpad_left.png create mode 100644 images/ps4_dpad_right.png create mode 100644 images/ps4_dpad_up.png create mode 100644 images/ps4_home.png create mode 100644 include/gui/Image.hpp create mode 100644 src/gui/Image.cpp diff --git a/README.md b/README.md index 6bd8422..924e796 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,10 @@ This program has to grab all keyboards and create a virtual keyboard (`gsr-ui vi This might cause issues for you if you use input remapping software. To workaround this you can go into settings and select "Only grab virtual devices" # License -This software is licensed under GPL3.0-only. Files under `fonts/` directory belong to the Noto Sans Google fonts project and they are licensed under `SIL Open Font License`. `images/default.cur` it part of the [Adwaita icon theme](https://gitlab.gnome.org/GNOME/adwaita-icon-theme/-/tree/master) which is licensed under `Creative Commons Attribution-Share Alike 3.0`. +This software is licensed under GPL3.0-only. Files under `fonts/` directory belong to the Noto Sans Google fonts project and they are licensed under `SIL Open Font License`.\ +`images/default.cur` it part of the [Adwaita icon theme](https://gitlab.gnome.org/GNOME/adwaita-icon-theme/-/tree/master) which is licensed under `CC BY-SA 3.0`.\ +The D-Pad images under `images/` were created by [Julio Cacko](https://juliocacko.itch.io/free-input-prompts) and they are licensed under `CC0 1.0 Universal`.\ +The PlayStation logo under `images/` was created by [ArksDigital](https://arks.itch.io/ps4-buttons) and it's are licensed under `CC BY 4.0`. # Reporting bugs, contributing patches, questions or donation See [https://git.dec05eba.com/?p=about](https://git.dec05eba.com/?p=about). diff --git a/images/ps4_dpad_down.png b/images/ps4_dpad_down.png new file mode 100644 index 0000000..727fdd3 Binary files /dev/null and b/images/ps4_dpad_down.png differ diff --git a/images/ps4_dpad_left.png b/images/ps4_dpad_left.png new file mode 100644 index 0000000..e114ed7 Binary files /dev/null and b/images/ps4_dpad_left.png differ diff --git a/images/ps4_dpad_right.png b/images/ps4_dpad_right.png new file mode 100644 index 0000000..6ebd88e Binary files /dev/null and b/images/ps4_dpad_right.png differ diff --git a/images/ps4_dpad_up.png b/images/ps4_dpad_up.png new file mode 100644 index 0000000..e287b3d Binary files /dev/null and b/images/ps4_dpad_up.png differ diff --git a/images/ps4_home.png b/images/ps4_home.png new file mode 100644 index 0000000..d17adc0 Binary files /dev/null and b/images/ps4_home.png differ 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 #include #include -#include 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 create_stream_hotkey_options(); std::unique_ptr create_screenshot_hotkey_options(); std::unique_ptr create_hotkey_control_buttons(); - std::unique_ptr create_hotkey_subsection(ScrollablePage *parent_page); + std::unique_ptr create_keyboard_hotkey_subsection(ScrollablePage *parent_page); + std::unique_ptr create_controller_hotkey_subsection(ScrollablePage *parent_page); std::unique_ptr