Top bar notifications option
This commit is contained in:
parent
91a5942273
commit
33f1616dbf
9 changed files with 18 additions and 4 deletions
BIN
Telegram/Resources/icons/info_notifications_active.png
Normal file
BIN
Telegram/Resources/icons/info_notifications_active.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
BIN
Telegram/Resources/icons/info_notifications_active@2x.png
Normal file
BIN
Telegram/Resources/icons/info_notifications_active@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
BIN
Telegram/Resources/icons/info_notifications_active@3x.png
Normal file
BIN
Telegram/Resources/icons/info_notifications_active@3x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
|
|
@ -351,6 +351,10 @@ bool Manager::readCustomFile() {
|
|||
cSetHideFilterNames(v);
|
||||
});
|
||||
});
|
||||
|
||||
ReadBoolOption(settings, "profile_top_mute", [&](auto v) {
|
||||
cSetProfileTopBarNotifications(v);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -395,6 +399,7 @@ void Manager::writeDefaultFile() {
|
|||
settings.insert(qsl("userpic_corner_type"), cUserpicCornersType());
|
||||
settings.insert(qsl("always_show_top_userpic"), cShowTopBarUserpic());
|
||||
settings.insert(qsl("custom_app_icon"), cCustomAppIcon());
|
||||
settings.insert(qsl("profile_top_mute"), cProfileTopBarNotifications());
|
||||
|
||||
auto settingsFolders = QJsonObject();
|
||||
settingsFolders.insert(qsl("default"), cDefaultFilterId());
|
||||
|
|
@ -468,6 +473,7 @@ void Manager::writeCurrentSettings() {
|
|||
settings.insert(qsl("userpic_corner_type"), cUserpicCornersType());
|
||||
settings.insert(qsl("always_show_top_userpic"), cShowTopBarUserpic());
|
||||
settings.insert(qsl("custom_app_icon"), cCustomAppIcon());
|
||||
settings.insert(qsl("profile_top_mute"), cProfileTopBarNotifications());
|
||||
|
||||
auto settingsFolders = QJsonObject();
|
||||
settingsFolders.insert(qsl("default"), cDefaultFilterId());
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ infoTopBarNotifications: IconButton(infoTopBarMenu) {
|
|||
rippleAreaPosition: point(0px, 6px);
|
||||
}
|
||||
infoNotificationsActive: icon {{
|
||||
"info_notifications",
|
||||
"info_notifications_active",
|
||||
windowBgActive
|
||||
}};
|
||||
infoTopBarCall: IconButton(infoTopBarNotifications) {
|
||||
|
|
|
|||
|
|
@ -407,7 +407,6 @@ void WrapWidget::createTopBar() {
|
|||
&& (wrapValue != Wrap::Side || hasStackHistory())) {
|
||||
addTopBarMenuButton();
|
||||
addProfileCallsButton();
|
||||
// addProfileNotificationsButton();
|
||||
} else if (section.type() == Section::Type::Settings
|
||||
&& (section.settingsType() == Section::SettingsType::Main
|
||||
|| section.settingsType() == Section::SettingsType::Chat
|
||||
|
|
@ -418,6 +417,11 @@ void WrapWidget::createTopBar() {
|
|||
addContentSaveButton();
|
||||
}
|
||||
|
||||
if (section.type() == Section::Type::Profile
|
||||
&& cProfileTopBarNotifications()) {
|
||||
addProfileNotificationsButton();
|
||||
}
|
||||
|
||||
_topBar->lower();
|
||||
_topBar->resizeToWidth(width());
|
||||
_topBar->finishAnimating();
|
||||
|
|
|
|||
|
|
@ -376,7 +376,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
|||
tracker);
|
||||
}
|
||||
}
|
||||
if (!_peer->isSelf()) {
|
||||
if (!_peer->isSelf() && !cProfileTopBarNotifications()) {
|
||||
// No notifications toggle for Self => no separator.
|
||||
result->add(object_ptr<Ui::SlideWrap<>>(
|
||||
result,
|
||||
|
|
@ -517,7 +517,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::fill() {
|
|||
add(object_ptr<Ui::BoxContentDivider>(_wrap));
|
||||
add(CreateSkipWidget(_wrap));
|
||||
add(setupInfo());
|
||||
if (!_peer->isSelf()) {
|
||||
if (!_peer->isSelf() && !cProfileTopBarNotifications()) {
|
||||
add(setupMuteToggle());
|
||||
}
|
||||
setupMainButtons();
|
||||
|
|
|
|||
|
|
@ -324,3 +324,5 @@ int gDefaultFilterId = 0;
|
|||
bool gUnmutedFilterCounterOnly = false;
|
||||
bool gHideFilterEditButton = false;
|
||||
bool gHideFilterNames = false;
|
||||
|
||||
bool gProfileTopBarNotifications = false;
|
||||
|
|
|
|||
|
|
@ -254,3 +254,5 @@ DeclareSetting(int, DefaultFilterId);
|
|||
DeclareSetting(bool, UnmutedFilterCounterOnly);
|
||||
DeclareSetting(bool, HideFilterEditButton);
|
||||
DeclareSetting(bool, HideFilterNames);
|
||||
|
||||
DeclareSetting(bool, ProfileTopBarNotifications);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue