mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Base custom chat themes on a separate light theme.
This commit is contained in:
parent
2c7d8858c0
commit
d4db679ce8
3 changed files with 12 additions and 15 deletions
BIN
Telegram/Resources/day-custom-base.tdesktop-theme
Normal file
BIN
Telegram/Resources/day-custom-base.tdesktop-theme
Normal file
Binary file not shown.
|
@ -60,6 +60,7 @@
|
|||
<file alias="day-blue.tdesktop-theme">../../day-blue.tdesktop-theme</file>
|
||||
<file alias="night.tdesktop-theme">../../night.tdesktop-theme</file>
|
||||
<file alias="night-green.tdesktop-theme">../../night-green.tdesktop-theme</file>
|
||||
<file alias="day-custom-base.tdesktop-theme">../../day-custom-base.tdesktop-theme</file>
|
||||
<file alias="night-custom-base.tdesktop-theme">../../night-custom-base.tdesktop-theme</file>
|
||||
<file alias="icons/calls/hands.lottie">../../icons/calls/hands.lottie</file>
|
||||
<file alias="icons/calls/voice.lottie">../../icons/calls/voice.lottie</file>
|
||||
|
|
|
@ -76,6 +76,7 @@ namespace Window {
|
|||
namespace {
|
||||
|
||||
constexpr auto kMaxChatEntryHistorySize = 50;
|
||||
constexpr auto kDayBaseFile = ":/gui/day-custom-base.tdesktop-theme"_cs;
|
||||
constexpr auto kNightBaseFile = ":/gui/night-custom-base.tdesktop-theme"_cs;
|
||||
|
||||
[[nodiscard]] Fn<void(style::palette&)> PreparePaletteCallback(
|
||||
|
@ -93,21 +94,16 @@ constexpr auto kNightBaseFile = ":/gui/night-custom-base.tdesktop-theme"_cs;
|
|||
? ColorizerFrom(*i, *accent)
|
||||
: style::colorizer();
|
||||
|
||||
if (dark) {
|
||||
auto instance = Instance();
|
||||
const auto loaded = LoadFromFile(
|
||||
kNightBaseFile.utf16(),
|
||||
&instance,
|
||||
nullptr,
|
||||
nullptr,
|
||||
colorizer);
|
||||
Assert(loaded);
|
||||
|
||||
palette.finalize();
|
||||
palette = instance.palette;
|
||||
} else {
|
||||
palette.finalize(colorizer);
|
||||
}
|
||||
auto instance = Instance();
|
||||
const auto loaded = LoadFromFile(
|
||||
(dark ? kNightBaseFile : kDayBaseFile).utf16(),
|
||||
&instance,
|
||||
nullptr,
|
||||
nullptr,
|
||||
colorizer);
|
||||
Assert(loaded);
|
||||
palette.finalize();
|
||||
palette = instance.palette;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue