BaseVisualTheme

Interface to a custom visual theme which is able to access and use style hint properties, draw stylistic elements, and even completely override existing class' paint methods (though I'd note that can be a lot harder than it may seem due to the various little details of state you need to reflect visually, so that should be your last result!)

Please note that this is only guaranteed to be used by custom widgets, and custom widgets are generally inferior to system widgets. Layout properties may be used by sytstem widgets though.

You should not inherit from this directly, but instead use VisualTheme.

Members

Functions

defaultFont
OperatingSystemFont defaultFont(int dpi)

If you return null it will use simpledisplay's default. Otherwise, you return what font you want and it will cache it internally.

doPaint
void doPaint(Widget widget, WidgetPainter painter)

Don't implement this, instead use VisualTheme and implement paint methods on specific subclasses you want to override.

getPropertyString
string getPropertyString(Widget widget, string propertyName)

Returns the property as a string, or null if it was not overridden in the style definition. The idea here is something like css, where the interpretation of the string varies for each property and may include things like measurement units.

selectionBackgroundColor
Color selectionBackgroundColor()

Colors used to indicate active selections in lists and text boxes, etc.

selectionForegroundColor
Color selectionForegroundColor()

Colors used to indicate active selections in lists and text boxes, etc.

windowBackgroundColor
Color windowBackgroundColor()

Default background color of the window. Widgets also use this to simulate transparency.

Meta

History

Added May 8, 2021

Suggestion Box / Bug Report