2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 00:46:08 +00:00

Advanced notifications settings box layout done.

This commit is contained in:
John Preston
2016-10-05 21:37:48 +03:00
parent 41dc0f4e98
commit e7b6d7b498
15 changed files with 443 additions and 192 deletions

View File

@@ -28,6 +28,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "ui/flatcheckbox.h"
#include "mainwindow.h"
#include "window/notifications_manager.h"
#include "boxes/notifications_box.h"
namespace Settings {
@@ -74,6 +75,10 @@ void NotificationsWidget::createControls() {
if (!nativeNotificationsLabel.isEmpty()) {
addChildRow(_nativeNotifications, margin, nativeNotificationsLabel, SLOT(onNativeNotifications()), Global::NativeNotifications());
}
addChildRow(_advanced, margin, slidedPadding, lang(lng_settings_advanced_notifications), SLOT(onAdvanced()));
if (!nativeNotificationsLabel.isEmpty() && Global::NativeNotifications()) {
_advanced->hideFast();
}
}
void NotificationsWidget::onDesktopNotifications() {
@@ -149,6 +154,16 @@ void NotificationsWidget::onNativeNotifications() {
Window::Notifications::manager()->clearAllFast();
Global::SetNativeNotifications(_nativeNotifications->checked());
Local::writeUserSettings();
if (Global::NativeNotifications()) {
_advanced->slideUp();
} else {
_advanced->slideDown();
}
}
void NotificationsWidget::onAdvanced() {
Ui::showLayer(new NotificationsBox());
}
void NotificationsWidget::onPlaySound() {