summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2020-05-01 02:25:50 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-02 14:12:36 +0200
commit1b140d1b5bd254f8b72691aabd7b0eb5f74dc3a8 (patch)
tree08e5270e135ca471bc987caceb98a81c9f6edc93 /Libraries
parentef433cb367d1b94002f799a5a7b9019ac04b1ee7 (diff)
downloadserenity-1b140d1b5bd254f8b72691aabd7b0eb5f74dc3a8.zip
LibGUI: FilePicker: Make icon view button initially checked
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/MultiView.cpp5
-rw-r--r--Libraries/LibGUI/MultiView.h3
2 files changed, 6 insertions, 2 deletions
diff --git a/Libraries/LibGUI/MultiView.cpp b/Libraries/LibGUI/MultiView.cpp
index ff96cb9c44..114d391543 100644
--- a/Libraries/LibGUI/MultiView.cpp
+++ b/Libraries/LibGUI/MultiView.cpp
@@ -106,9 +106,9 @@ MultiView::MultiView()
on_drop(index, event);
};
#endif
- set_view_mode(ViewMode::Icon);
build_actions();
+ set_view_mode(ViewMode::Icon);
}
MultiView::~MultiView()
@@ -123,16 +123,19 @@ void MultiView::set_view_mode(ViewMode mode)
update();
if (mode == ViewMode::Table) {
set_active_widget(m_table_view);
+ m_view_as_table_action->set_checked(true);
return;
}
#ifdef MULTIVIEW_WITH_COLUMNSVIEW
if (mode == ViewMode::Columns) {
set_active_widget(m_columns_view);
+ m_view_as_columns_action->set_checked(true);
return;
}
#endif
if (mode == ViewMode::Icon) {
set_active_widget(m_icon_view);
+ m_view_as_icons_action->set_checked(true);
return;
}
ASSERT_NOT_REACHED();
diff --git a/Libraries/LibGUI/MultiView.h b/Libraries/LibGUI/MultiView.h
index 33e1a3409b..53d8d0a382 100644
--- a/Libraries/LibGUI/MultiView.h
+++ b/Libraries/LibGUI/MultiView.h
@@ -50,6 +50,7 @@ public:
Function<void(const ModelIndex&, const DropEvent&)> on_drop;
enum ViewMode {
+ Invalid,
Table,
Columns,
Icon
@@ -107,7 +108,7 @@ private:
void build_actions();
- ViewMode m_view_mode { Icon };
+ ViewMode m_view_mode { Invalid };
int m_model_column { 0 };
RefPtr<Model> m_model;