2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 00:46:08 +00:00

Move some style code to lib_ui.

This commit is contained in:
John Preston
2019-09-13 13:24:06 +03:00
parent 5a1c8e6a0a
commit e2f54eb3e9
69 changed files with 1119 additions and 856 deletions

View File

@@ -1476,7 +1476,7 @@ bool _readSetting(quint32 blockId, QDataStream &stream, int version, ReadSetting
constexpr auto kOneAndHalf = 3;
constexpr auto kTwo = 4;
switch (v) {
case kAuto: return kInterfaceScaleAuto;
case kAuto: return style::kScaleAuto;
case kOne: return 100;
case kOneAndQuarter: return 125;
case kOneAndHalf: return 150;
@@ -1492,7 +1492,7 @@ bool _readSetting(quint32 blockId, QDataStream &stream, int version, ReadSetting
if (!_checkStreamStatus(stream)) return false;
// If cConfigScale() has value then it was set via command line.
if (cConfigScale() == kInterfaceScaleAuto) {
if (cConfigScale() == style::kScaleAuto) {
SetScaleChecked(v);
}
} break;
@@ -2045,8 +2045,8 @@ void _writeUserSettings() {
auto recentEmojiPreloadData = cRecentEmojiPreload();
if (recentEmojiPreloadData.isEmpty()) {
recentEmojiPreloadData.reserve(Ui::Emoji::GetRecent().size());
for (auto &item : Ui::Emoji::GetRecent()) {
recentEmojiPreloadData.reserve(GetRecentEmoji().size());
for (auto &item : GetRecentEmoji()) {
recentEmojiPreloadData.push_back(qMakePair(item.first->id(), item.second));
}
}