diff options
author | Zaggy1024 <zaggy1024@gmail.com> | 2022-10-30 04:32:51 -0500 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-10-30 23:54:12 +0100 |
commit | e20756f9f735187f481420947329dfdb9a3418ac (patch) | |
tree | 219fc9a3833914c6616da5b560d34a3a69358894 /Userland/Libraries/LibGUI/Toolbar.cpp | |
parent | 1de1d6423b7e9c6edf705371c7f214172a8121eb (diff) | |
download | serenity-e20756f9f735187f481420947329dfdb9a3418ac.zip |
LibGUI: Update buttons' text/tooltips in Action::set_text
This allows Actions that change based on some state to update their
associated buttons' text and tooltips to match their new text. The
play/pause button in SoundPlayer (and VideoPlayer if it's merged)
will now change tooltips when the playback changes state, rather than
always displaying "Play (Space)".
Diffstat (limited to 'Userland/Libraries/LibGUI/Toolbar.cpp')
-rw-r--r-- | Userland/Libraries/LibGUI/Toolbar.cpp | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/Userland/Libraries/LibGUI/Toolbar.cpp b/Userland/Libraries/LibGUI/Toolbar.cpp index 62b16ee581..d65a58fa94 100644 --- a/Userland/Libraries/LibGUI/Toolbar.cpp +++ b/Userland/Libraries/LibGUI/Toolbar.cpp @@ -51,7 +51,6 @@ private: if (action.group() && action.group()->is_exclusive()) set_exclusive(true); set_action(action); - set_tooltip(tooltip(action)); set_focus_policy(FocusPolicy::NoFocus); if (action.icon()) set_icon(action.icon()); @@ -59,17 +58,6 @@ private: set_text(action.text()); set_button_style(Gfx::ButtonStyle::Coolbar); } - String tooltip(Action const& action) const - { - StringBuilder builder; - builder.append(action.text()); - if (action.shortcut().is_valid()) { - builder.append(" ("sv); - builder.append(action.shortcut().to_string()); - builder.append(')'); - } - return builder.to_string(); - } virtual void enter_event(Core::Event& event) override { |