Add option to open deck in new tab by default (#5143)

* add comments

* add new setting for openDeckInNewTab

* implement open deck in new tab

* rename setting

* fix typo

* set default to false
This commit is contained in:
RickyRister 2024-11-10 15:16:50 -08:00 committed by GitHub
parent c54f47efbf
commit c2fe3cda35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 64 additions and 6 deletions

View file

@ -243,6 +243,7 @@ SettingsCache::SettingsCache()
invertVerticalCoordinate = settings->value("table/invert_vertical", false).toBool();
minPlayersForMultiColumnLayout = settings->value("interface/min_players_multicolumn", 4).toInt();
tapAnimation = settings->value("cards/tapanimation", true).toBool();
openDeckInNewTab = settings->value("editor/openDeckInNewTab", false).toBool();
chatMention = settings->value("chat/mention", true).toBool();
chatMentionCompleter = settings->value("chat/mentioncompleter", true).toBool();
chatMentionForeground = settings->value("chat/mentionforeground", true).toBool();
@ -537,6 +538,12 @@ void SettingsCache::setTapAnimation(QT_STATE_CHANGED_T _tapAnimation)
settings->setValue("cards/tapanimation", tapAnimation);
}
void SettingsCache::setOpenDeckInNewTab(QT_STATE_CHANGED_T _openDeckInNewTab)
{
openDeckInNewTab = static_cast<bool>(_openDeckInNewTab);
settings->setValue("editor/openDeckInNewTab", openDeckInNewTab);
}
void SettingsCache::setChatMention(QT_STATE_CHANGED_T _chatMention)
{
chatMention = static_cast<bool>(_chatMention);