Making showing scheduled icon optional
This commit is contained in:
parent
7e6bc1b6b1
commit
343e188448
5 changed files with 19 additions and 8 deletions
|
|
@ -9,5 +9,6 @@
|
||||||
// "monospaced": "Consolas"
|
// "monospaced": "Consolas"
|
||||||
// },
|
// },
|
||||||
// "sticker_height": 256,
|
// "sticker_height": 256,
|
||||||
// "big_emoji_outline": true
|
// "big_emoji_outline": true,
|
||||||
|
// "always_show_scheduled": false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -167,6 +167,11 @@ bool Manager::readCustomFile() {
|
||||||
if (settingsBigEmojiOutlineIterator != settingsFonts.constEnd() && (*settingsBigEmojiOutlineIterator).isBool()) {
|
if (settingsBigEmojiOutlineIterator != settingsFonts.constEnd() && (*settingsBigEmojiOutlineIterator).isBool()) {
|
||||||
cSetBigEmojiOutline((*settingsBigEmojiOutlineIterator).toBool());
|
cSetBigEmojiOutline((*settingsBigEmojiOutlineIterator).toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto settingsAlwaysShowScheduledIterator = settings.constFind(qsl("always_show_scheduled"));
|
||||||
|
if (settingsAlwaysShowScheduledIterator != settingsFonts.constEnd() && (*settingsAlwaysShowScheduledIterator).isBool()) {
|
||||||
|
cSetAlwaysShowScheduled((*settingsAlwaysShowScheduledIterator).toBool());
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -196,6 +201,7 @@ void Manager::writeDefaultFile() {
|
||||||
|
|
||||||
settings.insert(qsl("sticker_height"), cStickerHeight());
|
settings.insert(qsl("sticker_height"), cStickerHeight());
|
||||||
settings.insert(qsl("big_emoji_outline"), cBigEmojiOutline());
|
settings.insert(qsl("big_emoji_outline"), cBigEmojiOutline());
|
||||||
|
settings.insert(qsl("always_show_scheduled"), cAlwaysShowScheduled());
|
||||||
|
|
||||||
auto document = QJsonDocument();
|
auto document = QJsonDocument();
|
||||||
document.setObject(settings);
|
document.setObject(settings);
|
||||||
|
|
|
||||||
|
|
@ -1971,12 +1971,14 @@ void HistoryWidget::refreshScheduledToggle() {
|
||||||
if (_scheduled) {
|
if (_scheduled) {
|
||||||
_scheduled.destroy();
|
_scheduled.destroy();
|
||||||
}
|
}
|
||||||
_scheduled.create(this, (has ? st::historyScheduledToggle : st::historyScheduledToggleEmpty));
|
if (cAlwaysShowScheduled() || has){
|
||||||
_scheduled->show();
|
_scheduled.create(this, (has ? st::historyScheduledToggle : st::historyScheduledToggleEmpty));
|
||||||
_scheduled->addClickHandler([=] {
|
_scheduled->show();
|
||||||
controller()->showSection(
|
_scheduled->addClickHandler([=] {
|
||||||
HistoryView::ScheduledMemento(_history));
|
controller()->showSection(
|
||||||
});
|
HistoryView::ScheduledMemento(_history));
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -211,4 +211,5 @@ QString gMainFont, gSemiboldFont, gMonospaceFont;
|
||||||
bool gSemiboldFontIsBold = false;
|
bool gSemiboldFontIsBold = false;
|
||||||
|
|
||||||
int gStickerHeight = 256;
|
int gStickerHeight = 256;
|
||||||
bool gBigEmojiOutline = true;
|
bool gBigEmojiOutline = true;
|
||||||
|
bool gAlwaysShowScheduled = false;
|
||||||
|
|
@ -186,3 +186,4 @@ DeclareSetting(QString, MonospaceFont);
|
||||||
|
|
||||||
DeclareSetting(int, StickerHeight);
|
DeclareSetting(int, StickerHeight);
|
||||||
DeclareSetting(bool, BigEmojiOutline);
|
DeclareSetting(bool, BigEmojiOutline);
|
||||||
|
DeclareSetting(bool, AlwaysShowScheduled);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue