aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/doc/snippets
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2023-02-15 16:04:33 +0800
committerMitch Curtis <mitch.curtis@qt.io>2023-02-24 10:41:19 +0800
commitd648235777fb4d84afc611c6fa47c15b01f0917a (patch)
treed26c9c8b688a3f4484eb6f38e9b13ada8fcac955 /src/quickcontrols/doc/snippets
parentddcc6c7570cc0c654a9bee50f095ab3bed607650 (diff)
Update style screenshots
- Added iOS screenshots. - Replaced single Fusion screenshot with light and dark screenshots. - Updated Material screenshots. - Added snippet to generate Material attributes screenshot. - Removed "thumbnail" screenshots in favor of individual images joined side-by-side in a \table. They are the same dimensions anyway, and this results in less images to maintain. - Moved duplicated qdoc style table code into a parameterized include file. Fixes: QTBUG-111175 Pick-to: 6.5 Change-Id: Ic828468b050db71d6821a797a6480bd0d449e611 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Diffstat (limited to 'src/quickcontrols/doc/snippets')
-rw-r--r--src/quickcontrols/doc/snippets/qtquickcontrols-material-attributes.qml120
-rw-r--r--src/quickcontrols/doc/snippets/qtquickcontrols-material-variant.qml10
2 files changed, 130 insertions, 0 deletions
diff --git a/src/quickcontrols/doc/snippets/qtquickcontrols-material-attributes.qml b/src/quickcontrols/doc/snippets/qtquickcontrols-material-attributes.qml
new file mode 100644
index 0000000000..3e9d1738e8
--- /dev/null
+++ b/src/quickcontrols/doc/snippets/qtquickcontrols-material-attributes.qml
@@ -0,0 +1,120 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+import QtQuick
+import QtQuick.Controls.Material
+import QtQuick.Shapes
+
+Pane {
+ width: 400
+ height: 300
+
+ Page {
+ anchors.fill: parent
+ anchors.margins: 40
+
+ header: ToolBar {
+ Label {
+ text: "Material"
+ anchors.centerIn: parent
+ }
+ }
+
+ TextField {
+ id: textField
+ text: "TextField"
+ anchors.centerIn: parent
+
+ Component.onCompleted: forceActiveFocus()
+ }
+
+ component Line: Shape {
+ // Account for 1-pixel-wide lines.
+ width: Math.max(1, endX - startX)
+ height: Math.max(1, endY - startY)
+
+ layer.enabled: true
+ layer.samples: 4
+
+ property alias startX: shapePath.startX
+ property alias startY: shapePath.startY
+ property alias endX: pathLine.x
+ property alias endY: pathLine.y
+
+ ShapePath {
+ id: shapePath
+ strokeWidth: 1
+ strokeColor: "#444"
+
+ PathLine {
+ id: pathLine
+ }
+ }
+ }
+ }
+
+ Label {
+ id: primaryLabel
+ x: 40
+ y: 3
+ text: "Primary"
+ }
+ Line {
+ id: primaryLine
+ x: primaryLabel.x + primaryLabel.width / 2
+ y: primaryLabel.y + primaryLabel.height
+ startX: 0.5
+ startY: 0
+ endX: 0.5
+ endY: 40
+ }
+
+ Label {
+ id: foregroundLabel
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: 3
+ text: "Foreground"
+ }
+ Line {
+ id: foregroundLine
+ x: foregroundLabel.x + foregroundLabel.width / 2
+ y: foregroundLabel.y + foregroundLabel.height
+ // Lines are drawn at the center of the pixel.
+ startX: 0.5
+ startY: 0
+ endX: 0.5
+ endY: 34
+ }
+
+ Label {
+ id: accentLabel
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: parent.height * 0.825
+ text: "Accent"
+ }
+ Line {
+ id: accentLine
+ x: accentLabel.x + accentLabel.width / 2
+ y: parent.height * 0.7
+ startX: 0.5
+ startY: 0
+ endX: 0.5
+ endY: 38
+ }
+
+ Label {
+ id: backgroundLabel
+ x: parent.width - width - 10
+ y: parent.height - height - 10
+ text: "Background"
+ }
+ Line {
+ id: backgroundLine
+ x: backgroundLabel.x + backgroundLabel.width / 2
+ y: backgroundLabel.y - height
+ startX: 0.5
+ startY: 0
+ endX: 0.5
+ endY: 40
+ }
+}
diff --git a/src/quickcontrols/doc/snippets/qtquickcontrols-material-variant.qml b/src/quickcontrols/doc/snippets/qtquickcontrols-material-variant.qml
index ad824f1e34..cebd3a4db5 100644
--- a/src/quickcontrols/doc/snippets/qtquickcontrols-material-variant.qml
+++ b/src/quickcontrols/doc/snippets/qtquickcontrols-material-variant.qml
@@ -1,6 +1,16 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+/*
+ This file is used by tst_snippets to generate qtquickcontrols-material-variant-normal.png:
+
+ SCREENSHOTS=1 ./tst_snippets verify:qtquickcontrols-material-variant
+
+ and qtquickcontrols-material-variant-dense.png:
+
+ SCREENSHOTS=1 QT_QUICK_CONTROLS_MATERIAL_VARIANT=Dense ./tst_snippets verify:qtquickcontrols-material-variant
+*/
+
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Material