diff --git a/Userland/Applications/FileManager/PropertiesWindow.cpp b/Userland/Applications/FileManager/PropertiesWindow.cpp index 693769cb775..a3e4429d680 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 9206fd16d86..fa49da45e8f 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;