mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Enable auto-night-mode by default.
This commit is contained in:
parent
efe99b3f62
commit
0445f7d6e8
2 changed files with 10 additions and 6 deletions
|
@ -240,7 +240,7 @@ QByteArray Settings::serialize() const {
|
||||||
+ Serialize::stringSize(_customFontFamily)
|
+ Serialize::stringSize(_customFontFamily)
|
||||||
+ sizeof(qint32) * 3
|
+ sizeof(qint32) * 3
|
||||||
+ Serialize::bytearraySize(_tonsiteStorageToken)
|
+ Serialize::bytearraySize(_tonsiteStorageToken)
|
||||||
+ sizeof(qint32) * 6;
|
+ sizeof(qint32) * 7;
|
||||||
|
|
||||||
auto result = QByteArray();
|
auto result = QByteArray();
|
||||||
result.reserve(size);
|
result.reserve(size);
|
||||||
|
@ -309,7 +309,7 @@ QByteArray Settings::serialize() const {
|
||||||
<< qint32(_thirdSectionExtendedBy)
|
<< qint32(_thirdSectionExtendedBy)
|
||||||
<< qint32(_notifyFromAll ? 1 : 0)
|
<< qint32(_notifyFromAll ? 1 : 0)
|
||||||
<< qint32(_nativeWindowFrame.current() ? 1 : 0)
|
<< qint32(_nativeWindowFrame.current() ? 1 : 0)
|
||||||
<< qint32(_systemDarkModeEnabled.current() ? 1 : 0)
|
<< qint32(0) // Legacy system dark mode
|
||||||
<< _cameraDeviceId.current()
|
<< _cameraDeviceId.current()
|
||||||
<< qint32(_ipRevealWarning ? 1 : 0)
|
<< qint32(_ipRevealWarning ? 1 : 0)
|
||||||
<< qint32(_groupCallPushToTalk ? 1 : 0)
|
<< qint32(_groupCallPushToTalk ? 1 : 0)
|
||||||
|
@ -400,7 +400,8 @@ QByteArray Settings::serialize() const {
|
||||||
<< qint32(_skipToastsInFocus ? 1 : 0)
|
<< qint32(_skipToastsInFocus ? 1 : 0)
|
||||||
<< qint32(_recordVideoMessages ? 1 : 0)
|
<< qint32(_recordVideoMessages ? 1 : 0)
|
||||||
<< SerializeVideoQuality(_videoQuality)
|
<< SerializeVideoQuality(_videoQuality)
|
||||||
<< qint32(_ivZoom.current());
|
<< qint32(_ivZoom.current())
|
||||||
|
<< qint32(_systemDarkModeEnabled.current() ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ensures(result.size() == size);
|
Ensures(result.size() == size);
|
||||||
|
@ -477,6 +478,7 @@ void Settings::addFromSerialized(const QByteArray &serialized) {
|
||||||
qint32 notifyFromAll = _notifyFromAll ? 1 : 0;
|
qint32 notifyFromAll = _notifyFromAll ? 1 : 0;
|
||||||
qint32 nativeWindowFrame = _nativeWindowFrame.current() ? 1 : 0;
|
qint32 nativeWindowFrame = _nativeWindowFrame.current() ? 1 : 0;
|
||||||
qint32 systemDarkModeEnabled = _systemDarkModeEnabled.current() ? 1 : 0;
|
qint32 systemDarkModeEnabled = _systemDarkModeEnabled.current() ? 1 : 0;
|
||||||
|
qint32 legacySystemDarkModeEnabled = 0;
|
||||||
qint32 ipRevealWarning = _ipRevealWarning ? 1 : 0;
|
qint32 ipRevealWarning = _ipRevealWarning ? 1 : 0;
|
||||||
qint32 groupCallPushToTalk = _groupCallPushToTalk ? 1 : 0;
|
qint32 groupCallPushToTalk = _groupCallPushToTalk ? 1 : 0;
|
||||||
QByteArray groupCallPushToTalkShortcut = _groupCallPushToTalkShortcut;
|
QByteArray groupCallPushToTalkShortcut = _groupCallPushToTalkShortcut;
|
||||||
|
@ -610,7 +612,7 @@ void Settings::addFromSerialized(const QByteArray &serialized) {
|
||||||
stream >> nativeWindowFrame;
|
stream >> nativeWindowFrame;
|
||||||
}
|
}
|
||||||
if (!stream.atEnd()) {
|
if (!stream.atEnd()) {
|
||||||
stream >> systemDarkModeEnabled;
|
stream >> legacySystemDarkModeEnabled;
|
||||||
}
|
}
|
||||||
if (!stream.atEnd()) {
|
if (!stream.atEnd()) {
|
||||||
stream >> cameraDeviceId;
|
stream >> cameraDeviceId;
|
||||||
|
@ -853,6 +855,9 @@ void Settings::addFromSerialized(const QByteArray &serialized) {
|
||||||
if (!stream.atEnd()) {
|
if (!stream.atEnd()) {
|
||||||
stream >> ivZoom;
|
stream >> ivZoom;
|
||||||
}
|
}
|
||||||
|
if (!stream.atEnd()) {
|
||||||
|
stream >> systemDarkModeEnabled;
|
||||||
|
}
|
||||||
if (stream.status() != QDataStream::Ok) {
|
if (stream.status() != QDataStream::Ok) {
|
||||||
LOG(("App Error: "
|
LOG(("App Error: "
|
||||||
"Bad data for Core::Settings::constructFromSerialized()"));
|
"Bad data for Core::Settings::constructFromSerialized()"));
|
||||||
|
@ -1453,7 +1458,6 @@ void Settings::resetOnLastLogout() {
|
||||||
_thirdColumnWidth = kDefaultThirdColumnWidth; // p-w
|
_thirdColumnWidth = kDefaultThirdColumnWidth; // p-w
|
||||||
_notifyFromAll = true;
|
_notifyFromAll = true;
|
||||||
_tabbedReplacedWithInfo = false; // per-window
|
_tabbedReplacedWithInfo = false; // per-window
|
||||||
_systemDarkModeEnabled = false;
|
|
||||||
_hiddenGroupCallTooltips = 0;
|
_hiddenGroupCallTooltips = 0;
|
||||||
_storiesClickTooltipHidden = false;
|
_storiesClickTooltipHidden = false;
|
||||||
_ttlVoiceClickTooltipHidden = false;
|
_ttlVoiceClickTooltipHidden = false;
|
||||||
|
|
|
@ -1036,7 +1036,7 @@ private:
|
||||||
bool _notifyFromAll = true;
|
bool _notifyFromAll = true;
|
||||||
rpl::variable<bool> _nativeWindowFrame = false;
|
rpl::variable<bool> _nativeWindowFrame = false;
|
||||||
rpl::variable<std::optional<bool>> _systemDarkMode = std::nullopt;
|
rpl::variable<std::optional<bool>> _systemDarkMode = std::nullopt;
|
||||||
rpl::variable<bool> _systemDarkModeEnabled = false;
|
rpl::variable<bool> _systemDarkModeEnabled = true;
|
||||||
rpl::variable<WindowTitleContent> _windowTitleContent;
|
rpl::variable<WindowTitleContent> _windowTitleContent;
|
||||||
WindowPosition _windowPosition; // per-window
|
WindowPosition _windowPosition; // per-window
|
||||||
bool _disableOpenGL = false;
|
bool _disableOpenGL = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue