mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 07:33:52 +02:00
Removed Adaptive namespace from Settings::Chat.
This commit is contained in:
parent
295a863d69
commit
9b488f03a1
3 changed files with 9 additions and 7 deletions
|
@ -34,6 +34,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "window/themes/window_themes_embedded.h"
|
#include "window/themes/window_themes_embedded.h"
|
||||||
#include "window/themes/window_theme_editor_box.h"
|
#include "window/themes/window_theme_editor_box.h"
|
||||||
#include "window/themes/window_themes_cloud_list.h"
|
#include "window/themes/window_themes_cloud_list.h"
|
||||||
|
#include "window/window_adaptive.h"
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.h"
|
||||||
#include "window/window_controller.h"
|
#include "window/window_controller.h"
|
||||||
#include "storage/localstorage.h"
|
#include "storage/localstorage.h"
|
||||||
|
@ -967,19 +968,15 @@ void SetupChatBackground(
|
||||||
tile->setChecked(tiled);
|
tile->setChecked(tiled);
|
||||||
}, tile->lifetime());
|
}, tile->lifetime());
|
||||||
|
|
||||||
adaptive->toggleOn(rpl::single(
|
adaptive->toggleOn(controller->adaptive().chatLayoutValue(
|
||||||
rpl::empty_value()
|
) | rpl::map([](Window::AdaptiveModern::ChatLayout layout) {
|
||||||
) | rpl::then(base::ObservableViewer(
|
return (layout == Window::AdaptiveModern::ChatLayout::Wide);
|
||||||
Adaptive::Changed()
|
|
||||||
)) | rpl::map([] {
|
|
||||||
return (Global::AdaptiveChatLayout() == Adaptive::ChatLayout::Wide);
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
adaptive->entity()->checkedChanges(
|
adaptive->entity()->checkedChanges(
|
||||||
) | rpl::start_with_next([=](bool checked) {
|
) | rpl::start_with_next([=](bool checked) {
|
||||||
Core::App().settings().setAdaptiveForWide(checked);
|
Core::App().settings().setAdaptiveForWide(checked);
|
||||||
Core::App().saveSettingsDelayed();
|
Core::App().saveSettingsDelayed();
|
||||||
Adaptive::Changed().notify();
|
|
||||||
}, adaptive->lifetime());
|
}, adaptive->lifetime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,10 @@ rpl::producer<bool> AdaptiveModern::oneColumnValue() const {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rpl::producer<AdaptiveModern::ChatLayout> AdaptiveModern::chatLayoutValue() const {
|
||||||
|
return _chatLayout.value();
|
||||||
|
}
|
||||||
|
|
||||||
bool AdaptiveModern::isOneColumn() const {
|
bool AdaptiveModern::isOneColumn() const {
|
||||||
return _layout.current() == WindowLayout::OneColumn;
|
return _layout.current() == WindowLayout::OneColumn;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ public:
|
||||||
|
|
||||||
[[nodiscard]] rpl::producer<> changed() const;
|
[[nodiscard]] rpl::producer<> changed() const;
|
||||||
[[nodiscard]] rpl::producer<bool> oneColumnValue() const;
|
[[nodiscard]] rpl::producer<bool> oneColumnValue() const;
|
||||||
|
[[nodiscard]] rpl::producer<ChatLayout> chatLayoutValue() const;
|
||||||
|
|
||||||
[[nodiscard]] bool isOneColumn() const;
|
[[nodiscard]] bool isOneColumn() const;
|
||||||
[[nodiscard]] bool isNormal() const;
|
[[nodiscard]] bool isNormal() const;
|
||||||
|
|
Loading…
Add table
Reference in a new issue