diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-10-26 11:37:52 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-10-26 11:37:52 +0200 |
commit | 1d2fc77cfcd3d40c3a382d3f5f8e6c28e8b38da9 (patch) | |
tree | ccca52a56efa7421e44c96594f42bc08c06c2497 /src/gui/DropdownButton.cpp | |
parent | 57977f29e10c8c2a8ba58c25e9ab653aed7cc0a9 (diff) |
Make the ui the daemon instead, add hotkey for recording/pause
Diffstat (limited to 'src/gui/DropdownButton.cpp')
-rw-r--r-- | src/gui/DropdownButton.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/DropdownButton.cpp b/src/gui/DropdownButton.cpp index b9b962f..28c1b5b 100644 --- a/src/gui/DropdownButton.cpp +++ b/src/gui/DropdownButton.cpp @@ -15,9 +15,8 @@ namespace gsr { static const float icon_spacing_scale = 0.008f; static const float border_scale = 0.003f; - DropdownButton::DropdownButton(mgl::Font *title_font, mgl::Font *description_font, const char *title, const char *description_activated, const char *description_deactivated, mgl::Texture *icon_texture, mgl::vec2f size) : - title_font(title_font), description_font(description_font), size(size), title(title, *title_font), description(description_deactivated, *description_font), - description_activated(description_activated), description_deactivated(description_deactivated) + DropdownButton::DropdownButton(mgl::Font *title_font, mgl::Font *description_font, const char *title, const char *description, mgl::Texture *icon_texture, mgl::vec2f size) : + title_font(title_font), description_font(description_font), size(size), title(title, *title_font), description(description, *description_font) { if(icon_texture && icon_texture->is_valid()) { icon_sprite.set_texture(icon_texture); @@ -202,6 +201,10 @@ namespace gsr { } } + void DropdownButton::set_description(std::string description_text) { + description.set_string(std::move(description_text)); + } + void DropdownButton::set_activated(bool activated) { if(this->activated == activated) return; @@ -209,11 +212,9 @@ namespace gsr { this->activated = activated; if(activated) { - description = mgl::Text(description_activated, *description_font); description.set_color(get_theme().tint_color); icon_sprite.set_color(get_theme().tint_color); } else { - description = mgl::Text(description_deactivated, *description_font); description.set_color(mgl::Color(150, 150, 150)); icon_sprite.set_color(mgl::Color(255, 255, 255)); } |