Repository navigation
Round the Premium action buttons into capsules like the iOS client - #139
Merged
macosswift merged 2 commits intoOct 29, 2026
Merged
macosswift merged 2 commits into
macosswift merged 2 commits into
Conversation
This was referenced Oct 27, 2026
1 task done
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. |
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):
PremiumBoardingController.swift)PremiumShowStatusController.swift)PremiumGiftController.swift)PremiumLimitController.swift); the main button already drew its shimmer as a capsuleReason
In the Telegram iOS client every action button of the Premium screens is a
ButtonComponentin the.glassstyle (all 9ButtonComponent.Backgroundinstances insubmodules/PremiumUIuse it), andButtonComponentdraws a glass button as a capsule: the corner radius isavailableSize.height * 0.5unless a custom radius is passed (submodules/TelegramUI/Components/ButtonComponent/Sources/ButtonComponent.swift, lines 756-758). The subscribe button ofPremiumIntroScreenuses 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 / 2inModal.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.
Confirmation
Tested on macOS 26.7.1 (25G241), Apple M2, with local Debug builds of
masterat e188309. Both builds also contain the unrelated change of #138 (Stars buttons), which does not touchPremiumUI.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
assertinOrderedItemListTable.replaceItemsdisabled (-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.