2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Show premium page on limit increase decision.

This commit is contained in:
John Preston
2022-05-20 17:12:56 +04:00
parent dc444ec22b
commit 5cd065ef6b
10 changed files with 42 additions and 24 deletions

View File

@@ -1082,7 +1082,7 @@ premiumBubblePadding: margins(14px, 0px, 14px, 0px);
premiumBubbleHeight: 40px;
premiumBubbleSkip: 5px;
premiumBubbleTextSkip: 3px;
premiumBubbleSlideDuration: 500;
premiumBubbleSlideDuration: 1000;
premiumBubbleTailSize: size(21px, 7px);
premiumBubbleFont: font(19px);
premiumLineTextSkip: 11px;

View File

@@ -25,6 +25,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_session.h"
#include "lang/lang_keys.h"
#include "settings/settings_common.h"
#include "settings/settings_premium.h"
#include "base/unixtime.h"
#include "apiwrap.h"
#include "styles/style_boxes.h"
@@ -432,9 +433,7 @@ void SimpleLimitBox(
});
} else {
box->addButton(tr::lng_limits_increase(), [=] {
Ui::ShowMultilineToast({
.text = { u"Premium!"_q },
});
Settings::ShowPremium(session);
});
}
@@ -565,9 +564,7 @@ void ChannelsLimitBox(
});
} else {
box->addButton(tr::lng_limits_increase(), [=] {
Ui::ShowMultilineToast({
.text = { u"Premium!"_q },
});
Settings::ShowPremium(session);
});
}
}, box->lifetime());

View File

@@ -22,6 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lottie/lottie_icon.h"
#include "main/main_session.h"
#include "settings/settings_common.h"
#include "settings/settings_premium.h"
#include "ui/chat/chat_style.h"
#include "ui/chat/chat_theme.h"
#include "ui/effects/scroll_content_shadow.h"
@@ -447,9 +448,7 @@ void ReactionsSettingsBox(
button->setClickedCallback([=, emoji = r.emoji] {
if (premium && !controller->session().user()->isPremium()) {
Ui::ShowMultilineToast({
.text = { u"Premium reaction."_q },
});
Settings::ShowPremium(&controller->session());
return;
}
checkButton(button);

View File

@@ -19,6 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/widgets/buttons.h"
#include "ui/widgets/gradient_round_button.h"
#include "ui/wrap/padding_wrap.h"
#include "settings/settings_premium.h"
#include "lottie/lottie_single_player.h"
#include "history/view/media/history_view_sticker.h"
#include "window/window_session_controller.h"
@@ -204,7 +205,7 @@ void StickerBox(
const auto width = size - buttonPadding.left() - buttonPadding.right();
auto button = CreateUnlockButton(box, width);
button->setClickedCallback([=] {
controller->showSettings();
controller->showSettings(Settings::PremiumId());
});
box->addButton(std::move(button));
}