aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-09-30 12:32:10 +0200
committerMitch Curtis <mitch.curtis@qt.io>2016-09-30 13:10:17 +0000
commitb749f0041d14234083d150e48d273f08c4b1d253 (patch)
treea78f94953561d43d0eec78275ff32e2ae1e65729
parentbe668040b31488ca8e3d8bad10b6bead2bc74491 (diff)
Button: add GIFs for flat & highlighted docs
This also removes the state table in the detailed description, since we have GIFs now. Change-Id: I4503b67478051eb872f46127da6718092d77d4ff Task-number: QTBUG-55904 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-button-custom.pngbin1294 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-button-disabled.pngbin1569 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-button-flat.gifbin0 -> 2388 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-button-highlighted.gifbin0 -> 1856 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-button.gifbin2171 -> 1863 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-button.pngbin1518 -> 0 bytes
-rw-r--r--src/quicktemplates2/qquickbutton.cpp15
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-button-flat.qml56
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-button-highlighted.qml56
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-button.qml2
-rw-r--r--tests/manual/gifs/tst_gifs.cpp14
11 files changed, 129 insertions, 14 deletions
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-button-custom.png b/src/imports/controls/doc/images/qtquickcontrols2-button-custom.png
deleted file mode 100644
index 5e68ed44..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-button-custom.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-button-disabled.png b/src/imports/controls/doc/images/qtquickcontrols2-button-disabled.png
deleted file mode 100644
index 3375152c..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-button-disabled.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-button-flat.gif b/src/imports/controls/doc/images/qtquickcontrols2-button-flat.gif
new file mode 100644
index 00000000..e2bd8b6f
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-button-flat.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-button-highlighted.gif b/src/imports/controls/doc/images/qtquickcontrols2-button-highlighted.gif
new file mode 100644
index 00000000..7de076d3
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-button-highlighted.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-button.gif b/src/imports/controls/doc/images/qtquickcontrols2-button.gif
index 89dcba31..7f2de718 100644
--- a/src/imports/controls/doc/images/qtquickcontrols2-button.gif
+++ b/src/imports/controls/doc/images/qtquickcontrols2-button.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-button.png b/src/imports/controls/doc/images/qtquickcontrols2-button.png
deleted file mode 100644
index d8a39e55..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-button.png
+++ /dev/null
Binary files differ
diff --git a/src/quicktemplates2/qquickbutton.cpp b/src/quicktemplates2/qquickbutton.cpp
index 901f730d..fc34aba4 100644
--- a/src/quicktemplates2/qquickbutton.cpp
+++ b/src/quicktemplates2/qquickbutton.cpp
@@ -57,17 +57,6 @@ QT_BEGIN_NAMESPACE
a question. Typical buttons are \e OK, \e Apply, \e Cancel, \e Close,
\e Yes, \e No, and \e Help.
- \table
- \row \li \image qtquickcontrols2-button-normal.png
- \li A button in its normal state.
- \row \li \image qtquickcontrols2-button-pressed.png
- \li A button that is pressed.
- \row \li \image qtquickcontrols2-button-focused.png
- \li A button that has active focus.
- \row \li \image qtquickcontrols2-button-disabled.png
- \li A button that is disabled.
- \endtable
-
A button emits the signal \l {AbstractButton::}{clicked()} when it is activated by the user.
Connect to this signal to perform the button's action. Buttons also
provide the signals \l {AbstractButton::}{canceled()}, \l {AbstractButton::}{doubleClicked()}, \l {AbstractButton::}{pressed()},
@@ -160,6 +149,8 @@ QFont QQuickButton::defaultFont() const
This property holds whether the button is highlighted.
+ \image qtquickcontrols2-button-highlighted.gif
+
A button can be highlighted in order to draw the user's attention towards
it. It has no effect on keyboard interaction.
@@ -186,6 +177,8 @@ void QQuickButton::setHighlighted(bool highlighted)
This property holds whether the button is flat.
+ \image qtquickcontrols2-button-flat.gif
+
A flat button typically does not draw a background unless it is pressed or checked.
The default value is \c false.
diff --git a/tests/manual/gifs/data/qtquickcontrols2-button-flat.qml b/tests/manual/gifs/data/qtquickcontrols2-button-flat.qml
new file mode 100644
index 00000000..e20e3bc2
--- /dev/null
+++ b/tests/manual/gifs/data/qtquickcontrols2-button-flat.qml
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.6
+import QtQuick.Window 2.0
+import QtQuick.Controls 2.0
+
+Window {
+ width: button.width
+ height: button.height
+ visible: true
+
+ Button {
+ id: button
+ text: pressed ? "Pressed" : "Button"
+ flat: true
+ anchors.centerIn: parent
+ }
+}
diff --git a/tests/manual/gifs/data/qtquickcontrols2-button-highlighted.qml b/tests/manual/gifs/data/qtquickcontrols2-button-highlighted.qml
new file mode 100644
index 00000000..b031c731
--- /dev/null
+++ b/tests/manual/gifs/data/qtquickcontrols2-button-highlighted.qml
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.6
+import QtQuick.Window 2.0
+import QtQuick.Controls 2.0
+
+Window {
+ width: button.width
+ height: button.height
+ visible: true
+
+ Button {
+ id: button
+ text: pressed ? "Pressed" : "Button"
+ highlighted: true
+ anchors.centerIn: parent
+ }
+}
diff --git a/tests/manual/gifs/data/qtquickcontrols2-button.qml b/tests/manual/gifs/data/qtquickcontrols2-button.qml
index 7ac9f81c..31b8da47 100644
--- a/tests/manual/gifs/data/qtquickcontrols2-button.qml
+++ b/tests/manual/gifs/data/qtquickcontrols2-button.qml
@@ -49,7 +49,7 @@ Window {
Button {
id: button
- text: pressed ? "Pressed" : "Normal"
+ text: pressed ? "Pressed" : "Button"
anchors.centerIn: parent
}
}
diff --git a/tests/manual/gifs/tst_gifs.cpp b/tests/manual/gifs/tst_gifs.cpp
index 24472036..e893d86e 100644
--- a/tests/manual/gifs/tst_gifs.cpp
+++ b/tests/manual/gifs/tst_gifs.cpp
@@ -54,6 +54,7 @@ private slots:
void rangeSlider();
void busyIndicator();
void switchGif();
+ void button_data();
void button();
void tabBar();
void menu();
@@ -325,14 +326,23 @@ void tst_Gifs::switchGif()
gifRecorder.waitForFinish();
}
+void tst_Gifs::button_data()
+{
+ QTest::addColumn<QString>("qmlFileName");
+ QTest::newRow("button") << QString::fromLatin1("qtquickcontrols2-button.qml");
+ QTest::newRow("button-flat") << QString::fromLatin1("qtquickcontrols2-button-flat.qml");
+ QTest::newRow("button-highlighted") << QString::fromLatin1("qtquickcontrols2-button-highlighted.qml");
+}
+
void tst_Gifs::button()
{
+ QFETCH(QString, qmlFileName);
+
GifRecorder gifRecorder;
gifRecorder.setDataDirPath(dataDirPath);
gifRecorder.setOutputDir(outputDir);
gifRecorder.setRecordingDuration(3);
- gifRecorder.setQmlFileName("qtquickcontrols2-button.qml");
- gifRecorder.setHighQuality(true);
+ gifRecorder.setQmlFileName(qmlFileName);
gifRecorder.start();