diff --git a/Userland/Applications/FileManager/PropertiesWindow.cpp b/Userland/Applications/FileManager/PropertiesWindow.cpp index 693769cb775739c16d00c16d14804552c6943db7..a3e4429d6808efcd9a0c4d278d0cc6ad1abf5f31 100644 --- a/Userland/Applications/FileManager/PropertiesWindow.cpp +++ b/Userland/Applications/FileManager/PropertiesWindow.cpp @@ -181,6 +181,11 @@ ErrorOr PropertiesWindow::create_widgets(bool disable_rename) m_directory_statistics_calculator->start(); } + m_on_escape = GUI::Action::create("Close properties", { Key_Escape }, [this](GUI::Action&) { + if (!m_apply_button->is_enabled()) + close(); + }); + update(); return {}; } diff --git a/Userland/Applications/FileManager/PropertiesWindow.h b/Userland/Applications/FileManager/PropertiesWindow.h index 9206fd16d86cad7a3b14f7a34c15bb9136231265..fa49da45e8f48af22a0a456d3cad0ec73e9ff301 100644 --- a/Userland/Applications/FileManager/PropertiesWindow.h +++ b/Userland/Applications/FileManager/PropertiesWindow.h @@ -90,6 +90,7 @@ private: RefPtr m_icon; RefPtr m_size_label; RefPtr m_directory_statistics_calculator; + RefPtr m_on_escape; DeprecatedString m_name; DeprecatedString m_parent_path; DeprecatedString m_path;