From 6fe0cf09b4567fc532a3d619b1b573ba4e95a1a3 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 15 Apr 2025 00:15:46 +0200 Subject: Clearer delete, update mglpp --- depends/mglpp | 2 +- images/delete.png | Bin 0 -> 511 bytes images/trash.png | Bin 691 -> 0 bytes include/Theme.hpp | 2 +- src/Theme.cpp | 20 ++++++++++---------- src/gui/Button.cpp | 2 +- src/gui/ComboBox.cpp | 2 +- src/gui/SettingsPage.cpp | 10 ++++++---- 8 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 images/delete.png delete mode 100644 images/trash.png diff --git a/depends/mglpp b/depends/mglpp index 7d6e676..0c90a62 160000 --- a/depends/mglpp +++ b/depends/mglpp @@ -1 +1 @@ -Subproject commit 7d6e67668ba317d823f58f9bd8edbea2da9f4b68 +Subproject commit 0c90a62d08ef8846b2516342f7a3ded10415f3bf diff --git a/images/delete.png b/images/delete.png new file mode 100644 index 0000000..f4ac335 Binary files /dev/null and b/images/delete.png differ diff --git a/images/trash.png b/images/trash.png deleted file mode 100644 index cf1d9de..0000000 Binary files a/images/trash.png and /dev/null differ diff --git a/include/Theme.hpp b/include/Theme.hpp index 670980f..fac1dcf 100644 --- a/include/Theme.hpp +++ b/include/Theme.hpp @@ -42,7 +42,7 @@ namespace gsr { mgl::Texture pause_texture; mgl::Texture save_texture; mgl::Texture screenshot_texture; - mgl::Texture trash_texture; + mgl::Texture delete_texture; mgl::Texture ps4_home_texture; mgl::Texture ps4_options_texture; diff --git a/src/Theme.cpp b/src/Theme.cpp index c813834..143662b 100644 --- a/src/Theme.cpp +++ b/src/Theme.cpp @@ -75,7 +75,7 @@ namespace gsr { if(!theme->folder_texture.load_from_file((resources_path + "images/folder.png").c_str())) goto error; - if(!theme->up_arrow_texture.load_from_file((resources_path + "images/up_arrow.png").c_str(), mgl::Texture::LoadOptions{false, false, true})) + if(!theme->up_arrow_texture.load_from_file((resources_path + "images/up_arrow.png").c_str(), mgl::Texture::LoadOptions{false, false, MGL_TEXTURE_SCALE_LINEAR_MIPMAP})) goto error; if(!theme->replay_button_texture.load_from_file((resources_path + "images/replay.png").c_str())) @@ -93,10 +93,10 @@ namespace gsr { if(!theme->logo_texture.load_from_file((resources_path + "images/gpu_screen_recorder_logo.png").c_str())) goto error; - if(!theme->checkbox_circle_texture.load_from_file((resources_path + "images/checkbox_circle.png").c_str(), mgl::Texture::LoadOptions{false, false, true})) + if(!theme->checkbox_circle_texture.load_from_file((resources_path + "images/checkbox_circle.png").c_str(), mgl::Texture::LoadOptions{false, false, MGL_TEXTURE_SCALE_LINEAR_MIPMAP})) goto error; - if(!theme->checkbox_background_texture.load_from_file((resources_path + "images/checkbox_background.png").c_str(), mgl::Texture::LoadOptions{false, false, true})) + if(!theme->checkbox_background_texture.load_from_file((resources_path + "images/checkbox_background.png").c_str(), mgl::Texture::LoadOptions{false, false, MGL_TEXTURE_SCALE_LINEAR_MIPMAP})) goto error; if(!theme->play_texture.load_from_file((resources_path + "images/play.png").c_str())) @@ -114,25 +114,25 @@ namespace gsr { if(!theme->screenshot_texture.load_from_file((resources_path + "images/screenshot.png").c_str())) goto error; - if(!theme->trash_texture.load_from_file((resources_path + "images/trash.png").c_str(), mgl::Texture::LoadOptions{false, false, true})) + if(!theme->delete_texture.load_from_file((resources_path + "images/delete.png").c_str(), mgl::Texture::LoadOptions{false, false, MGL_TEXTURE_SCALE_LINEAR_MIPMAP})) goto error; - if(!theme->ps4_home_texture.load_from_file((resources_path + "images/ps4_home.png").c_str(), mgl::Texture::LoadOptions{false, false, true})) + if(!theme->ps4_home_texture.load_from_file((resources_path + "images/ps4_home.png").c_str(), mgl::Texture::LoadOptions{false, false, MGL_TEXTURE_SCALE_LINEAR_MIPMAP})) goto error; - if(!theme->ps4_options_texture.load_from_file((resources_path + "images/ps4_options.png").c_str(), mgl::Texture::LoadOptions{false, false, true})) + if(!theme->ps4_options_texture.load_from_file((resources_path + "images/ps4_options.png").c_str(), mgl::Texture::LoadOptions{false, false, MGL_TEXTURE_SCALE_LINEAR_MIPMAP})) goto error; - if(!theme->ps4_dpad_up_texture.load_from_file((resources_path + "images/ps4_dpad_up.png").c_str(), mgl::Texture::LoadOptions{false, false, true})) + if(!theme->ps4_dpad_up_texture.load_from_file((resources_path + "images/ps4_dpad_up.png").c_str(), mgl::Texture::LoadOptions{false, false, MGL_TEXTURE_SCALE_LINEAR_MIPMAP})) goto error; - if(!theme->ps4_dpad_down_texture.load_from_file((resources_path + "images/ps4_dpad_down.png").c_str(), mgl::Texture::LoadOptions{false, false, true})) + if(!theme->ps4_dpad_down_texture.load_from_file((resources_path + "images/ps4_dpad_down.png").c_str(), mgl::Texture::LoadOptions{false, false, MGL_TEXTURE_SCALE_LINEAR_MIPMAP})) goto error; - if(!theme->ps4_dpad_left_texture.load_from_file((resources_path + "images/ps4_dpad_left.png").c_str(), mgl::Texture::LoadOptions{false, false, true})) + if(!theme->ps4_dpad_left_texture.load_from_file((resources_path + "images/ps4_dpad_left.png").c_str(), mgl::Texture::LoadOptions{false, false, MGL_TEXTURE_SCALE_LINEAR_MIPMAP})) goto error; - if(!theme->ps4_dpad_right_texture.load_from_file((resources_path + "images/ps4_dpad_right.png").c_str(), mgl::Texture::LoadOptions{false, false, true})) + if(!theme->ps4_dpad_right_texture.load_from_file((resources_path + "images/ps4_dpad_right.png").c_str(), mgl::Texture::LoadOptions{false, false, MGL_TEXTURE_SCALE_LINEAR_MIPMAP})) goto error; return true; diff --git a/src/gui/Button.cpp b/src/gui/Button.cpp index d8cb85b..6e343c4 100644 --- a/src/gui/Button.cpp +++ b/src/gui/Button.cpp @@ -63,7 +63,7 @@ namespace gsr { window.draw(sprite); const int padding_icon_right = padding_right_icon_scale * get_button_height(); - text.set_position((sprite.get_position() + mgl::vec2f(sprite.get_size().x + padding_icon_right, sprite.get_size().y * 0.5f - text.get_bounds().size.y * 0.5f)).floor()); + text.set_position((sprite.get_position() + mgl::vec2f(sprite.get_size().x + padding_icon_right, sprite.get_size().y * 0.5f - text.get_bounds().size.y * 0.52f)).floor()); window.draw(text); } else { text.set_position((draw_pos + item_size * 0.5f - text.get_bounds().size * 0.5f).floor()); diff --git a/src/gui/ComboBox.cpp b/src/gui/ComboBox.cpp index 08c4ec2..dbe9aa0 100644 --- a/src/gui/ComboBox.cpp +++ b/src/gui/ComboBox.cpp @@ -85,7 +85,7 @@ namespace gsr { void ComboBox::add_item(const std::string &text, const std::string &id) { items.push_back({mgl::Text(text, *font), id, {0.0f, 0.0f}}); - items.back().text.set_max_width(font->get_character_size() * 25); // TODO: Make a proper solution + items.back().text.set_max_width(font->get_character_size() * 22); // TODO: Make a proper solution //items.back().text.set_max_rows(1); dirty = true; } diff --git a/src/gui/SettingsPage.cpp b/src/gui/SettingsPage.cpp index 94eeb0d..af338c8 100644 --- a/src/gui/SettingsPage.cpp +++ b/src/gui/SettingsPage.cpp @@ -227,8 +227,9 @@ namespace gsr { } std::unique_ptr