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

Handle GiftCode links, show Gift Link box.

This commit is contained in:
John Preston
2023-09-28 22:44:22 +04:00
parent 3fc9ed0ccb
commit 744c1b925e
15 changed files with 715 additions and 57 deletions

View File

@@ -518,10 +518,10 @@ TopBarUser::TopBarUser(
not_null<Window::SessionController*> controller,
not_null<PeerData*> peer,
rpl::producer<> showFinished)
: TopBarAbstract(parent)
: TopBarAbstract(parent, st::userPremiumCover)
, _content(this)
, _title(_content, st::settingsPremiumUserTitle)
, _about(_content, st::settingsPremiumUserAbout)
, _about(_content, st::userPremiumCover.about)
, _ministars(_content)
, _smallTop({
.widget = object_ptr<Ui::RpWidget>(this),
@@ -1173,6 +1173,7 @@ QPointer<Ui::RpWidget> Premium::createPinnedToTop(
};
return Ui::CreateChild<Ui::Premium::TopBar>(
parent.get(),
st::defaultPremiumCover,
clickContextOther,
std::move(title),
std::move(about));
@@ -1371,6 +1372,24 @@ QPointer<Ui::RpWidget> Premium::createPinnedToBottom(
} // namespace
template <>
struct SectionFactory<Premium> : AbstractSectionFactory {
object_ptr<AbstractSection> create(
not_null<QWidget*> parent,
not_null<Window::SessionController*> controller
) const final override {
return object_ptr<Premium>(parent, controller);
}
bool hasCustomTopBar() const final override {
return true;
}
[[nodiscard]] static const std::shared_ptr<SectionFactory> &Instance() {
static const auto result = std::make_shared<SectionFactory>();
return result;
}
};
Type PremiumId() {
return Premium::Id();
}