mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-02 07:25:46 +00:00
Allow to resize chats list. One more mode added (narrow chats list).
This commit is contained in:
@@ -558,6 +558,7 @@ enum {
|
||||
dbiNotificationsCount = 0x45,
|
||||
dbiNotificationsCorner = 0x46,
|
||||
dbiTheme = 0x47,
|
||||
dbiDialogsWidthRatio = 0x48,
|
||||
|
||||
dbiEncryptedWithSalt = 333,
|
||||
dbiEncrypted = 444,
|
||||
@@ -1032,6 +1033,14 @@ bool _readSetting(quint32 blockId, QDataStream &stream, int version) {
|
||||
Global::SetNotificationsCorner(static_cast<Notify::ScreenCorner>((v >= 0 && v < 4) ? v : 2));
|
||||
} break;
|
||||
|
||||
case dbiDialogsWidthRatio: {
|
||||
qint32 v;
|
||||
stream >> v;
|
||||
if (!_checkStreamStatus(stream)) return false;
|
||||
|
||||
Global::SetDialogsWidthRatio(v / 1000000.);
|
||||
} break;
|
||||
|
||||
case dbiWorkMode: {
|
||||
qint32 v;
|
||||
stream >> v;
|
||||
@@ -1608,7 +1617,7 @@ void _writeUserSettings() {
|
||||
_writeMap(WriteMapFast);
|
||||
}
|
||||
|
||||
uint32 size = 20 * (sizeof(quint32) + sizeof(qint32));
|
||||
uint32 size = 21 * (sizeof(quint32) + sizeof(qint32));
|
||||
size += sizeof(quint32) + Serialize::stringSize(Global::AskDownloadPath() ? QString() : Global::DownloadPath()) + Serialize::bytearraySize(Global::AskDownloadPath() ? QByteArray() : Global::DownloadPathBookmark());
|
||||
size += sizeof(quint32) + sizeof(qint32) + (cRecentEmojisPreload().isEmpty() ? cGetRecentEmojis().size() : cRecentEmojisPreload().size()) * (sizeof(uint64) + sizeof(ushort));
|
||||
size += sizeof(quint32) + sizeof(qint32) + cEmojiVariants().size() * (sizeof(uint32) + sizeof(uint64));
|
||||
@@ -1644,6 +1653,7 @@ void _writeUserSettings() {
|
||||
data.stream << quint32(dbiDialogsMode) << qint32(Global::DialogsModeEnabled() ? 1 : 0) << static_cast<qint32>(Global::DialogsMode());
|
||||
data.stream << quint32(dbiModerateMode) << qint32(Global::ModerateModeEnabled() ? 1 : 0);
|
||||
data.stream << quint32(dbiAutoPlay) << qint32(cAutoPlayGif() ? 1 : 0);
|
||||
data.stream << quint32(dbiDialogsWidthRatio) << qint32(snap(qRound(Global::DialogsWidthRatio() * 1000000), 0, 1000000));
|
||||
|
||||
{
|
||||
RecentEmojisPreload v(cRecentEmojisPreload());
|
||||
|
Reference in New Issue
Block a user