Files
AyuGramDesktop/Telegram/SourceFiles/settings/sections/settings_credits.h
T
John Preston 31f3d6810d Upgrade settings_credits to full builder pattern
- Move stats/gift/earn buttons to builder.addButton() with proper IDs
- Use builder.add() for dynamic subscriptions/history lists
- Have setupContent() call build(content, buildMethod)
- Remove extern SectionBuildMethod from header
- Extract BuildCurrencyWithdrawalSection helper function
- Add forward declarations for builder functions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 11:55:20 +04:00

44 lines
946 B
C++

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "base/weak_ptr.h"
#include "settings/settings_type.h"
namespace Api {
class CreditsTopupOptions;
} // namespace Api
namespace Main {
class SessionShow;
} // namespace Main
namespace Settings {
[[nodiscard]] Type CreditsId();
[[nodiscard]] Type CurrencyId();
class BuyStarsHandler final : public base::has_weak_ptr {
public:
BuyStarsHandler();
~BuyStarsHandler();
[[nodiscard]] Fn<void()> handler(
std::shared_ptr<::Main::SessionShow> show,
Fn<void()> paid = nullptr);
[[nodiscard]] rpl::producer<bool> loadingValue() const;
private:
std::unique_ptr<Api::CreditsTopupOptions> _api;
rpl::variable<bool> _loading;
rpl::lifetime _lifetime;
};
} // namespace Settings