Derive heap status colors from background and foreground - #4280
Open
vogella wants to merge 1 commit into
Open
Conversation
The control cached hardcoded grays and system colors in fields and overrode setBackground, setForeground and getForeground to keep them in sync, so themes could not restyle it. All colors except the low-memory red and the free-memory orange now derive from the control's own background and foreground.
Contributor
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.
The heap status kept its paint colors in fields, seeded from hardcoded grays and system colors, and overrode
setBackground,setForegroundandgetForegroundto keep those fields in sync. As a result a theme could not restyle the control through the usual means, andgetForegroundreturned a fixed gray rather than the control's actual foreground.All painted colors except the low-memory red and the free-memory orange now derive from the control's own background and foreground, so the standard
background-colorandcolorproperties are all a theme needs to set. The border is drawn as one flat rectangle in the derived color instead of a two-tone bevel built fromCOLOR_WIDGET_HIGHLIGHT_SHADOW.This also drops ten color fields and the three overrides, and lets the widget pick up an inherited background from the trim, which the old fixed
COLOR_WIDGET_BACKGROUNDdefault prevented.