diff --git a/Telegram/Resources/default_kotato-settings-custom.json b/Telegram/Resources/default_kotato-settings-custom.json index 0278e8a8d..c22296c9d 100644 --- a/Telegram/Resources/default_kotato-settings-custom.json +++ b/Telegram/Resources/default_kotato-settings-custom.json @@ -9,5 +9,6 @@ // "monospaced": "Consolas" // }, // "sticker_height": 256, - // "big_emoji_outline": true + // "big_emoji_outline": true, + // "always_show_scheduled": false } diff --git a/Telegram/SourceFiles/core/kotato_settings.cpp b/Telegram/SourceFiles/core/kotato_settings.cpp index eeaacf3bb..995ba806d 100644 --- a/Telegram/SourceFiles/core/kotato_settings.cpp +++ b/Telegram/SourceFiles/core/kotato_settings.cpp @@ -167,6 +167,11 @@ bool Manager::readCustomFile() { if (settingsBigEmojiOutlineIterator != settingsFonts.constEnd() && (*settingsBigEmojiOutlineIterator).isBool()) { cSetBigEmojiOutline((*settingsBigEmojiOutlineIterator).toBool()); } + + const auto settingsAlwaysShowScheduledIterator = settings.constFind(qsl("always_show_scheduled")); + if (settingsAlwaysShowScheduledIterator != settingsFonts.constEnd() && (*settingsAlwaysShowScheduledIterator).isBool()) { + cSetAlwaysShowScheduled((*settingsAlwaysShowScheduledIterator).toBool()); + } return true; } @@ -196,6 +201,7 @@ void Manager::writeDefaultFile() { settings.insert(qsl("sticker_height"), cStickerHeight()); settings.insert(qsl("big_emoji_outline"), cBigEmojiOutline()); + settings.insert(qsl("always_show_scheduled"), cAlwaysShowScheduled()); auto document = QJsonDocument(); document.setObject(settings); diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 65d81897f..17e110603 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -1971,12 +1971,14 @@ void HistoryWidget::refreshScheduledToggle() { if (_scheduled) { _scheduled.destroy(); } - _scheduled.create(this, (has ? st::historyScheduledToggle : st::historyScheduledToggleEmpty)); - _scheduled->show(); - _scheduled->addClickHandler([=] { - controller()->showSection( - HistoryView::ScheduledMemento(_history)); - }); + if (cAlwaysShowScheduled() || has){ + _scheduled.create(this, (has ? st::historyScheduledToggle : st::historyScheduledToggleEmpty)); + _scheduled->show(); + _scheduled->addClickHandler([=] { + controller()->showSection( + HistoryView::ScheduledMemento(_history)); + }); + } } } diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index a6070e8ae..04f54a8aa 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -211,4 +211,5 @@ QString gMainFont, gSemiboldFont, gMonospaceFont; bool gSemiboldFontIsBold = false; int gStickerHeight = 256; -bool gBigEmojiOutline = true; \ No newline at end of file +bool gBigEmojiOutline = true; +bool gAlwaysShowScheduled = false; \ No newline at end of file diff --git a/Telegram/SourceFiles/settings.h b/Telegram/SourceFiles/settings.h index f632fda14..d4299077c 100644 --- a/Telegram/SourceFiles/settings.h +++ b/Telegram/SourceFiles/settings.h @@ -186,3 +186,4 @@ DeclareSetting(QString, MonospaceFont); DeclareSetting(int, StickerHeight); DeclareSetting(bool, BigEmojiOutline); +DeclareSetting(bool, AlwaysShowScheduled);