summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-01-09 21:57:41 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-01-09 21:57:41 +0200
commit53f670096cb2865e16b626be7b2baa769c089715 (patch)
tree0573d8d2e56f3dec36b3f372027cdc2da86410c7 /include
parentAdd make install and make uninstall rules to cmake (#196) (diff)
downloadnheko-53f670096cb2865e16b626be7b2baa769c089715.tar.xz
Make group's sidebar visible through an option
Diffstat (limited to 'include')
-rw-r--r--include/ChatPage.h2
-rw-r--r--include/UserSettingsPage.h19
2 files changed, 20 insertions, 1 deletions
diff --git a/include/ChatPage.h b/include/ChatPage.h

index 754ee0f4..01fb4c50 100644 --- a/include/ChatPage.h +++ b/include/ChatPage.h
@@ -119,6 +119,8 @@ private: void loadStateFromCache(); void deleteConfigs(); void resetUI(); + //! Decides whether or not to hide the group's sidebar. + void setGroupViewState(bool isEnabled); template<class Collection> Memberships getMemberships(const std::vector<Collection> &events) const; diff --git a/include/UserSettingsPage.h b/include/UserSettingsPage.h
index adaa3956..6c825a83 100644 --- a/include/UserSettingsPage.h +++ b/include/UserSettingsPage.h
@@ -29,8 +29,10 @@ constexpr int OptionMargin = 6; constexpr int LayoutTopMargin = 50; constexpr int LayoutBottomMargin = LayoutTopMargin; -class UserSettings +class UserSettings : public QObject { + Q_OBJECT + public: UserSettings(); @@ -50,14 +52,28 @@ public: save(); }; + void setGroupView(bool state) + { + if (isGroupViewEnabled_ != state) + emit groupViewStateChanged(state); + + isGroupViewEnabled_ = state; + save(); + }; + QString theme() const { return !theme_.isEmpty() ? theme_ : "light"; } bool isTrayEnabled() const { return isTrayEnabled_; } bool isOrderingEnabled() const { return isOrderingEnabled_; } + bool isGroupViewEnabled() const { return isGroupViewEnabled_; } + +signals: + void groupViewStateChanged(bool state); private: QString theme_; bool isTrayEnabled_; bool isOrderingEnabled_; + bool isGroupViewEnabled_; }; class HorizontalLine : public QFrame @@ -97,6 +113,7 @@ private: Toggle *trayToggle_; Toggle *roomOrderToggle_; + Toggle *groupViewToggle_; QComboBox *themeCombo_;