mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Start non-unique ChatTheme.
This commit is contained in:
@@ -868,9 +868,9 @@ void ChatBackground::adjustPaletteUsingColor(QColor color) {
|
||||
std::optional<QColor> ChatBackground::colorForFill() const {
|
||||
return !_prepared.isNull()
|
||||
? imageMonoColor()
|
||||
: !_gradient.isNull()
|
||||
: (!_gradient.isNull() || _paper.backgroundColors().empty())
|
||||
? std::nullopt
|
||||
: _paper.backgroundColor();
|
||||
: std::make_optional(_paper.backgroundColors().front());
|
||||
}
|
||||
|
||||
QImage ChatBackground::gradientForFill() const {
|
||||
@@ -1390,6 +1390,21 @@ bool IsNightMode() {
|
||||
return GlobalBackground ? Background()->nightMode() : false;
|
||||
}
|
||||
|
||||
rpl::producer<bool> IsNightModeValue() {
|
||||
auto changes = Background()->updates(
|
||||
) | rpl::filter([=](const BackgroundUpdate &update) {
|
||||
return update.type == BackgroundUpdate::Type::ApplyingTheme;
|
||||
}) | rpl::to_empty;
|
||||
|
||||
return rpl::single(
|
||||
rpl::empty_value()
|
||||
) | rpl::then(
|
||||
std::move(changes)
|
||||
) | rpl::map([=] {
|
||||
return IsNightMode();
|
||||
}) | rpl::distinct_until_changed();
|
||||
}
|
||||
|
||||
void SetNightModeValue(bool nightMode) {
|
||||
if (GlobalBackground || nightMode) {
|
||||
Background()->setNightModeValue(nightMode);
|
||||
|
Reference in New Issue
Block a user