mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-05 08:55:59 +00:00
Add "Respect the Focus settings" on Windows.
This commit is contained in:
@@ -864,6 +864,27 @@ NotifyViewCheckboxes SetupNotifyViewOptions(
|
||||
void SetupAdvancedNotifications(
|
||||
not_null<Window::SessionController*> controller,
|
||||
not_null<Ui::VerticalLayout*> container) {
|
||||
if (Platform::IsWindows()) {
|
||||
const auto skipInFocus = container->add(object_ptr<Button>(
|
||||
container,
|
||||
tr::lng_settings_skip_in_focus(),
|
||||
st::settingsButtonNoIcon
|
||||
))->toggleOn(rpl::single(Core::App().settings().skipToastsInFocus()));
|
||||
|
||||
skipInFocus->toggledChanges(
|
||||
) | rpl::filter([](bool checked) {
|
||||
return (checked != Core::App().settings().skipToastsInFocus());
|
||||
}) | rpl::start_with_next([=](bool checked) {
|
||||
Core::App().settings().setSkipToastsInFocus(checked);
|
||||
Core::App().saveSettingsDelayed();
|
||||
if (checked && Platform::Notifications::SkipToastForCustom()) {
|
||||
using Change = Window::Notifications::ChangeType;
|
||||
Core::App().notifications().notifySettingsChanged(
|
||||
Change::DesktopEnabled);
|
||||
}
|
||||
}, skipInFocus->lifetime());
|
||||
}
|
||||
|
||||
Ui::AddSkip(container, st::settingsCheckboxesSkip);
|
||||
Ui::AddDivider(container);
|
||||
Ui::AddSkip(container, st::settingsCheckboxesSkip);
|
||||
|
Reference in New Issue
Block a user