mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
Filemanager: Add Ctrl+A select all action
Unfortunately this means that current_view() needed to be made non-const as changing the selection is a non-const operation.
This commit is contained in:
parent
7cf15bcb75
commit
6192467de9
Notes:
sideshowbarker
2024-07-19 10:17:42 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/6192467de93 Pull-request: https://github.com/SerenityOS/serenity/pull/1033
2 changed files with 5 additions and 1 deletions
|
@ -36,7 +36,7 @@ public:
|
|||
void set_view_mode(ViewMode);
|
||||
ViewMode view_mode() const { return m_view_mode; }
|
||||
|
||||
const GAbstractView& current_view() const
|
||||
GAbstractView& current_view()
|
||||
{
|
||||
switch (m_view_mode) {
|
||||
case ViewMode::List:
|
||||
|
|
|
@ -191,6 +191,10 @@ int main(int argc, char** argv)
|
|||
return paths;
|
||||
};
|
||||
|
||||
auto select_all_action = GAction::create("Select all", { Mod_Ctrl, KeyCode::Key_A }, [&](const GAction&) {
|
||||
directory_view->current_view.select_all();
|
||||
});
|
||||
|
||||
auto copy_action = GCommonActions::make_copy_action([&](const GAction& action) {
|
||||
Vector<String> paths;
|
||||
if (action.activator() == directory_context_menu || directory_view->active_widget()->is_focused()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue