Skip to content

Round the Premium action buttons into capsules like the iOS client - #139

Merged
macosswift merged 2 commits into
TelegramMessenger:masterfrom
CraftStick:feat/premium-capsule-buttons
Oct 29, 2026
Merged

macosswift merged 2 commits into
TelegramMessenger:masterfrom
CraftStick:feat/premium-capsule-buttons

Conversation

@CraftStick

@CraftStick CraftStick commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Key change

Round the Premium action buttons into capsules by changing their corner radius from 10 to 20 (half of the 40 pt button height):

  • the subscribe button and the "OK" button of the Telegram Premium window (PremiumBoardingController.swift)
  • the two buttons of the "Show Premium status" window (PremiumShowStatusController.swift)
  • the button of the Premium gift window (PremiumGiftController.swift)
  • the main button and the "OK" button of the Premium limit window (PremiumLimitController.swift); the main button already drew its shimmer as a capsule

Reason

In the Telegram iOS client every action button of the Premium screens is a ButtonComponent in the .glass style (all 9 ButtonComponent.Background instances in submodules/PremiumUI use it), and ButtonComponent draws a glass button as a capsule: the corner radius is availableSize.height * 0.5 unless a custom radius is passed (submodules/TelegramUI/Components/ButtonComponent/Sources/ButtonComponent.swift, lines 756-758). The subscribe button of PremiumIntroScreen uses 26 at a height of 52.

The macOS code already expected capsule buttons here: the shimmer drawn over the subscribe button and over the status window button uses cornerRadius: frame.height / 2, while the button itself had a radius of 10, so the shimmer did not follow the button's corners. The standard macOS modal buttons are capsules as well (acceptView.layer?.cornerRadius = acceptRect.height / 2 in Modal.swift).

All the changed buttons are 40 pt high, so a fixed 20 is exactly half of the height.

Not changed: the speech-bubble limit badge with a tail above the button in the limit window (PremiumLimitController.swift, drawn as an image, not a button) and the gift and period rows (PremiumGiftRowItem, PremiumSelectPeriodRowItem), which are list tiles and need a separate comparison with iOS.

Screenshot/video result (before/after)

The Telegram Premium window with the subscribe button, same account, same window. Left: before (radius 10). Right: after (radius 20). The shimmer moves over the button, so the colour of the button differs slightly between frames; both frames show it at about the same phase.

Before and after: the Premium subscribe button

Confirmation

Tested on macOS 26.7.1 (25G241), Apple M2, with local Debug builds of master at e188309. Both builds also contain the unrelated change of #138 (Stars buttons), which does not touch PremiumUI.

  1. Opened Settings > Telegram Premium on an account without Premium on both builds. Expected: only the corners of the subscribe button differ. Actual: the button is a capsule after the change, everything else is identical.

Testing limitations:

  • Only the subscribe button of the Premium window was checked in the app. The "OK" buttons (shown for subscribers or when Premium is blocked), the two buttons of the status window and the Premium gift button were not opened. They are the same one-line change on buttons of the same height, and I checked their heights in code.

  • Only macOS 26.7.1 was available. No other macOS version, no Intel machine, no dark theme.

  • I built with the Postbox assert in OrderedItemListTable.replaceItems disabled (-assert-config Release), because a Debug build traps on my account at launch on a duplicate recent inline bot entry. This is unrelated to the change.

  • I confirm that I have tested the affected behavior and verified that it works properly, or verified the content and links for a documentation-only change.

@CraftStick

Copy link
Copy Markdown
Contributor Author

Thanks, you are right, that is the main button. Fixed in bc83e8a: the limit window's main button now uses 20 as well, and the description lists it.

@macosswift
macosswift merged commit ea60a3f into TelegramMessenger:master Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants