diff options
author | Andreas Kling <kling@serenityos.org> | 2021-04-18 16:43:45 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-18 16:44:00 +0200 |
commit | e98091ad159298dbaf6c8edb0372f6a4c12e8512 (patch) | |
tree | e56edf5fcfde8c7353d953cd7a67153659fc6e62 /Userland/Applications | |
parent | 8cada904cce3dd2d79a06f4046959df27905a354 (diff) | |
download | serenity-e98091ad159298dbaf6c8edb0372f6a4c12e8512.zip |
FileManager: Show action status tips in the status bar :^)
Diffstat (limited to 'Userland/Applications')
-rw-r--r-- | Userland/Applications/FileManager/main.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Userland/Applications/FileManager/main.cpp b/Userland/Applications/FileManager/main.cpp index 1407dde810..39485d3d9b 100644 --- a/Userland/Applications/FileManager/main.cpp +++ b/Userland/Applications/FileManager/main.cpp @@ -448,6 +448,17 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio auto& statusbar = *widget.find_descendant_of_type_named<GUI::Statusbar>("statusbar"); + GUI::Application::the()->on_action_enter = [&statusbar](GUI::Action& action) { + auto text = action.status_tip(); + if (text.is_empty()) + text = Gfx::parse_ampersand_string(action.text()); + statusbar.set_override_text(move(text)); + }; + + GUI::Application::the()->on_action_leave = [&statusbar](GUI::Action&) { + statusbar.set_override_text({}); + }; + auto& progressbar = *widget.find_descendant_of_type_named<GUI::Progressbar>("progressbar"); progressbar.set_format(GUI::Progressbar::Format::ValueSlashMax); progressbar.set_frame_shape(Gfx::FrameShape::Panel); |