1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

LibGUI: Refactor AbstractView "multi select" mode into "selection mode"

There are three possible selection modes for a GUI::AbstractView.

- NoSelection
- SingleSelection
- MultiSelection

We don't enforce these modes fully yet, this patch mostly adds them in
place of the old "multi select" flag.
This commit is contained in:
Andreas Kling 2020-12-28 20:14:17 +01:00
parent 207ecf454a
commit f7116bba43
8 changed files with 31 additions and 25 deletions

View file

@ -97,14 +97,13 @@ public:
Action& view_as_icons_action() { return *m_view_as_icons_action; }
Action& view_as_columns_action() { return *m_view_as_columns_action; }
bool is_multi_select() const { return m_multi_select; }
void set_multi_select(bool);
AbstractView::SelectionMode selection_mode() const;
void set_selection_mode(AbstractView::SelectionMode);
private:
MultiView();
void build_actions();
void apply_multi_select();
ViewMode m_view_mode { Invalid };
int m_model_column { 0 };
@ -120,8 +119,6 @@ private:
RefPtr<Action> m_view_as_columns_action;
OwnPtr<ActionGroup> m_view_type_action_group;
bool m_multi_select { true };
};
}