Repository navigation
Tabs widget: tab names invisible in the overflow menu until hovered - #4040
Open
amichelotti wants to merge 1 commit into
Open
amichelotti wants to merge 1 commit into
amichelotti wants to merge 1 commit into
Conversation
The tab title was a Label 'graphic' next to a " " tab text, so that the font could be set. When not all tabs fit, the TabPane's overflow menu lists them with a copy of that graphic, which keeps the text but not the color set on the original, so the entries were drawn in the menu's default text color and were only readable on the hover highlight. Use the tab's own text for the title and set font and text color through the tab's style, which the tab label inherits. The overflow menu then shows regular, readable entries.
|
This branch has not been deployed
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.



When a Tabs widget has more tabs than fit, the drop-down list of tabs (the TabPane overflow menu) shows the entries only on the hover highlight: the tab names are drawn in the menu's background color.
Cause
TabsRepresentationputs the tab title in aLabelgraphic, with a" "tab text, so that the font can be set, and colors that label black in code.TabPaneSkinbuilds each overflow menu item from the tab text and a copy of the graphic (TabPaneSkin.clone()), which only carries the label's text, so the entries are drawn with the menu's default text color.Fix
Use the tab's own text for the title, and set the font (
JFXUtil.cssFont) and text color (-fx-text-base-color, used by modena.css for the tab label) through the tab's style, next to the existing-fx-baseshading. The tab label inherits them, so the headers look as before, and the overflow menu gets regular, readable items.Testing
app/display/representation-javafxbuilds and its tests pass.