Fix #1728: fill the active tab so it stands out from the inactive ones - #1807
Open
4RH1T3CT0R7 wants to merge 1 commit into
Open
Fix #1728: fill the active tab so it stands out from the inactive ones#18074RH1T3CT0R7 wants to merge 1 commit into
4RH1T3CT0R7 wants to merge 1 commit into
Conversation
…active ones On the default System theme no app stylesheet is applied, so the .ui sheet is the only thing styling the tabs and the selected tab differs from the rest by nothing but the color of a 1px border: #777777 for every tab, palette(highlight) for the selected one. The fills are byte-identical - measured on Fusion, selected and unselected both render #1E1E1E, a contrast ratio of exactly 1.00. That is the configuration the issue was reported from, and there is no reliable way to tell which tab is open. Give the selected tab the highlight as a fill instead of only as a border outline, with highlighted-text for the label. Both roles come from the palette rather than a literal, and ThemeManager has set Highlight and HighlightedText together for all five built-in themes since 4ae0b20, so the label stays legible on the new fill everywhere - measured 4.6:1 on qdarkstyle up to 9.3:1 on flatgray. The border stays as it was so the tab keeps its geometry and nothing shifts when the selection moves. Applied to all nine tab bars that share this stylesheet, since the issue reports it across the whole app rather than in one dialog. Where the bundled themes ship their own stylesheet the gain is smaller, and on one it is negative: blacksoft draws unselected tabs with a gradient whose top stop is #646464, which is exactly its palette highlight, so the filled tab lands on top of it and separation drops from 1.43 to 1.15. flatgray, lightblue and softpink improve from roughly 1.05 to 1.3; qdarkstyle is a wash at 1.36 to 1.31. Left as-is here rather than special-cased, since the right call on blacksoft is a question for review.
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.
On the default System theme there's no application stylesheet, so
.uiis all that styles the tabs, and the only thing separating the selected tab from the rest is a 1px border color. The fills are the same pixel: on Fusion both come out#1E1E1E, contrast 1.00. That's the setup the issue was reported from.The selected rule now sets
background: palette(highlight)andcolor: palette(highlighted-text), border untouched so nothing shifts as the selection moves. Applied to all nine tab bars, since the report isn't about one dialog.This is the same idea as #1436, which you turned down because palette roles followed the OS light/dark mode rather than the theme. Your 4ae0b20 changed that:
ApplyThemenow installs a full per-theme palette before layering the sheet.One catch. blacksoft draws unselected tabs with a gradient whose top stop is exactly its palette highlight, so it goes from 1.43 to 1.15. I can add
background: palette(button)to the unselected rule (1.55 there), or leave blacksoft on its own sheet. Say which and I'll push it.Closes #1728