Repository navigation
fix(ui): keep tab label clear of its icon on macOS - #1998
jl-martins wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughProxyStyle adjusts icon and label placement for document-mode tabs with icons when they use the macOS base style. It also returns the adjusted text rectangle for these tabs. Other tabs continue to use the base-style path. ChangesDocument-Mode Tab Icon Layout
Priority: ⬇️ Low Change: Bug fix Merge Risk: ⚪ Minimal · up to The tab-label adjustment is limited to the eligible macOS document-mode tabs, with matching geometry used for painting and text measurement. No actionable merge risk is established. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
5603d81 to
1106afe
Compare
Problem and Solution
#1906 left-aligned browser tab labels by changing the alignment of the centered text in
ProxyStyle::drawItemText(). In document mode, the macOS style places the tab icon next to where the centered text would be, causing the left-aligned label to be drawn over it.For browser tabs on the macOS style, paint the icon at the leading edge in
ProxyStyle. Give the base style an icon-less option narrowed by the icon width plus a 4px gap, the same gap thatQCommonStyleandQMacStyleuse. Return the matchingSE_TabBarTabTextrect fromsubElementRect()so thatQTabBarcuts titles to the width of the label. Other styles are not affected.Before
After
Regular tab
Narrow tabs
Right-to-left (
--reverse)Summary by CodeRabbit