summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/Button.cpp
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-11-19 09:08:09 -0500
committerAndreas Kling <kling@serenityos.org>2022-11-26 09:02:25 +0100
commit62cbfc68b9cdfee62a817b69912bc6f191b942ef (patch)
treeaecab0f2e1ffa688497c5bf0775728dfeb6fd8c0 /Userland/Libraries/LibGUI/Button.cpp
parentd04613d25231ce92ca6783c5b6cd1320ab324bee (diff)
downloadserenity-62cbfc68b9cdfee62a817b69912bc6f191b942ef.zip
Revert "LibGUI: Update buttons' text/tooltips in Action::set_text"
This reverts commit e20756f9f735187f481420947329dfdb9a3418ac. Some buttons, e.g. GUI::ToolbarButton, set text to be used only as a tooltip instead of text on the button itself. This commit forced those buttons to have text on them when their action became set. For most toolbars, this was an invisible side effect; the button icons covered the whole button rect. But the toolbar for EmojiInputDialog has slightly smaller icons, causing an ellipsis to be displayed next to the icon.
Diffstat (limited to 'Userland/Libraries/LibGUI/Button.cpp')
-rw-r--r--Userland/Libraries/LibGUI/Button.cpp19
1 files changed, 0 insertions, 19 deletions
diff --git a/Userland/Libraries/LibGUI/Button.cpp b/Userland/Libraries/LibGUI/Button.cpp
index 7559f15235..20a242569f 100644
--- a/Userland/Libraries/LibGUI/Button.cpp
+++ b/Userland/Libraries/LibGUI/Button.cpp
@@ -169,25 +169,6 @@ void Button::set_action(Action& action)
set_checkable(action.is_checkable());
if (action.is_checkable())
set_checked(action.is_checked());
- set_text_from_action();
-}
-
-static String create_tooltip_for_action(Action const& action)
-{
- 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();
-}
-
-void Button::set_text_from_action()
-{
- set_text(action()->text());
- set_tooltip(create_tooltip_for_action(*action()));
}
void Button::set_icon(RefPtr<Gfx::Bitmap> icon)