From 06b31b60fe3210d55d978205b1fa302feda5d819 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 12 Jun 2018 12:08:12 +0200 Subject: TextArea, TextField: use the control's renderType in placeholder text The placeholder text's renderType should cohere to the renderType of the control. This is already the case for font, and sometimes color too. This solution avoids the need to expose a new property. Task-number: QTBUG-68769 Change-Id: I6711aea83b7b8ee27f56b9c905aa4870465e3fd9 Reviewed-by: Richard Moe Gustavsen --- src/imports/controls/TextArea.qml | 1 + src/imports/controls/TextField.qml | 1 + src/imports/controls/fusion/TextArea.qml | 1 + src/imports/controls/fusion/TextField.qml | 1 + src/imports/controls/imagine/TextArea.qml | 1 + src/imports/controls/imagine/TextField.qml | 1 + src/imports/controls/material/TextArea.qml | 1 + src/imports/controls/material/TextField.qml | 2 +- src/imports/controls/universal/TextArea.qml | 1 + src/imports/controls/universal/TextField.qml | 1 + 10 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/imports') diff --git a/src/imports/controls/TextArea.qml b/src/imports/controls/TextArea.qml index 04a44eae..86dc7cbf 100644 --- a/src/imports/controls/TextArea.qml +++ b/src/imports/controls/TextArea.qml @@ -70,5 +70,6 @@ T.TextArea { verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight + renderType: control.renderType } } diff --git a/src/imports/controls/TextField.qml b/src/imports/controls/TextField.qml index 4b80d8be..d9b0046d 100644 --- a/src/imports/controls/TextField.qml +++ b/src/imports/controls/TextField.qml @@ -71,6 +71,7 @@ T.TextField { verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight + renderType: control.renderType } background: Rectangle { diff --git a/src/imports/controls/fusion/TextArea.qml b/src/imports/controls/fusion/TextArea.qml index 36d9db04..9165116c 100644 --- a/src/imports/controls/fusion/TextArea.qml +++ b/src/imports/controls/fusion/TextArea.qml @@ -72,5 +72,6 @@ T.TextArea { verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight + renderType: control.renderType } } diff --git a/src/imports/controls/fusion/TextField.qml b/src/imports/controls/fusion/TextField.qml index 2ea5c967..7b8984d2 100644 --- a/src/imports/controls/fusion/TextField.qml +++ b/src/imports/controls/fusion/TextField.qml @@ -72,6 +72,7 @@ T.TextField { verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight + renderType: control.renderType } background: Rectangle { diff --git a/src/imports/controls/imagine/TextArea.qml b/src/imports/controls/imagine/TextArea.qml index 9867a0bd..1e351ab8 100644 --- a/src/imports/controls/imagine/TextArea.qml +++ b/src/imports/controls/imagine/TextArea.qml @@ -74,6 +74,7 @@ T.TextArea { verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight + renderType: control.renderType opacity: 0.5 } diff --git a/src/imports/controls/imagine/TextField.qml b/src/imports/controls/imagine/TextField.qml index 17827b95..1782c1e2 100644 --- a/src/imports/controls/imagine/TextField.qml +++ b/src/imports/controls/imagine/TextField.qml @@ -74,6 +74,7 @@ T.TextField { verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight + renderType: control.renderType opacity: 0.5 } diff --git a/src/imports/controls/material/TextArea.qml b/src/imports/controls/material/TextArea.qml index 2dc64570..207d12c5 100644 --- a/src/imports/controls/material/TextArea.qml +++ b/src/imports/controls/material/TextArea.qml @@ -71,6 +71,7 @@ T.TextArea { color: control.Material.hintTextColor verticalAlignment: control.verticalAlignment elide: Text.ElideRight + renderType: control.renderType visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) } diff --git a/src/imports/controls/material/TextField.qml b/src/imports/controls/material/TextField.qml index 6ce905af..e8af67d4 100644 --- a/src/imports/controls/material/TextField.qml +++ b/src/imports/controls/material/TextField.qml @@ -72,8 +72,8 @@ T.TextField { color: control.Material.hintTextColor verticalAlignment: control.verticalAlignment elide: Text.ElideRight + renderType: control.renderType visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) - } background: Rectangle { diff --git a/src/imports/controls/universal/TextArea.qml b/src/imports/controls/universal/TextArea.qml index 5dc78c80..3e407160 100644 --- a/src/imports/controls/universal/TextArea.qml +++ b/src/imports/controls/universal/TextArea.qml @@ -76,6 +76,7 @@ T.TextArea { visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) verticalAlignment: control.verticalAlignment elide: Text.ElideRight + renderType: control.renderType } background: Rectangle { diff --git a/src/imports/controls/universal/TextField.qml b/src/imports/controls/universal/TextField.qml index f4164fed..0f3084ce 100644 --- a/src/imports/controls/universal/TextField.qml +++ b/src/imports/controls/universal/TextField.qml @@ -77,6 +77,7 @@ T.TextField { visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) verticalAlignment: control.verticalAlignment elide: Text.ElideRight + renderType: control.renderType } background: Rectangle { -- cgit v1.2.3 From 8551dab69a0f4c8248c4eedd7ab650e15a8969f8 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 13 Jun 2018 11:23:09 +0200 Subject: Document which modules are required when building from source There is currently no indication (in the form of build output) that the user is missing a required module when building from source. QTBUG-68826 suggests that such a feature be added, but until then, we need a way to inform users how to build from source. Task-number: QTBUG-68618 Change-Id: Ic17565aeaaff6aaa9907552d3b0c2646b407b425 Reviewed-by: Richard Moe Gustavsen --- src/imports/controls/doc/src/qtquickcontrols2-index.qdoc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/imports') diff --git a/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc index 9b737939..87b170c2 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc @@ -65,6 +65,15 @@ For more details, see \l {Getting Started with Qt Quick Controls 2}. + \section2 Building From Source + + When building from source, ensure that the \l {Qt Graphical Effects} module + is also built, as Qt Quick Controls 2 requires it. + + The \l {Qt Image Formats} module is recommended, but not + required. It provides support for the \c {.webp} format used by the + \l {Animated Images}{Imagine style}. + \section1 Versions Qt Quick Controls 2.0 was introduced in Qt 5.7. Subsequent minor Qt releases -- cgit v1.2.3 From 8b23ea3a5aeb3d8f36825047a313c20a1d54737e Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 8 Jun 2018 10:05:55 +0200 Subject: Imagine: document how to export 9-patch images Task-number: QTBUG-66834 Change-Id: I8a07e114d230361f21dfbf1458210729b3607d92 Reviewed-by: Venugopal Shivashankar --- .../controls/doc/src/qtquickcontrols2-imagine.qdoc | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'src/imports') diff --git a/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc index 8fb5e3b6..7954bf68 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc @@ -2358,6 +2358,60 @@ \image qtquickcontrols2-imagine-9-patch-inset-boundaries.png + \section3 Exporting 9-Patch Images + + Various vector and bitmap editors can be used to create 9-patch images + suitable for use with the Imagine style. The following sections briefly + explain the export process for each editor, and the last section explains + how to ensure the exported images are 9-patch-conformant. + + \section4 Illustrator + + See Adobe's + \l {https://helpx.adobe.com/in/illustrator/using/collect-assets-export-for-screens.html#panel} + {Asset Export panel} documentation. + + \section4 Inkscape + + The \l {https://github.com/mitchcurtis/inkscape-9-patch-export} + {Inkscape 9-Patch Export Extension} can be used to export assets with + Inkscape. + + \section4 Photoshop + + See Adobe's + \l {https://helpx.adobe.com/photoshop/using/generate-assets-layers.html} + {Generate image assets from layers} documentation. + + \section4 Sketch + + See Sketch's \l {https://sketchapp.com/docs/exporting/}{Exporting} documentation. + + Qt Quick Controls 2 also provides a + \l {http://code.qt.io/cgit/qt/qtquickcontrols2.git/tree/src/imports/controls/imagine/design} + {plugin} for Sketch that automatically fixes the thickness of the 9-patch lines + after the assets are exported. To install this file, double-click on it. + Once Sketch has confirmed that the 9-patch export plugin has been installed, + the plugin will automatically process images when they are exported. + + \section4 Fixing 9-Patch Lines + + When exporting 9-patch images in several DPI variants (\c {@2x}, \c {@3x}, + etc.), the 9-patch lines will typically be scaled up along with the image. + There are several ways to fix this, but perhaps the simplest approach is + to use \l {https://www.imagemagick.org/script/mogrify.php}{ImageMagick's mogrify} + tool. The tool has a \c -shave feature that can be used to crop the image + to reduce the thickness of the 9-patch lines: + + \badcode + mogrify -shave 1x1 -path path/to/images *@2x.9.png + mogrify -shave 2x2 -path path/to/images *@3x.9.png + mogrify -shave 3x3 -path path/to/images *@4x.9.png + \endcode + + Regular DPI images (those without the \c @Nx prefix) are not affected, so it + is only necessary to run the command on images intended for high DPI displays. + \section2 Animated Images The \l {https://developers.google.com/speed/webp/}{WebP} and GIF animated -- cgit v1.2.3