diff --git a/src/UserSettingsPage.cpp b/src/UserSettingsPage.cpp
index ec873e92..09e3282e 100644
--- a/src/UserSettingsPage.cpp
+++ b/src/UserSettingsPage.cpp
@@ -65,6 +65,8 @@ UserSettings::load(std::optional<QString> profile)
hasAlertOnNotification_ =
settings.value(QStringLiteral("user/alert_on_notification"), false).toBool();
groupView_ = settings.value(QStringLiteral("user/group_view"), true).toBool();
+ scrollbarsInRoomlist_ =
+ settings.value(QStringLiteral("user/scrollbars_in_roomlist"), false).toBool();
buttonsInTimeline_ = settings.value(QStringLiteral("user/timeline/buttons"), true).toBool();
timelineMaxWidth_ = settings.value(QStringLiteral("user/timeline/max_width"), 0).toInt();
messageHoverHighlight_ =
@@ -228,6 +230,17 @@ UserSettings::setGroupView(bool state)
}
void
+UserSettings::setScrollbarsInRoomlist(bool state)
+{
+ if (scrollbarsInRoomlist_ == state)
+ return;
+
+ scrollbarsInRoomlist_ = state;
+ emit scrollbarsInRoomlistChanged(state);
+ save();
+}
+
+void
UserSettings::setHiddenTags(const QStringList &hiddenTags)
{
hiddenTags_ = hiddenTags;
@@ -862,6 +875,7 @@ UserSettings::save()
settings.setValue(QStringLiteral("minor_events"), sortByImportance_);
settings.setValue(QStringLiteral("read_receipts"), readReceipts_);
settings.setValue(QStringLiteral("group_view"), groupView_);
+ settings.setValue(QStringLiteral("scrollbars_in_roomlist"), scrollbarsInRoomlist_);
settings.setValue(QStringLiteral("markdown_enabled"), markdown_);
settings.setValue(QStringLiteral("invert_enter_key"), invertEnterKey_);
settings.setValue(QStringLiteral("bubbles_enabled"), bubbles_);
@@ -969,6 +983,8 @@ UserSettingsModel::data(const QModelIndex &index, int role) const
return tr("Start in tray");
case GroupView:
return tr("Communities sidebar");
+ case ScrollbarsInRoomlist:
+ return tr("Scrollbars in room list");
case Markdown:
return tr("Send messages as Markdown");
case InvertEnterKey:
@@ -1111,6 +1127,8 @@ UserSettingsModel::data(const QModelIndex &index, int role) const
return i->startInTray();
case GroupView:
return i->groupView();
+ case ScrollbarsInRoomlist:
+ return i->scrollbarsInRoomlist();
case Markdown:
return i->markdown();
case InvertEnterKey:
@@ -1255,6 +1273,8 @@ UserSettingsModel::data(const QModelIndex &index, int role) const
return tr("Start the application in the background without showing the client window.");
case GroupView:
return tr("Show a column containing communities and tags next to the room list.");
+ case ScrollbarsInRoomlist:
+ return tr("Shows scrollbars in the room list and communities list.");
case Markdown:
return tr(
"Allow using markdown in messages.\nWhen disabled, all messages are sent as a plain "
@@ -1411,6 +1431,7 @@ UserSettingsModel::data(const QModelIndex &index, int role) const
case Tray:
case StartInTray:
case GroupView:
+ case ScrollbarsInRoomlist:
case Markdown:
case InvertEnterKey:
case Bubbles:
@@ -1634,6 +1655,13 @@ UserSettingsModel::setData(const QModelIndex &index, const QVariant &value, int
} else
return false;
}
+ case ScrollbarsInRoomlist: {
+ if (value.userType() == QMetaType::Bool) {
+ i->setScrollbarsInRoomlist(value.toBool());
+ return true;
+ } else
+ return false;
+ }
case Markdown: {
if (value.userType() == QMetaType::Bool) {
i->setMarkdown(value.toBool());
@@ -2090,6 +2118,9 @@ UserSettingsModel::UserSettingsModel(QObject *p)
connect(s.get(), &UserSettings::groupViewStateChanged, this, [this]() {
emit dataChanged(index(GroupView), index(GroupView), {Value});
});
+ connect(s.get(), &UserSettings::scrollbarsInRoomlistChanged, this, [this]() {
+ emit dataChanged(index(ScrollbarsInRoomlist), index(ScrollbarsInRoomlist), {Value});
+ });
connect(s.get(), &UserSettings::roomSortingChanged, this, [this]() {
emit dataChanged(index(SortByImportance), index(SortByImportance), {Value});
});
diff --git a/src/UserSettingsPage.h b/src/UserSettingsPage.h
index 867568b1..b98296aa 100644
--- a/src/UserSettingsPage.h
+++ b/src/UserSettingsPage.h
@@ -39,6 +39,8 @@ class UserSettings final : public QObject
Q_PROPERTY(bool tray READ tray WRITE setTray NOTIFY trayChanged)
Q_PROPERTY(bool startInTray READ startInTray WRITE setStartInTray NOTIFY startInTrayChanged)
Q_PROPERTY(bool groupView READ groupView WRITE setGroupView NOTIFY groupViewStateChanged)
+ Q_PROPERTY(bool scrollbarsInRoomlist READ scrollbarsInRoomlist WRITE setScrollbarsInRoomlist
+ NOTIFY scrollbarsInRoomlistChanged)
Q_PROPERTY(bool markdown READ markdown WRITE setMarkdown NOTIFY markdownChanged)
Q_PROPERTY(
bool invertEnterKey READ invertEnterKey WRITE setInvertEnterKey NOTIFY invertEnterKeyChanged)
@@ -157,6 +159,7 @@ public:
void setFontFamily(QString family);
void setEmojiFontFamily(QString family);
void setGroupView(bool state);
+ void setScrollbarsInRoomlist(bool state);
void setMarkdown(bool state);
void setInvertEnterKey(bool state);
void setBubbles(bool state);
@@ -216,6 +219,7 @@ public:
bool tray() const { return tray_; }
bool startInTray() const { return startInTray_; }
bool groupView() const { return groupView_; }
+ bool scrollbarsInRoomlist() const { return scrollbarsInRoomlist_; }
bool avatarCircles() const { return avatarCircles_; }
bool decryptSidebar() const { return decryptSidebar_; }
bool decryptNotifications() const { return decryptNotifications_; }
@@ -283,6 +287,7 @@ public:
signals:
void groupViewStateChanged(bool state);
+ void scrollbarsInRoomlistChanged(bool state);
void roomSortingChanged(bool state);
void themeChanged(QString state);
void messageHoverHighlightChanged(bool state);
@@ -355,6 +360,7 @@ private:
bool tray_;
bool startInTray_;
bool groupView_;
+ bool scrollbarsInRoomlist_;
bool markdown_;
bool invertEnterKey_;
bool bubbles_;
@@ -436,6 +442,7 @@ class UserSettingsModel final : public QAbstractListModel
UseIdenticon,
PrivacyScreen,
PrivacyScreenTimeout,
+ ScrollbarsInRoomlist,
#ifdef NHEKO_DBUS_SYS
ExposeDBusApi,
#endif
|