mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 22:25:12 +00:00
Initial chat theme changing.
This commit is contained in:
@@ -46,6 +46,7 @@ namespace {
|
||||
constexpr auto kThemeFileSizeLimit = 5 * 1024 * 1024;
|
||||
constexpr auto kBackgroundSizeLimit = 25 * 1024 * 1024;
|
||||
constexpr auto kNightThemeFile = ":/gui/night.tdesktop-theme"_cs;
|
||||
constexpr auto kDarkValueThreshold = 0.5;
|
||||
|
||||
struct Applying {
|
||||
Saved data;
|
||||
@@ -1450,6 +1451,16 @@ bool LoadFromContent(
|
||||
out);
|
||||
}
|
||||
|
||||
rpl::producer<bool> IsThemeDarkValue() {
|
||||
return rpl::single(
|
||||
rpl::empty_value()
|
||||
) | rpl::then(
|
||||
style::PaletteChanged()
|
||||
) | rpl::map([] {
|
||||
return (st::dialogsBg->c.valueF() < kDarkValueThreshold);
|
||||
});
|
||||
}
|
||||
|
||||
QString EditingPalettePath() {
|
||||
return cWorkingDir() + "tdata/editing-theme.tdesktop-palette";
|
||||
}
|
||||
|
Reference in New Issue
Block a user