diff options
Diffstat (limited to 'Applications/FileManager/DirectoryTableView.h')
-rw-r--r-- | Applications/FileManager/DirectoryTableView.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/Applications/FileManager/DirectoryTableView.h b/Applications/FileManager/DirectoryTableView.h index 5725ff7d58..67b6ee5b17 100644 --- a/Applications/FileManager/DirectoryTableView.h +++ b/Applications/FileManager/DirectoryTableView.h @@ -1,13 +1,15 @@ #pragma once #include <LibGUI/GTableView.h> +#include <LibGUI/GItemView.h> +#include <LibGUI/GStackWidget.h> #include <sys/stat.h> #include "DirectoryModel.h" -class DirectoryTableView final : public GTableView { +class DirectoryView final : public GStackWidget { public: - explicit DirectoryTableView(GWidget* parent); - virtual ~DirectoryTableView() override; + explicit DirectoryView(GWidget* parent); + virtual ~DirectoryView() override; void open(const String& path); String path() const { return model().path(); } @@ -18,13 +20,20 @@ public: Function<void(const String&)> on_path_change; Function<void(String)> on_status_message; -private: - virtual void model_notification(const GModelNotification&) override; + enum ViewMode { Invalid, List, Icon }; + void set_view_mode(ViewMode); + ViewMode view_mode() const { return m_view_mode; } +private: DirectoryModel& model() { return *m_model; } const DirectoryModel& model() const { return *m_model; } void set_status_message(const String&); + ViewMode m_view_mode { Invalid }; + Retained<DirectoryModel> m_model; + + GTableView* m_table_view { nullptr }; + GItemView* m_item_view { nullptr }; }; |