FileManager: Exit the properties window on escape

This commit is contained in:
Lucas CHOLLET 2023-07-09 12:12:18 -04:00 committed by Andreas Kling
parent 3e6e75bb5e
commit c5a6f0fb4d
2 changed files with 6 additions and 0 deletions

View file

@ -181,6 +181,11 @@ ErrorOr<void> 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 {};
}

View file

@ -90,6 +90,7 @@ private:
RefPtr<GUI::ImageWidget> m_icon;
RefPtr<GUI::Label> m_size_label;
RefPtr<DirectoryStatisticsCalculator> m_directory_statistics_calculator;
RefPtr<GUI::Action> m_on_escape;
DeprecatedString m_name;
DeprecatedString m_parent_path;
DeprecatedString m_path;