Skip to content

Commit

Permalink
removed notification hide time and show ids
Browse files Browse the repository at this point in the history
  • Loading branch information
xmdnx committed Nov 1, 2023
1 parent 490b148 commit 0cb8ab5
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 67 deletions.
30 changes: 0 additions & 30 deletions Telegram/SourceFiles/info/profile/info_profile_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,20 +448,6 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
phoneLabel->setContextMenuHook(hook);
}

if (::RabbitSettings::JsonSettings::GetBool("show_ids")) {
auto idDrawableText = IDValue(
user
) | rpl::map([](TextWithEntities &&text) {
return Ui::Text::Link(text.text);
});
auto idInfo = addInfoOneLine(
(user->isBot()
? rktr("rtg_profile_bot_id")
: rktr("rtg_profile_user_id")),
std::move(idDrawableText),
ktr("rtg_profile_copy_id"));
}

auto label = user->isBot()
? tr::lng_info_about_label()
: tr::lng_info_bio_label();
Expand Down Expand Up @@ -573,22 +559,6 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
linkLine.text->overrideLinkClickHandler(linkCallback);
linkLine.subtext->overrideLinkClickHandler(linkCallback);

if (::RabbitSettings::JsonSettings::GetBool("show_ids")) {
auto idDrawableText = IDValue(
_peer
) | rpl::map([](TextWithEntities &&text) {
return Ui::Text::Link(text.text);
});
auto idInfo = addInfoOneLine(
(_peer->isChat()
? rktr("rtg_profile_group_id")
: _peer->isMegagroup()
? rktr("rtg_profile_supergroup_id")
: rktr("rtg_profile_channel_id")),
std::move(idDrawableText),
ktr("rtg_profile_copy_id"));
}

if (const auto channel = _topic ? nullptr : _peer->asChannel()) {
auto locationText = LocationValue(
channel
Expand Down
7 changes: 0 additions & 7 deletions Telegram/SourceFiles/rabbit/rabbit_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,16 +235,9 @@ const std::map<QString, Definition, std::greater<QString>> DefinitionMap {
{ "show_phone_in_settings", {
.type = SettingType::BoolSetting,
.defaultValue = true, }},
{ "show_ids", {
.type = SettingType::BoolSetting,
.defaultValue = false, }},
{ "auto_hide_notifications", {
.type = SettingType::BoolSetting,
.defaultValue = false, }},
{ "hide_notifications_after", {
.type = SettingType::IntSetting,
.defaultValue = 10,
.limitHandler = IntLimit(0, 30, 10), }},
// Appearance
{ "userpic_roundness", {
.type = SettingType::IntSetting,
Expand Down
28 changes: 0 additions & 28 deletions Telegram/SourceFiles/rabbit/rabbit_settings_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,35 +64,7 @@ namespace Settings {
AddSubsectionTitle(container, rktr("rtg_settings_general"));

SettingsMenuJsonSwitch(rtg_settings_show_phone_number, show_phone_in_settings);
SettingsMenuJsonSwitch(rtg_settings_chat_id, show_ids);
SettingsMenuJsonSwitch(rtg_settings_auto_hide_notifications, auto_hide_notifications);

const auto notificationHideTimeLabel = container->add(
object_ptr<Ui::LabelSimple>(
container,
st::settingsAudioVolumeLabel),
st::settingsAudioVolumeLabelPadding);
const auto notificationHideTimeSlider = container->add(
object_ptr<Ui::MediaSlider>(
container,
st::settingsAudioVolumeSlider),
st::settingsAudioVolumeSliderPadding);
const auto updateNotificationHideTimeLabel = [=](int value) {
const auto seconds = QString::number(value);
notificationHideTimeLabel->setText(ktr("rtg_settings_hide_notifications_after", { "seconds", seconds }));
};
const auto updateNotificationHideTime = [=](int value) {
updateNotificationHideTimeLabel(value);
::RabbitSettings::JsonSettings::Set("hide_notifications_after", value);
::RabbitSettings::JsonSettings::Write();
};
notificationHideTimeSlider->resize(st::settingsAudioVolumeSlider.seekSize);
notificationHideTimeSlider->setPseudoDiscrete(
31,
[](int val) { return val; },
::RabbitSettings::JsonSettings::GetInt("hide_notifications_after"),
updateNotificationHideTime);
updateNotificationHideTimeLabel(::RabbitSettings::JsonSettings::GetInt("hide_notifications_after"));
}

void Rabbit::SetupAppearance(not_null<Ui::VerticalLayout *> container) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ For license and copyright information please follow this link:
https://github.com/rabbitGramDesktop/rabbitGramDesktop/blob/dev/LEGAL
*/
#include "window/notifications_manager_default.h"
#include "rabbit/rabbit_settings.h"

#include "platform/platform_notifications_manager.h"
#include "platform/platform_specific.h"
Expand Down Expand Up @@ -49,7 +48,7 @@ namespace Notifications {
namespace Default {
namespace {

auto kAutoHideInterval = crl::time(RabbitSettings::JsonSettings::GetInt("hide_notifications_after") * 1000);
auto kAutoHideInterval = crl::time(10000);

[[nodiscard]] QPoint notificationStartPosition() {
const auto corner = Core::App().settings().notificationsCorner();
Expand Down

0 comments on commit 0cb8ab5

Please sign in to comment.