-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Panel's foreground is inherited to all contained styled labels #562
Comments
There were a few more issues on top of mentioned above that I've found while trying to fix this. One of the issues is that disabled colors from style would not be prioritized anymore if user would set, let's say, a There is also an issue with And there is also an issue with I'm wrapping up with the last fixes right now and hopefully will soon push the fix. |
- ConverterContext.java - New context for passing `ThreadLocal` settings across different XStream converters - ComponentStyleConverter.java - Added `ConverterContext` usage to ensure all subsequent resources read as `UIResource`s when possible - ColorUIResource.java - Added for internal WebLaF usage as `UIResource` for `Color` settings - ColorConverter.java, InsetsConverter.java - Adjusted to account for `ConverterContext` settings - AbstractTextContent.java - Added `ignoreCustomColor` property to allow disabling custom color prioritization in style - AcceleratorText.java, LocaleTextContent.java - These text contents will now prioritize their own color over custom component's - Adjusted all text component styles to ensure that states like `disabled` preserve their custom text color - Added `foreground` property for all base components to ensure it is available and correct - Adjusted all component styles to ensure they have correct foreground values for different skins Menus - StyleId.java, menu.xml, menuitem.xml, checkboxmenuitem.xml, radiobuttonmenuitem.xml - Added base `styled` style for styled text support TabbedPane - TabText.java, TabText.xsd - New custom text content for tabs that uses proper user color fallback to ensure it is accounted for - StyleManager.java - Added annotation processing for `TabText` - tabbedpane.xml - Adjusted to use `TabText` instead of `StyledLabelText` DocumentPane - TabTitleComponent.java - Custom foreground is now only set if not `null` to avoid affecting foreground usage behavior OptionPane - optionpane.xml - Fixed inconsistency between light and dark skins SyntaxArea - WebSyntaxArea.java - Temporary changed default theme initialization and update to adopt to basic skins - WebSyntaxArea.java, SyntaxPreset.java, SyntaxTheme.java - Added `@NotNull` and `@Nullable` annotations Utilities - DocumentEventMethods.java, DocumentEventMethodsImpl.java - Added `@NotNull` annotations DemoApplication - Code and style source areas will now appear dark on the dark skin
I've fixed the main issue and all of the related ones. |
@Sciss mentioned on our discussion on Gitter that whenever
panel
's<foreground>
setting is specified - all styled labels (and some other text components) inherit that foreground color.I already did some investigation and there are multiple reasons that cause such behavior:
AbstractTextContent
only uses it's own color from the style if there is no non-UIResource
color specified in component's foregroundWebStyledLabel
actually doesn't have it's own foreground, it's basicallynull
for itColorUIResource
s but simpleColor
sComponent
:All these reasons together cause the mentioned behavior.
There are a few things that have to be done to fix this and avoid such issues in the future:
Color
s read from style are read asColorUIResource
sThe text was updated successfully, but these errors were encountered: