diff options
| author | Richard Moe Gustavsen <[email protected]> | 2025-12-05 10:47:36 +0100 |
|---|---|---|
| committer | Richard Moe Gustavsen <[email protected]> | 2025-12-05 12:32:46 +0100 |
| commit | 2bd0f8b4d5c9d79d03b70f970ea064816a8dc2c5 (patch) | |
| tree | e1bd0cf5f5842f92043250f5015260edfc2afb19 /src | |
| parent | 1c646dc674145dd084b60ea4cbe835cf60ac5048 (diff) | |
StyleKit: respect theme palette
A Qt Quick Control will use StyleKitControl.text.color as its
text color. But as it stood, it was not initialized to anything
in the FallbackStyle. The result was that all controls got a black
text color, regardless of what was set in the theme palette. It
would also not respect any palette overrides done from the app.
This patch will make sure that we, by default, bind text.color
for the various control types to the matching color in the
Qt Quick Control's palette. This color will, unless overriden by
the app, be initialized to the color set by the theme.
Change-Id: I6d4f67c81c57c9a30940a720816fa4ed2675b8bd
Reviewed-by: Doris Verria <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/labs/stylekit/impl/FallbackStyle.qml | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/labs/stylekit/impl/FallbackStyle.qml b/src/labs/stylekit/impl/FallbackStyle.qml index 5e57079ac7..a4893b29f0 100644 --- a/src/labs/stylekit/impl/FallbackStyle.qml +++ b/src/labs/stylekit/impl/FallbackStyle.qml @@ -54,6 +54,12 @@ BaseStyle { } } + /* A control’s text color can be customized for different states and variations. + * By default, however, it should remain bound to the control’s palette. Otherwise + * it will fail to respect both the theme palette and any application overrides. */ + control.text.color: palette.buttonText + textInput.text.color: palette.text + textInput { padding: 5 background { |
