FileManager: Disable "View as..." actions for desktop DirectoryView

This stops these actions from being activated with Ctrl+[1,2,3] or the
command palette.. Switching to table or columns view would just hide
all the icons, so let's not make those options available.
This commit is contained in:
Sam Atkins 2022-02-03 14:40:14 +00:00 committed by Andreas Kling
commit a4cb6a49ae
Notes: sideshowbarker 2024-07-17 19:50:11 +09:00

View file

@ -612,6 +612,12 @@ void DirectoryView::setup_actions()
Config::write_string("FileManager", "DirectoryView", "ViewMode", "Columns");
},
window());
if (m_mode == Mode::Desktop) {
m_view_as_icons_action->set_enabled(false);
m_view_as_table_action->set_enabled(false);
m_view_as_columns_action->set_enabled(false);
}
}
void DirectoryView::handle_drop(GUI::ModelIndex const& index, GUI::DropEvent const& event)