diff options
| author | Doris Verria <doris.verria@qt.io> | 2025-11-27 17:53:53 +0100 |
|---|---|---|
| committer | Doris Verria <doris.verria@qt.io> | 2025-12-01 13:03:28 +0100 |
| commit | caeaa6bdd10d1d5b2bcd3b59f629583905197267 (patch) | |
| tree | a06bea62a507686de54f428168b858f1509bdb77 /src/labs/stylekit/TextField.qml | |
| parent | 49f14263cd587282f77b0fac761de74483e52485 (diff) | |
Add a fonts property to the style that allows you to set fonts per
control, similarily to what we do in QQuickTheme.
The fonts are propagated from the style to the theme, and from the
fallback style to the style. That means that if a font is not set
for a theme or style, it will be resolved against its fallback font.
Since both the QQStyleKitTheme and QQStyleKitStyle should have a
fonts property, introduce a common base class: QQStyleKitThemeProperties
that contains the fonts property. Later, the palettes can be moved
there as well.
Also add a font property to the QQStyleKitReader that is suposed to
return the font for the current control being read.
Change-Id: I116c1ab9bc426570756476ee409513587c475a0d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/labs/stylekit/TextField.qml')
| -rw-r--r-- | src/labs/stylekit/TextField.qml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/labs/stylekit/TextField.qml b/src/labs/stylekit/TextField.qml index 0cdf31852b..f148b52784 100644 --- a/src/labs/stylekit/TextField.qml +++ b/src/labs/stylekit/TextField.qml @@ -22,6 +22,14 @@ T.TextField { rightPadding: styleReader.rightPadding bottomPadding: styleReader.bottomPadding + // FIXME: Should work when assigned to control.font directly + font.family: styleReader.font.family + font.pointSize: styleReader.font.pointSize + font.weight: styleReader.font.weight + font.italic: styleReader.font.italic + font.underline: styleReader.font.underline + font.bold: styleReader.font.bold + color: styleReader.text.color verticalAlignment: styleReader.text.alignment & Qt.AlignVertical_Mask horizontalAlignment: styleReader.text.alignment & Qt.AlignHorizontal_Mask |
