Переглянути джерело

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.
Sam Atkins 3 роки тому
батько
коміт
a4cb6a49ae
1 змінених файлів з 6 додано та 0 видалено
  1. 6 0
      Userland/Applications/FileManager/DirectoryView.cpp

+ 6 - 0
Userland/Applications/FileManager/DirectoryView.cpp

@@ -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)