aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-fusion-palettes.pngbin0 -> 12467 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-fusion-violet.pngbin0 -> 3763 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-fusion.pngbin0 -> 12316 bytes
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-fusion.qdoc93
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-index.qdoc20
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc27
-rw-r--r--src/imports/controls/fusion/ApplicationWindow.qml55
-rw-r--r--src/imports/controls/fusion/BusyIndicator.qml69
-rw-r--r--src/imports/controls/fusion/Button.qml77
-rw-r--r--src/imports/controls/fusion/ButtonPanel.qml77
-rw-r--r--src/imports/controls/fusion/CheckBox.qml75
-rw-r--r--src/imports/controls/fusion/CheckDelegate.qml88
-rw-r--r--src/imports/controls/fusion/CheckIndicator.qml92
-rw-r--r--src/imports/controls/fusion/ComboBox.qml176
-rw-r--r--src/imports/controls/fusion/DelayButton.qml137
-rw-r--r--src/imports/controls/fusion/Dial.qml72
-rw-r--r--src/imports/controls/fusion/Dialog.qml95
-rw-r--r--src/imports/controls/fusion/DialogButtonBox.qml77
-rw-r--r--src/imports/controls/fusion/Drawer.qml82
-rw-r--r--src/imports/controls/fusion/Frame.qml59
-rw-r--r--src/imports/controls/fusion/GroupBox.qml80
-rw-r--r--src/imports/controls/fusion/ItemDelegate.qml78
-rw-r--r--src/imports/controls/fusion/Label.qml49
-rw-r--r--src/imports/controls/fusion/Menu.qml83
-rw-r--r--src/imports/controls/fusion/MenuItem.qml90
-rw-r--r--src/imports/controls/fusion/MenuSeparator.qml59
-rw-r--r--src/imports/controls/fusion/Page.qml62
-rw-r--r--src/imports/controls/fusion/PageIndicator.qml74
-rw-r--r--src/imports/controls/fusion/Pane.qml58
-rw-r--r--src/imports/controls/fusion/Popup.qml62
-rw-r--r--src/imports/controls/fusion/ProgressBar.qml118
-rw-r--r--src/imports/controls/fusion/RadioButton.qml75
-rw-r--r--src/imports/controls/fusion/RadioDelegate.qml88
-rw-r--r--src/imports/controls/fusion/RadioIndicator.qml78
-rw-r--r--src/imports/controls/fusion/RangeSlider.qml82
-rw-r--r--src/imports/controls/fusion/RoundButton.qml102
-rw-r--r--src/imports/controls/fusion/ScrollBar.qml79
-rw-r--r--src/imports/controls/fusion/ScrollIndicator.qml80
-rw-r--r--src/imports/controls/fusion/ScrollView.qml68
-rw-r--r--src/imports/controls/fusion/Slider.qml68
-rw-r--r--src/imports/controls/fusion/SliderGroove.qml94
-rw-r--r--src/imports/controls/fusion/SliderHandle.qml86
-rw-r--r--src/imports/controls/fusion/SpinBox.qml183
-rw-r--r--src/imports/controls/fusion/SwipeDelegate.qml80
-rw-r--r--src/imports/controls/fusion/Switch.qml75
-rw-r--r--src/imports/controls/fusion/SwitchDelegate.qml87
-rw-r--r--src/imports/controls/fusion/SwitchIndicator.qml137
-rw-r--r--src/imports/controls/fusion/TabBar.qml80
-rw-r--r--src/imports/controls/fusion/TabButton.qml110
-rw-r--r--src/imports/controls/fusion/TextArea.qml76
-rw-r--r--src/imports/controls/fusion/TextField.qml103
-rw-r--r--src/imports/controls/fusion/ToolBar.qml85
-rw-r--r--src/imports/controls/fusion/ToolButton.qml77
-rw-r--r--src/imports/controls/fusion/ToolSeparator.qml66
-rw-r--r--src/imports/controls/fusion/ToolTip.qml80
-rw-r--r--src/imports/controls/fusion/Tumbler.qml74
-rw-r--r--src/imports/controls/fusion/fusion.pri65
-rw-r--r--src/imports/controls/fusion/fusion.pro25
-rw-r--r--src/imports/controls/fusion/images/arrow.pngbin0 -> 195 bytes
-rw-r--r--src/imports/controls/fusion/images/arrow.svg75
-rw-r--r--src/imports/controls/fusion/images/arrow@2x.pngbin0 -> 219 bytes
-rw-r--r--src/imports/controls/fusion/images/arrow@3x.pngbin0 -> 245 bytes
-rw-r--r--src/imports/controls/fusion/images/arrow@4x.pngbin0 -> 290 bytes
-rw-r--r--src/imports/controls/fusion/images/checkmark.pngbin0 -> 255 bytes
-rw-r--r--src/imports/controls/fusion/images/checkmark.svg72
-rw-r--r--src/imports/controls/fusion/images/checkmark@2x.pngbin0 -> 390 bytes
-rw-r--r--src/imports/controls/fusion/images/checkmark@3x.pngbin0 -> 494 bytes
-rw-r--r--src/imports/controls/fusion/images/checkmark@4x.pngbin0 -> 556 bytes
-rw-r--r--src/imports/controls/fusion/images/progressmask.pngbin0 -> 383 bytes
-rw-r--r--src/imports/controls/fusion/images/progressmask.svg74
-rw-r--r--src/imports/controls/fusion/images/progressmask@2x.pngbin0 -> 660 bytes
-rw-r--r--src/imports/controls/fusion/images/progressmask@3x.pngbin0 -> 866 bytes
-rw-r--r--src/imports/controls/fusion/images/progressmask@4x.pngbin0 -> 1103 bytes
-rw-r--r--src/imports/controls/fusion/qmldir4
-rw-r--r--src/imports/controls/fusion/qquickfusionbusyindicator.cpp90
-rw-r--r--src/imports/controls/fusion/qquickfusionbusyindicator_p.h75
-rw-r--r--src/imports/controls/fusion/qquickfusiondial.cpp152
-rw-r--r--src/imports/controls/fusion/qquickfusiondial_p.h80
-rw-r--r--src/imports/controls/fusion/qquickfusionknob.cpp99
-rw-r--r--src/imports/controls/fusion/qquickfusionknob_p.h75
-rw-r--r--src/imports/controls/fusion/qquickfusionstyle.cpp172
-rw-r--r--src/imports/controls/fusion/qquickfusionstyle_p.h87
-rw-r--r--src/imports/controls/fusion/qquickfusiontheme.cpp51
-rw-r--r--src/imports/controls/fusion/qquickfusiontheme_p.h67
-rw-r--r--src/imports/controls/fusion/qtquickcontrols2fusionstyle.qrc16
-rw-r--r--src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp121
-rw-r--r--src/imports/imports.pro1
-rw-r--r--src/quickcontrols2/configure.json9
-rw-r--r--tests/auto/controls/controls.pro1
-rw-r--r--tests/auto/controls/fusion/dependencies.qml6
-rw-r--r--tests/auto/controls/fusion/fusion.pro15
-rw-r--r--tests/auto/controls/fusion/tst_fusion.cpp47
-rw-r--r--tests/auto/sanity/tst_sanity.cpp1
-rw-r--r--tests/benchmarks/objectcount/tst_objectcount.cpp1
95 files changed, 5867 insertions, 12 deletions
diff --git a/.gitignore b/.gitignore
index 1de963b0..775a39da 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,6 +30,7 @@
/tests/auto/applicationwindow/tst_applicationwindow
/tests/auto/calendar/tst_calendar
/tests/auto/controls/default/tst_default
+/tests/auto/controls/fusion/tst_fusion
/tests/auto/controls/material/tst_material
/tests/auto/controls/universal/tst_universal
/tests/auto/cursor/tst_cursor
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-fusion-palettes.png b/src/imports/controls/doc/images/qtquickcontrols2-fusion-palettes.png
new file mode 100644
index 00000000..d649e137
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-fusion-palettes.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-fusion-violet.png b/src/imports/controls/doc/images/qtquickcontrols2-fusion-violet.png
new file mode 100644
index 00000000..4186a78f
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-fusion-violet.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-fusion.png b/src/imports/controls/doc/images/qtquickcontrols2-fusion.png
new file mode 100644
index 00000000..037069b5
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-fusion.png
Binary files differ
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-fusion.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-fusion.qdoc
new file mode 100644
index 00000000..d5d6657a
--- /dev/null
+++ b/src/imports/controls/doc/src/qtquickcontrols2-fusion.qdoc
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page qtquickcontrols2-fusion.html
+ \title Fusion Style
+
+ The Fusion style is a desktop-oriented style.
+
+ The Fusion style is a platform-agnostic style that offers a desktop-oriented
+ look'n'feel. It implements the same design language as the \l {Fusion Style Widget Gallery}
+ {Fusion style for Qt Widgets}.
+
+ \image qtquickcontrols2-fusion.png
+
+ To run an application with the Fusion style, see
+ \l {Using Styles in Qt Quick Controls 2}.
+
+ \note The Fusion style is not a native desktop style. The style runs on any
+ platform, and looks similar everywhere. Minor differences may occur due to
+ differences in the standard system palettes, available fonts, and font
+ rendering engines.
+
+ \section2 Customization
+
+ The Fusion style uses the standard system \l {Control::palette}{palettes}
+ to provide colors that match the desktop environment.
+
+ \image qtquickcontrols2-fusion-palettes.png
+
+ Custom palettes can be specified for any \l {Control::palette}{control},
+ \l {Popup::palette}{popup}, or \l {ApplicationWindow::palette}{application window}.
+ Explicit palette attributes are automatically propagated from parent to children,
+ overriding any system defaults for that attribute. In the following example,
+ the window and all three switches appear with a violet highlight color:
+
+ \table
+ \row
+ \li
+ \qml
+ import QtQuick 2.7
+ import QtQuick.Controls 2.3
+
+ ApplicationWindow {
+ visible: true
+
+ palette.highlight: "violet"
+
+ Column {
+ anchors.centerIn: parent
+
+ Switch { text: qsTr("First"); checked: true }
+ Switch { text: qsTr("Second"); checked: true }
+ Switch { text: qsTr("Third") }
+ }
+ }
+ \endqml
+ \li
+ \image qtquickcontrols2-fusion-violet.png
+ \endtable
+
+ \b {See also} \l {Default Style}, \l {Material Style}, \l {Universal Style}
+
+ \section1 Related Information
+
+ \list
+ \li \l{Styling Qt Quick Controls 2}
+ \endlist
+*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc
index 703c5d33..81318cde 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc
@@ -46,21 +46,31 @@
<img src="images/qtquickcontrols2-default.png" alt="Default" width="100%"/>
</a>
</td>
- <td style="border:0px; padding-right:25px;">
+ <td style="border:0px">
<a href="qtquickcontrols2-material.html">
<img src="images/qtquickcontrols2-material.png" alt="Material" width="100%"/>
</a>
</td>
- <td style="border:0px;">
+ </tr>
+ <tr>
+ <td style="border:0px">Default Style</td>
+ <td style="border:0px">Material Style</td>
+ </tr>
+ <tr>
+ <td style="border:0px; padding-top:45px; padding-right:25px;">
+ <a href="qtquickcontrols2-fusion.html">
+ <img src="images/qtquickcontrols2-fusion.png" alt="Fusion" width="100%"/>
+ </a>
+ </td>
+ <td style="border:0px; padding-top:45px; ">
<a href="qtquickcontrols2-universal.html">
<img src="images/qtquickcontrols2-universal.png" alt="Universal" width="100%"/>
</a>
</td>
</tr>
<tr>
- <td style="border:0px">Default</td>
- <td style="border:0px">Material</td>
- <td style="border:0px">Universal</td>
+ <td style="border:0px">Fusion Style</td>
+ <td style="border:0px">Universal Style</td>
</tr>
</table>
\endraw
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc
index 42d8bc62..472b02c9 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc
@@ -34,7 +34,7 @@
\raw HTML
<table style="background:transparent; border:0px">
<tr>
- <td style="border:0px">
+ <td style="border:0px; padding-right:25px">
<a href="qtquickcontrols2-default.html">
<img src="images/qtquickcontrols2-default.png" width="45%"/>
</a>
@@ -44,11 +44,6 @@
<img src="images/qtquickcontrols2-material.png" width="75%"/>
</a>
</td>
- <td style="border:0px">
- <a href="qtquickcontrols2-universal.html">
- <img src="images/qtquickcontrols2-universal.png" width="75%"/>
- </a>
- </td>
</tr>
<tr>
<td style="border:0px">
@@ -61,6 +56,25 @@
based on the <a href="https://www.google.com/design/spec/material-design/introduction.html">
Google Material Design Guidelines</a>, but requires more system resources than the Default style.
</td>
+ </tr>
+ <tr>
+ <td style="border:0px; padding-top:45px; padding-right:25px;">
+ <a href="qtquickcontrols2-fusion.html">
+ <img src="images/qtquickcontrols2-fusion.png" width="75%"/>
+ </a>
+ </td>
+ <td style="border:0px; padding-top:45px;">
+ <a href="qtquickcontrols2-universal.html">
+ <img src="images/qtquickcontrols2-universal.png" width="75%"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="border:0px">
+ The <a href="qtquickcontrols2-fusion.html">Fusion</a> style is
+ a platform-agnostic style that offers a desktop-oriented look'n'feel
+ for Qt Quick Controls 2.
+ </td>
<td style="border:0px">
The <a href="qtquickcontrols2-universal.html">Universal</a> style offers an appealing design
based on the <a href="https://dev.windows.com/design">Microsoft Universal Design Guidelines</a>,
@@ -136,6 +150,7 @@
\section1 Related Information
\list
\li \l {Default Style}
+ \li \l {Fusion Style}
\li \l {Material Style}
\li \l {Universal Style}
\li \l {Using File Selectors with Qt Quick Controls 2}
diff --git a/src/imports/controls/fusion/ApplicationWindow.qml b/src/imports/controls/fusion/ApplicationWindow.qml
new file mode 100644
index 00000000..8ba73b1d
--- /dev/null
+++ b/src/imports/controls/fusion/ApplicationWindow.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Window 2.2
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.ApplicationWindow {
+ id: window
+
+ color: palette.window
+
+ overlay.modal: Rectangle {
+ color: Fusion.topShadow
+ }
+
+ overlay.modeless: Rectangle {
+ color: Fusion.topShadow
+ }
+}
diff --git a/src/imports/controls/fusion/BusyIndicator.qml b/src/imports/controls/fusion/BusyIndicator.qml
new file mode 100644
index 00000000..89c08ca8
--- /dev/null
+++ b/src/imports/controls/fusion/BusyIndicator.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.BusyIndicator {
+ id: control
+
+ implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding
+ implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding
+
+ padding: 6
+
+ contentItem: BusyIndicatorImpl {
+ implicitWidth: 28
+ implicitHeight: 28
+ color: control.palette.text
+
+ opacity: control.running ? 1 : 0
+ visible: control.running || opacityAnimator.running
+ Behavior on opacity { OpacityAnimator { id: opacityAnimator; duration: 250 } }
+
+ RotationAnimator on rotation {
+ running: control.running || opacityAnimator.running
+ from: 0
+ to: 360
+ duration: 1000
+ loops: Animation.Infinite
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/Button.qml b/src/imports/controls/fusion/Button.qml
new file mode 100644
index 00000000..e402d64e
--- /dev/null
+++ b/src/imports/controls/fusion/Button.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.Button {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ padding: 4
+ spacing: 6
+
+ icon.width: 16
+ icon.height: 16
+
+ contentItem: IconLabel {
+ spacing: control.spacing
+ mirrored: control.mirrored
+ display: control.display
+
+ icon: control.icon
+ text: control.text
+ font: control.font
+ color: control.palette.buttonText
+ }
+
+ background: ButtonPanel {
+ implicitWidth: 80
+ implicitHeight: 24
+
+ control: control
+ visible: !control.flat || control.down || control.checked || control.highlighted || control.visualFocus || control.hovered
+ }
+}
diff --git a/src/imports/controls/fusion/ButtonPanel.qml b/src/imports/controls/fusion/ButtonPanel.qml
new file mode 100644
index 00000000..c590756e
--- /dev/null
+++ b/src/imports/controls/fusion/ButtonPanel.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+Rectangle {
+ id: panel
+
+ property Item control
+ property bool highlighted: control.highlighted
+
+ visible: !control.flat || control.down || control.checked
+
+ color: Fusion.buttonColor(control.palette, panel.highlighted, control.down || control.checked, control.hovered)
+ gradient: control.down || control.checked ? null : buttonGradient
+
+ Gradient {
+ id: buttonGradient
+ GradientStop {
+ position: 0
+ color: Fusion.gradientStart(Fusion.buttonColor(control.palette, panel.highlighted, control.down, control.hovered))
+ }
+ GradientStop {
+ position: 1
+ color: Fusion.gradientStop(Fusion.buttonColor(control.palette, panel.highlighted, control.down, control.hovered))
+ }
+ }
+
+ radius: 2
+ border.color: Fusion.buttonOutline(control.palette, panel.highlighted || control.visualFocus, control.enabled)
+
+ Rectangle {
+ x: 1; y: 1
+ width: parent.width - 2
+ height: parent.height - 2
+ border.color: Fusion.innerContrastLine
+ color: "transparent"
+ radius: 2
+ }
+}
diff --git a/src/imports/controls/fusion/CheckBox.qml b/src/imports/controls/fusion/CheckBox.qml
new file mode 100644
index 00000000..235e2efa
--- /dev/null
+++ b/src/imports/controls/fusion/CheckBox.qml
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.CheckBox {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ Math.max(contentItem.implicitHeight,
+ indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ padding: 6
+ spacing: 6
+
+ indicator: CheckIndicator {
+ x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
+ y: control.topPadding + (control.availableHeight - height) / 2
+ control: control
+ }
+
+ contentItem: Text {
+ leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0
+ rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0
+
+ text: control.text
+ font: control.font
+ color: control.palette.windowText
+ elide: Text.ElideRight
+ visible: control.text
+ horizontalAlignment: Text.AlignLeft
+ verticalAlignment: Text.AlignVCenter
+ }
+}
diff --git a/src/imports/controls/fusion/CheckDelegate.qml b/src/imports/controls/fusion/CheckDelegate.qml
new file mode 100644
index 00000000..8841d5bf
--- /dev/null
+++ b/src/imports/controls/fusion/CheckDelegate.qml
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.CheckDelegate {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ Math.max(contentItem.implicitHeight,
+ indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ padding: 6
+ spacing: 6
+
+ icon.width: 16
+ icon.height: 16
+
+ contentItem: IconLabel {
+ leftPadding: control.mirrored ? control.indicator.width + control.spacing : 0
+ rightPadding: !control.mirrored ? control.indicator.width + control.spacing : 0
+
+ spacing: control.spacing
+ mirrored: control.mirrored
+ display: control.display
+ alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft
+
+ icon: control.icon
+ text: control.text
+ font: control.font
+ color: control.highlighted ? Fusion.highlightedText(control.palette) : control.palette.text
+ }
+
+ indicator: CheckIndicator {
+ x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding
+ y: control.topPadding + (control.availableHeight - height) / 2
+
+ control: control
+ }
+
+ background: Rectangle {
+ implicitWidth: 100
+ implicitHeight: 20
+ color: control.down ? Fusion.buttonColor(control.palette, false, true, true)
+ : control.highlighted ? Fusion.highlight(control.palette) : control.palette.base
+ }
+}
diff --git a/src/imports/controls/fusion/CheckIndicator.qml b/src/imports/controls/fusion/CheckIndicator.qml
new file mode 100644
index 00000000..54175205
--- /dev/null
+++ b/src/imports/controls/fusion/CheckIndicator.qml
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+Rectangle {
+ id: indicator
+
+ property Item control
+ readonly property color pressedColor: Fusion.mergedColors(control.palette.base, control.palette.windowText, 85)
+ readonly property color checkMarkColor: Qt.darker(control.palette.text, 1.2)
+
+ implicitWidth: 14
+ implicitHeight: 14
+
+ color: control.down ? indicator.pressedColor : control.palette.base
+ border.color: control.visualFocus ? Fusion.highlightedOutline(control.palette)
+ : Qt.lighter(Fusion.outline(control.palette), 1.1)
+
+ Rectangle {
+ x: 1; y: 1
+ width: parent.width - 2
+ height: 1
+ color: Fusion.topShadow
+ visible: control.enabled && !control.down
+ }
+
+ ColorImage {
+ x: (parent.width - width) / 2
+ y: (parent.height - height) / 2
+ color: Color.transparent(indicator.checkMarkColor, 210 / 255)
+ source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Fusion/images/checkmark.png"
+ visible: control.checkState === Qt.Checked || (control.checked && control.checkState === undefined)
+ }
+
+ Rectangle {
+ x: 3; y: 3
+ width: parent.width - 6
+ height: parent.width - 6
+
+ visible: control.checkState === Qt.PartiallyChecked
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0
+ color: Color.transparent(indicator.checkMarkColor, 80 / 255)
+ }
+ GradientStop {
+ position: 1
+ color: Color.transparent(indicator.checkMarkColor, 140 / 255)
+ }
+ }
+ border.color: Color.transparent(indicator.checkMarkColor, 180 / 255)
+ }
+}
diff --git a/src/imports/controls/fusion/ComboBox.qml b/src/imports/controls/fusion/ComboBox.qml
new file mode 100644
index 00000000..6e02cbc3
--- /dev/null
+++ b/src/imports/controls/fusion/ComboBox.qml
@@ -0,0 +1,176 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.ComboBox {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ Math.max(contentItem.implicitHeight,
+ indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
+ rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
+
+ delegate: MenuItem {
+ width: parent.width
+ text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData
+ highlighted: control.highlightedIndex === index
+ hoverEnabled: control.hoverEnabled
+ }
+
+ indicator: ColorImage {
+ x: control.mirrored ? control.padding : control.width - width - control.padding
+ y: control.topPadding + (control.availableHeight - height) / 2
+ color: control.editable ? control.palette.text : control.palette.buttonText
+ source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Fusion/images/arrow.png"
+ width: 20
+ fillMode: Image.Pad
+ }
+
+ contentItem: T.TextField {
+ topPadding: 4
+ leftPadding: 4 - control.padding
+ rightPadding: 4 - control.padding
+ bottomPadding: 4
+
+ text: control.editable ? control.editText : control.displayText
+
+ enabled: control.editable
+ autoScroll: control.editable
+ readOnly: control.popup.visible
+ inputMethodHints: control.inputMethodHints
+ validator: control.validator
+
+ font: control.font
+ color: control.editable ? control.palette.text : control.palette.buttonText
+ selectionColor: control.palette.highlight
+ selectedTextColor: control.palette.highlightedText
+ horizontalAlignment: Text.AlignLeft
+ verticalAlignment: Text.AlignVCenter
+
+ background: PaddedRectangle {
+ clip: true
+ radius: 2
+ padding: 1
+ leftPadding: control.mirrored ? -2 : padding
+ rightPadding: !control.mirrored ? -2 : padding
+ color: control.palette.base
+ visible: control.editable && !control.flat
+
+ Rectangle {
+ x: parent.width - width
+ y: 1
+ width: 1
+ height: parent.height - 2
+ color: Fusion.buttonOutline(control.palette, control.activeFocus, control.enabled)
+ }
+
+ Rectangle {
+ x: 1
+ y: 1
+ width: parent.width - 3
+ height: 1
+ color: Fusion.topShadow
+ }
+ }
+
+ Rectangle {
+ x: 1 - control.leftPadding
+ y: 1
+ width: control.width - 2
+ height: control.height - 2
+ color: "transparent"
+ border.color: Color.transparent(Fusion.highlightedOutline(control.palette), 40 / 255)
+ visible: control.activeFocus
+ radius: 1.7
+ }
+ }
+
+ background: ButtonPanel {
+ implicitWidth: 120
+ implicitHeight: 24
+
+ control: control
+ visible: !control.flat || control.down
+ // ### TODO: fix control.contentItem.activeFocus
+ highlighted: control.visualFocus || control.contentItem.activeFocus
+ }
+
+ popup: T.Popup {
+ id: popup
+ width: control.width
+ implicitHeight: contentItem.implicitHeight + 2
+ topMargin: 6
+ bottomMargin: 6
+ palette: control.palette
+ padding: 1
+
+ contentItem: ListView {
+ clip: true
+ implicitHeight: contentHeight
+ model: control.popup.visible ? control.delegateModel : null
+ currentIndex: control.highlightedIndex
+ highlightRangeMode: ListView.ApplyRange
+ highlightMoveDuration: 0
+
+ T.ScrollBar.vertical: ScrollBar { }
+ }
+
+ background: Rectangle {
+ color: popup.palette.window
+ border.color: Fusion.outline(control.palette)
+
+ Rectangle {
+ z: -1
+ x: 1; y: 1
+ width: parent.width
+ height: parent.height
+ color: control.palette.shadow
+ opacity: 0.2
+ }
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/DelayButton.qml b/src/imports/controls/fusion/DelayButton.qml
new file mode 100644
index 00000000..db9257e8
--- /dev/null
+++ b/src/imports/controls/fusion/DelayButton.qml
@@ -0,0 +1,137 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.DelayButton {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ padding: 6
+
+ transition: Transition {
+ NumberAnimation {
+ duration: control.delay * (control.pressed ? 1.0 - control.progress : 0.3 * control.progress)
+ }
+ }
+
+ contentItem: Item {
+ implicitWidth: label.implicitWidth
+ implicitHeight: label.implicitHeight
+
+ Item {
+ x: -control.leftPadding + (control.mirrored ? 0 : control.progress * control.width)
+ width: control.width
+ height: parent.height
+
+ clip: control.progress > 0
+ visible: control.mirrored ? control.progress > 0 : control.progress < 1
+
+ Text {
+ id: label
+ x: -parent.x
+ width: control.availableWidth
+ height: parent.height
+
+ text: control.text
+ font: control.font
+ color: control.mirrored ? control.palette.brightText : control.palette.buttonText
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ elide: Text.ElideRight
+ }
+ }
+
+ Item {
+ x: -control.leftPadding
+ width: (control.mirrored ? 1.0 - control.progress : control.progress) * control.width
+ height: parent.height
+
+ clip: control.progress > 0
+ visible: control.mirrored ? control.progress < 1 : control.progress > 0
+
+ Text {
+ x: -parent.x
+ width: control.availableWidth
+ height: parent.height
+
+ text: control.text
+ font: control.font
+ color: control.mirrored ? control.palette.buttonText : control.palette.brightText
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ elide: Text.ElideRight
+ }
+ }
+ }
+
+ background: ButtonPanel {
+ implicitWidth: 80
+ implicitHeight: 24
+
+ control: control
+ highlighted: false
+ scale: control.mirrored ? -1 : 1
+
+ Rectangle {
+ width: control.progress * parent.width
+ height: parent.height
+
+ radius: 2
+ border.color: Qt.darker(Fusion.highlight(control.palette), 1.4)
+ gradient: Gradient {
+ GradientStop {
+ position: 0
+ color: Qt.lighter(Fusion.highlight(control.palette), 1.2)
+ }
+ GradientStop {
+ position: 1
+ color: Fusion.highlight(control.palette)
+ }
+ }
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/Dial.qml b/src/imports/controls/fusion/Dial.qml
new file mode 100644
index 00000000..ec83cccf
--- /dev/null
+++ b/src/imports/controls/fusion/Dial.qml
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.Dial {
+ id: control
+
+ implicitWidth: 100
+ implicitHeight: 100
+
+ background: DialImpl {
+ palette: control.palette
+ highlight: control.visualFocus
+ }
+
+ handle: KnobImpl {
+ x: background.x + background.width / 2 - handle.width / 2
+ y: background.y + background.height / 2 - handle.height / 2
+ width: control.width / 7
+ height: control.height / 7
+ palette: control.palette
+ transform: [
+ Translate {
+ y: -Math.min(background.width, background.height) * 0.42 + handle.height
+ },
+ Rotation {
+ angle: control.angle
+ origin.x: handle.width / 2
+ origin.y: handle.height / 2
+ }
+ ]
+ }
+}
diff --git a/src/imports/controls/fusion/Dialog.qml b/src/imports/controls/fusion/Dialog.qml
new file mode 100644
index 00000000..a0c9ef18
--- /dev/null
+++ b/src/imports/controls/fusion/Dialog.qml
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.Dialog {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ header && header.visible ? header.implicitWidth : 0,
+ footer && footer.visible ? footer.implicitWidth : 0,
+ contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ (header && header.visible ? header.implicitHeight + spacing : 0)
+ + (footer && footer.visible ? footer.implicitHeight + spacing : 0)
+ + (contentHeight > 0 ? contentHeight + topPadding + bottomPadding : 0))
+
+ contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
+ contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
+
+ padding: 6
+
+ background: Rectangle {
+ color: control.palette.window
+ border.color: control.palette.mid
+ radius: 2
+
+ Rectangle {
+ z: -1
+ x: 1; y: 1
+ width: parent.width
+ height: parent.height
+ color: control.palette.shadow
+ opacity: 0.2
+ radius: 2
+ }
+ }
+
+ header: Label {
+ text: control.title
+ visible: control.title
+ elide: Label.ElideRight
+ font.bold: true
+ padding: 6
+ background: Rectangle {
+ x: 1; y: 1
+ width: parent.width - 2
+ height: parent.height - 1
+ color: control.palette.window
+ radius: 2
+ }
+ }
+
+ footer: DialogButtonBox {
+ visible: count > 0
+ }
+}
diff --git a/src/imports/controls/fusion/DialogButtonBox.qml b/src/imports/controls/fusion/DialogButtonBox.qml
new file mode 100644
index 00000000..b4a6afd8
--- /dev/null
+++ b/src/imports/controls/fusion/DialogButtonBox.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.DialogButtonBox {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding + bottomPadding)
+
+ spacing: 6
+ padding: 6
+ alignment: Qt.AlignRight
+
+ delegate: Button { }
+
+ contentItem: ListView {
+ implicitWidth: contentWidth
+ implicitHeight: 24
+
+ model: control.contentModel
+ spacing: control.spacing
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+ snapMode: ListView.SnapToItem
+ }
+
+ background: Rectangle {
+ implicitHeight: 32
+ x: 1; y: 1
+ width: parent.width - 2
+ height: parent.height - 2
+ color: control.palette.window
+ radius: 2
+ }
+}
diff --git a/src/imports/controls/fusion/Drawer.qml b/src/imports/controls/fusion/Drawer.qml
new file mode 100644
index 00000000..4115ec06
--- /dev/null
+++ b/src/imports/controls/fusion/Drawer.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.Drawer {
+ id: control
+
+ parent: T.ApplicationWindow.overlay
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding)
+
+ contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
+ contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
+
+ topPadding: control.edge === Qt.BottomEdge
+ leftPadding: control.edge === Qt.RightEdge
+ rightPadding: control.edge === Qt.LeftEdge
+ bottomPadding: control.edge === Qt.TopEdge
+
+ enter: Transition { SmoothedAnimation { velocity: 5 } }
+ exit: Transition { SmoothedAnimation { velocity: 5 } }
+
+ background: Rectangle {
+ color: control.palette.window
+ readonly property bool horizontal: control.edge === Qt.LeftEdge || control.edge === Qt.RightEdge
+ Rectangle {
+ width: parent.horizontal ? 1 : parent.width
+ height: parent.horizontal ? parent.height : 1
+ color: control.palette.mid
+ x: control.edge === Qt.LeftEdge ? parent.width - 1 : 0
+ y: control.edge === Qt.TopEdge ? parent.height - 1 : 0
+ }
+ Rectangle {
+ width: parent.horizontal ? 1 : parent.width
+ height: parent.horizontal ? parent.height : 1
+ color: control.palette.shadow
+ opacity: 0.2
+ x: control.edge === Qt.LeftEdge ? parent.width : 0
+ y: control.edge === Qt.TopEdge ? parent.height : 0
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/Frame.qml b/src/imports/controls/fusion/Frame.qml
new file mode 100644
index 00000000..b5837baa
--- /dev/null
+++ b/src/imports/controls/fusion/Frame.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.Frame {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding)
+
+ contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
+ contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
+
+ padding: 9
+
+ background: Rectangle {
+ color: "transparent"
+ border.color: Qt.lighter(Fusion.outline(control.palette), 1.08)
+ }
+}
diff --git a/src/imports/controls/fusion/GroupBox.qml b/src/imports/controls/fusion/GroupBox.qml
new file mode 100644
index 00000000..93dc751d
--- /dev/null
+++ b/src/imports/controls/fusion/GroupBox.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.GroupBox {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ label ? label.implicitWidth + leftPadding + rightPadding : 0,
+ contentWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding)
+
+ contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
+ contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
+
+ spacing: 6
+ padding: 9
+ topPadding: padding + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0)
+
+ label: Text {
+ x: control.leftPadding
+ width: control.availableWidth
+
+ text: control.title
+ font: control.font
+ color: control.palette.windowText
+ elide: Text.ElideRight
+ horizontalAlignment: Text.AlignLeft
+ verticalAlignment: Text.AlignVCenter
+ }
+
+ background: Rectangle {
+ y: control.topPadding - control.padding
+ width: parent.width
+ height: parent.height - control.topPadding + control.padding
+
+ radius: 2
+ color: Color.transparent("black", 3 / 255)
+ border.color: Qt.lighter(Fusion.outline(control.palette), 1.08)
+ }
+}
diff --git a/src/imports/controls/fusion/ItemDelegate.qml b/src/imports/controls/fusion/ItemDelegate.qml
new file mode 100644
index 00000000..9a0c0784
--- /dev/null
+++ b/src/imports/controls/fusion/ItemDelegate.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.ItemDelegate {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ Math.max(contentItem.implicitHeight,
+ indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ padding: 6
+ spacing: 6
+
+ icon.width: 16
+ icon.height: 16
+
+ contentItem: IconLabel {
+ spacing: control.spacing
+ mirrored: control.mirrored
+ display: control.display
+ alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft
+
+ icon: control.icon
+ text: control.text
+ font: control.font
+ color: control.highlighted ? Fusion.highlightedText(control.palette) : control.palette.text
+ }
+
+ background: Rectangle {
+ implicitWidth: 100
+ implicitHeight: 20
+ color: control.down ? Fusion.buttonColor(control.palette, false, true, true)
+ : control.highlighted ? Fusion.highlight(control.palette) : control.palette.base
+ }
+}
diff --git a/src/imports/controls/fusion/Label.qml b/src/imports/controls/fusion/Label.qml
new file mode 100644
index 00000000..a4295d1c
--- /dev/null
+++ b/src/imports/controls/fusion/Label.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.Label {
+ id: control
+
+ color: control.palette.windowText
+ linkColor: control.palette.link
+}
diff --git a/src/imports/controls/fusion/Menu.qml b/src/imports/controls/fusion/Menu.qml
new file mode 100644
index 00000000..9343afea
--- /dev/null
+++ b/src/imports/controls/fusion/Menu.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.Menu {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem ? contentItem.implicitWidth + leftPadding + rightPadding : 0)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem ? contentItem.implicitHeight : 0) + topPadding + bottomPadding
+
+ margins: 0
+ padding: 1
+
+ contentItem: ListView {
+ implicitHeight: contentHeight
+ model: control.contentModel
+ // TODO: improve this?
+ interactive: ApplicationWindow.window ? contentHeight > ApplicationWindow.window.height : false
+ clip: true
+ keyNavigationWraps: false
+ currentIndex: -1
+
+ ScrollIndicator.vertical: ScrollIndicator {}
+ }
+
+ background: Rectangle {
+ implicitWidth: 200
+ implicitHeight: 20
+
+ color: control.palette.base
+ border.color: Fusion.outline(control.palette)
+
+ Rectangle {
+ z: -1
+ x: 1; y: 1
+ width: parent.width
+ height: parent.height
+ color: control.palette.shadow
+ opacity: 0.2
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/MenuItem.qml b/src/imports/controls/fusion/MenuItem.qml
new file mode 100644
index 00000000..6cdc8992
--- /dev/null
+++ b/src/imports/controls/fusion/MenuItem.qml
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.MenuItem {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ Math.max(contentItem.implicitHeight,
+ indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ padding: 6
+ spacing: 6
+
+ icon.width: 16
+ icon.height: 16
+
+ contentItem: IconLabel {
+ leftPadding: !control.mirrored ? control.indicator.width + control.spacing : 0
+ rightPadding: control.mirrored ? control.indicator.width + control.spacing : 0
+
+ spacing: control.spacing
+ mirrored: control.mirrored
+ display: control.display
+ alignment: Qt.AlignLeft
+
+ icon: control.icon
+ text: control.text
+ font: control.font
+ color: control.down || control.hovered || control.highlighted ? Fusion.highlightedText(control.palette) : control.palette.text
+ }
+
+ indicator: CheckIndicator {
+ x: control.mirrored ? control.width - width - control.rightPadding : control.leftPadding
+ y: control.topPadding + (control.availableHeight - height) / 2
+
+ control: control
+ visible: control.checkable
+ }
+
+ background: Rectangle {
+ implicitWidth: 200
+ implicitHeight: 20
+
+ color: Fusion.highlight(control.palette)
+ visible: control.down || control.hovered || control.highlighted
+ }
+}
diff --git a/src/imports/controls/fusion/MenuSeparator.qml b/src/imports/controls/fusion/MenuSeparator.qml
new file mode 100644
index 00000000..d15a1015
--- /dev/null
+++ b/src/imports/controls/fusion/MenuSeparator.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.MenuSeparator {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight + topPadding + bottomPadding)
+
+ padding: 5
+ topPadding: 1
+ bottomPadding: 1
+
+ contentItem: Rectangle {
+ implicitWidth: 188
+ implicitHeight: 1
+ color: Qt.lighter(Fusion.darkShade, 1.06)
+ }
+}
diff --git a/src/imports/controls/fusion/Page.qml b/src/imports/controls/fusion/Page.qml
new file mode 100644
index 00000000..501e91cb
--- /dev/null
+++ b/src/imports/controls/fusion/Page.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.Page {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ Math.max(contentWidth,
+ header && header.visible ? header.implicitWidth : 0,
+ footer && footer.visible ? footer.implicitWidth : 0) + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentHeight + topPadding + bottomPadding
+ + (header && header.visible ? header.implicitHeight + spacing : 0)
+ + (footer && footer.visible ? footer.implicitHeight + spacing : 0))
+
+ contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
+ contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
+
+ background: Rectangle {
+ color: palette.window
+ }
+}
diff --git a/src/imports/controls/fusion/PageIndicator.qml b/src/imports/controls/fusion/PageIndicator.qml
new file mode 100644
index 00000000..812bb172
--- /dev/null
+++ b/src/imports/controls/fusion/PageIndicator.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.PageIndicator {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding + bottomPadding)
+
+ padding: 4
+ spacing: 4
+
+ delegate: Rectangle {
+ implicitWidth: 6
+ implicitHeight: 6
+
+ radius: width / 2
+ color: control.palette.shadow
+
+ opacity: index === currentIndex ? 0.95 : pressed ? 0.75 : 0.45
+ Behavior on opacity { OpacityAnimator { duration: 100 } }
+ }
+
+ contentItem: Row {
+ spacing: control.spacing
+
+ Repeater {
+ model: control.count
+ delegate: control.delegate
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/Pane.qml b/src/imports/controls/fusion/Pane.qml
new file mode 100644
index 00000000..683386b8
--- /dev/null
+++ b/src/imports/controls/fusion/Pane.qml
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.Pane {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding)
+
+ contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
+ contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
+
+ padding: 9
+
+ background: Rectangle {
+ color: palette.window
+ }
+}
diff --git a/src/imports/controls/fusion/Popup.qml b/src/imports/controls/fusion/Popup.qml
new file mode 100644
index 00000000..64c9fe49
--- /dev/null
+++ b/src/imports/controls/fusion/Popup.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.Popup {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentHeight > 0 ? contentHeight + topPadding + bottomPadding : 0)
+
+ contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
+ contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
+
+ padding: 6
+
+ background: Rectangle {
+ color: control.palette.window
+ border.color: control.palette.mid
+ radius: 2
+ }
+}
diff --git a/src/imports/controls/fusion/ProgressBar.qml b/src/imports/controls/fusion/ProgressBar.qml
new file mode 100644
index 00000000..55fab03e
--- /dev/null
+++ b/src/imports/controls/fusion/ProgressBar.qml
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.ProgressBar {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem ? contentItem.implicitWidth + leftPadding + rightPadding : 0)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem ? contentItem.implicitHeight + topPadding + bottomPadding : 0)
+
+ contentItem: Item {
+ implicitWidth: 120
+ implicitHeight: 24
+ scale: control.mirrored ? -1 : 1
+
+ Rectangle {
+ height: parent.height
+ width: (control.indeterminate ? 1.0 : control.position) * parent.width
+
+ radius: 2
+ border.color: Qt.darker(Fusion.highlight(control.palette), 1.4)
+ gradient: Gradient {
+ GradientStop {
+ position: 0
+ color: Qt.lighter(Fusion.highlight(control.palette), 1.2)
+ }
+ GradientStop {
+ position: 1
+ color: Fusion.highlight(control.palette)
+ }
+ }
+ }
+
+ Item {
+ x: 1; y: 1
+ width: parent.width - 2
+ height: parent.height - 2
+ visible: control.indeterminate
+ clip: true
+
+ ColorImage {
+ id: mask
+ width: Math.ceil(parent.width / implicitWidth + 1) * implicitWidth
+ height: parent.height
+
+ mirror: control.mirrored
+ fillMode: Image.TileHorizontally
+ source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Fusion/images/progressmask.png"
+ color: Color.transparent(Qt.lighter(Fusion.highlight(control.palette), 1.2), 160 / 255)
+
+ visible: control.indeterminate
+ NumberAnimation on x {
+ running: control.indeterminate && control.visible
+ from: -mask.implicitWidth
+ to: 0
+ loops: Animation.Infinite
+ duration: 750
+ }
+ }
+ }
+ }
+
+ background: Rectangle {
+ implicitWidth: 120
+ implicitHeight: 24
+
+ radius: 2
+ color: control.palette.base
+ border.color: Fusion.outline(control.palette)
+
+ Rectangle {
+ x: 1; y: 1; height: 1
+ width: parent.width - 2
+ color: Fusion.topShadow
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/RadioButton.qml b/src/imports/controls/fusion/RadioButton.qml
new file mode 100644
index 00000000..cf4040f3
--- /dev/null
+++ b/src/imports/controls/fusion/RadioButton.qml
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.RadioButton {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ Math.max(contentItem.implicitHeight,
+ indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ padding: 6
+ spacing: 6
+
+ indicator: RadioIndicator {
+ x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
+ y: control.topPadding + (control.availableHeight - height) / 2
+ control: control
+ }
+
+ contentItem: Text {
+ leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0
+ rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0
+
+ text: control.text
+ font: control.font
+ color: control.palette.windowText
+ elide: Text.ElideRight
+ visible: control.text
+ horizontalAlignment: Text.AlignLeft
+ verticalAlignment: Text.AlignVCenter
+ }
+}
diff --git a/src/imports/controls/fusion/RadioDelegate.qml b/src/imports/controls/fusion/RadioDelegate.qml
new file mode 100644
index 00000000..8d66d22e
--- /dev/null
+++ b/src/imports/controls/fusion/RadioDelegate.qml
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.RadioDelegate {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ Math.max(contentItem.implicitHeight,
+ indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ padding: 6
+ spacing: 6
+
+ icon.width: 16
+ icon.height: 16
+
+ contentItem: IconLabel {
+ leftPadding: control.mirrored ? control.indicator.width + control.spacing : 0
+ rightPadding: !control.mirrored ? control.indicator.width + control.spacing : 0
+
+ spacing: control.spacing
+ mirrored: control.mirrored
+ display: control.display
+ alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft
+
+ icon: control.icon
+ text: control.text
+ font: control.font
+ color: control.highlighted ? Fusion.highlightedText(control.palette) : control.palette.text
+ }
+
+ indicator: RadioIndicator {
+ x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding
+ y: control.topPadding + (control.availableHeight - height) / 2
+
+ control: control
+ }
+
+ background: Rectangle {
+ implicitWidth: 100
+ implicitHeight: 20
+ color: control.down ? Fusion.buttonColor(control.palette, false, true, true)
+ : control.highlighted ? Fusion.highlight(control.palette) : control.palette.base
+ }
+}
diff --git a/src/imports/controls/fusion/RadioIndicator.qml b/src/imports/controls/fusion/RadioIndicator.qml
new file mode 100644
index 00000000..a3c9ecd0
--- /dev/null
+++ b/src/imports/controls/fusion/RadioIndicator.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+Rectangle {
+ id: indicator
+
+ property Item control
+ readonly property color pressedColor: Fusion.mergedColors(control.palette.base, control.palette.windowText, 85)
+ readonly property color checkMarkColor: Qt.darker(control.palette.text, 1.2)
+
+ implicitWidth: 14
+ implicitHeight: 14
+
+ radius: width / 2
+ color: control.down ? indicator.pressedColor : control.palette.base
+ border.color: control.visualFocus ? Fusion.highlightedOutline(control.palette)
+ : Qt.darker(control.palette.window, 1.5)
+
+ Rectangle {
+ y: 1
+ width: parent.width
+ height: parent.height - 1
+ radius: width / 2
+ color: "transparent"
+ border.color: Fusion.topShadow
+ visible: control.enabled && !control.down
+ }
+
+ Rectangle {
+ x: (parent.width - width) / 2
+ y: (parent.height - height) / 2
+ width: parent.width / 2.32
+ height: parent.height / 2.32
+ radius: width / 2
+ color: Color.transparent(indicator.checkMarkColor, 180 / 255)
+ border.color: Color.transparent(indicator.checkMarkColor, 200 / 255)
+ visible: control.checked
+ }
+}
diff --git a/src/imports/controls/fusion/RangeSlider.qml b/src/imports/controls/fusion/RangeSlider.qml
new file mode 100644
index 00000000..ea9975e8
--- /dev/null
+++ b/src/imports/controls/fusion/RangeSlider.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.RangeSlider {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ Math.max(first.handle ? first.handle.implicitWidth : 0,
+ second.handle ? second.handle.implicitWidth : 0) + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ Math.max(first.handle ? first.handle.implicitHeight : 0,
+ second.handle ? second.handle.implicitHeight : 0) + topPadding + bottomPadding)
+
+ first.handle: SliderHandle {
+ x: control.leftPadding + Math.round(control.horizontal ? control.first.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2)
+ y: control.topPadding + Math.round(control.horizontal ? (control.availableHeight - height) / 2 : control.first.visualPosition * (control.availableHeight - height))
+
+ palette: control.palette
+ pressed: control.first.pressed
+ hovered: control.first.hovered
+ vertical: control.vertical
+ visualFocus: activeFocus
+ }
+
+ second.handle: SliderHandle {
+ x: control.leftPadding + Math.round(control.horizontal ? control.second.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2)
+ y: control.topPadding + Math.round(control.horizontal ? (control.availableHeight - height) / 2 : control.second.visualPosition * (control.availableHeight - height))
+
+ palette: control.palette
+ pressed: control.second.pressed
+ hovered: control.second.hovered
+ vertical: control.vertical
+ visualFocus: activeFocus
+ }
+
+ background: SliderGroove {
+ control: control
+ offset: control.first.position
+ progress: control.second.position
+ visualProgress: control.second.visualPosition
+ }
+}
diff --git a/src/imports/controls/fusion/RoundButton.qml b/src/imports/controls/fusion/RoundButton.qml
new file mode 100644
index 00000000..c17fd72c
--- /dev/null
+++ b/src/imports/controls/fusion/RoundButton.qml
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.RoundButton {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ padding: 6
+ spacing: 6
+
+ icon.width: 16
+ icon.height: 16
+
+ contentItem: IconLabel {
+ spacing: control.spacing
+ mirrored: control.mirrored
+ display: control.display
+
+ icon: control.icon
+ text: control.text
+ font: control.font
+ color: control.palette.buttonText
+ }
+
+ background: Rectangle {
+ implicitWidth: 32
+ implicitHeight: 32
+ visible: !control.flat || control.down || control.checked
+
+ color: Fusion.buttonColor(control.palette, control.highlighted, control.down || control.checked, control.hovered)
+ gradient: control.down || control.checked ? null : buttonGradient
+
+ Gradient {
+ id: buttonGradient
+ GradientStop {
+ position: 0
+ color: Fusion.gradientStart(Fusion.buttonColor(control.palette, control.highlighted, control.down, control.hovered))
+ }
+ GradientStop {
+ position: 1
+ color: Fusion.gradientStop(Fusion.buttonColor(control.palette, control.highlighted, control.down, control.hovered))
+ }
+ }
+
+ radius: control.radius
+ border.color: Fusion.buttonOutline(control.palette, control.highlighted || control.visualFocus, control.enabled)
+
+ Rectangle {
+ x: 1; y: 1
+ width: parent.width - 2
+ height: parent.height - 2
+ border.color: Fusion.innerContrastLine
+ color: "transparent"
+ radius: control.radius
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/ScrollBar.qml b/src/imports/controls/fusion/ScrollBar.qml
new file mode 100644
index 00000000..071f362d
--- /dev/null
+++ b/src/imports/controls/fusion/ScrollBar.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.ScrollBar {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding + bottomPadding)
+
+ padding: 2
+ visible: control.policy !== T.ScrollBar.AlwaysOff
+
+ contentItem: Rectangle {
+ id: handle
+
+ implicitWidth: control.interactive ? 6 : 2
+ implicitHeight: control.interactive ? 6 : 2
+
+ radius: width / 2
+ color: control.pressed ? control.palette.dark : control.palette.mid
+ opacity: 0.0
+
+ states: State {
+ name: "active"
+ when: control.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0)
+ PropertyChanges { target: handle; opacity: 0.75 }
+ }
+
+ transitions: Transition {
+ from: "active"
+ SequentialAnimation {
+ PauseAnimation { duration: 450 }
+ NumberAnimation { target: handle; duration: 200; property: "opacity"; to: 0.0 }
+ }
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/ScrollIndicator.qml b/src/imports/controls/fusion/ScrollIndicator.qml
new file mode 100644
index 00000000..a23687ab
--- /dev/null
+++ b/src/imports/controls/fusion/ScrollIndicator.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.ScrollIndicator {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding + bottomPadding)
+
+ padding: 2
+
+ contentItem: Rectangle {
+ id: indicator
+
+ implicitWidth: 2
+ implicitHeight: 2
+
+ color: control.palette.mid
+ visible: control.size < 1.0
+ opacity: 0.0
+
+ states: State {
+ name: "active"
+ when: control.active
+ PropertyChanges { target: indicator; opacity: 0.75 }
+ }
+
+ transitions: [
+ Transition {
+ from: "active"
+ SequentialAnimation {
+ PauseAnimation { duration: 450 }
+ NumberAnimation { target: indicator; duration: 200; property: "opacity"; to: 0.0 }
+ }
+ }
+ ]
+ }
+}
diff --git a/src/imports/controls/fusion/ScrollView.qml b/src/imports/controls/fusion/ScrollView.qml
new file mode 100644
index 00000000..d38e4537
--- /dev/null
+++ b/src/imports/controls/fusion/ScrollView.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.ScrollView {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding)
+
+ contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : -1)
+ contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : -1)
+
+ ScrollBar.vertical: ScrollBar {
+ parent: control
+ x: control.mirrored ? 0 : control.width - width
+ y: control.topPadding
+ height: control.availableHeight
+ active: control.ScrollBar.horizontal.active
+ }
+
+ ScrollBar.horizontal: ScrollBar {
+ parent: control
+ x: control.leftPadding
+ y: control.height - height
+ width: control.availableWidth
+ active: control.ScrollBar.vertical.active
+ }
+}
diff --git a/src/imports/controls/fusion/Slider.qml b/src/imports/controls/fusion/Slider.qml
new file mode 100644
index 00000000..37a3ef14
--- /dev/null
+++ b/src/imports/controls/fusion/Slider.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.Slider {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ (handle ? handle.implicitWidth : 0) + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ (handle ? handle.implicitHeight : 0) + topPadding + bottomPadding)
+
+ handle: SliderHandle {
+ x: control.leftPadding + Math.round(control.horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2)
+ y: control.topPadding + Math.round(control.horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height))
+
+ palette: control.palette
+ pressed: control.pressed
+ hovered: control.hovered
+ vertical: control.vertical
+ visualFocus: control.visualFocus
+ }
+
+ background: SliderGroove {
+ control: control
+ progress: control.position
+ visualProgress: control.visualPosition
+ }
+}
diff --git a/src/imports/controls/fusion/SliderGroove.qml b/src/imports/controls/fusion/SliderGroove.qml
new file mode 100644
index 00000000..c243ccc3
--- /dev/null
+++ b/src/imports/controls/fusion/SliderGroove.qml
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+Rectangle {
+ id: groove
+
+ property Item control
+ property real offset
+ property real progress
+ property real visualProgress
+
+ x: control.horizontal ? 0 : (control.availableWidth - width) / 2
+ y: control.horizontal ? (control.availableHeight - height) / 2 : 0
+
+ implicitWidth: control.horizontal ? 160 : 5
+ implicitHeight: control.horizontal ? 5 : 160
+ width: control.horizontal ? control.availableWidth : implicitWidth
+ height: control.horizontal ? implicitHeight : control.availableHeight
+
+ radius: 2
+ border.color: Fusion.outline(control.palette)
+ scale: control.horizontal && control.mirrored ? -1 : 1
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0
+ color: Qt.darker(Fusion.grooveColor(control.palette), 1.1)
+ }
+ GradientStop {
+ position: 1
+ color: Qt.lighter(Fusion.grooveColor(control.palette), 1.1)
+ }
+ }
+
+ Rectangle {
+ x: control.horizontal ? groove.offset * parent.width : 0
+ y: control.horizontal ? 0 : groove.visualProgress * parent.height
+ width: control.horizontal ? groove.progress * parent.width - groove.offset * parent.width : 5
+ height: control.horizontal ? 5 : groove.progress * parent.height - groove.offset * parent.height
+
+ radius: 2
+ border.color: Qt.darker(Fusion.highlightedOutline(control.palette), 1.1)
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0
+ color: Fusion.highlight(control.palette)
+ }
+ GradientStop {
+ position: 1
+ color: Qt.lighter(Fusion.highlight(control.palette), 1.2)
+ }
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/SliderHandle.qml b/src/imports/controls/fusion/SliderHandle.qml
new file mode 100644
index 00000000..71aff706
--- /dev/null
+++ b/src/imports/controls/fusion/SliderHandle.qml
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+Rectangle {
+ id: handle
+
+ property var palette
+ property bool pressed
+ property bool hovered
+ property bool vertical
+ property bool visualFocus
+
+ implicitWidth: 13
+ implicitHeight: 13
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0
+ color: Fusion.gradientStart(Fusion.buttonColor(handle.palette, handle.visualFocus, handle.pressed, handle.hovered))
+ }
+ GradientStop {
+ position: 1
+ color: Fusion.gradientStop(Fusion.buttonColor(handle.palette, handle.visualFocus, handle.pressed, handle.hovered))
+ }
+ }
+ rotation: handle.vertical ? -90 : 0
+ border.width: 1
+ border.color: "transparent"
+ radius: 2
+
+ Rectangle {
+ width: parent.width
+ height: parent.height
+ border.color: handle.visualFocus ? Fusion.highlightedOutline(handle.palette) : Fusion.outline(handle.palette)
+ color: "transparent"
+ radius: 2
+
+ Rectangle {
+ x: 1; y: 1
+ width: parent.width - 2
+ height: parent.height - 2
+ border.color: Fusion.innerContrastLine
+ color: "transparent"
+ radius: 2
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/SpinBox.qml b/src/imports/controls/fusion/SpinBox.qml
new file mode 100644
index 00000000..ce11d244
--- /dev/null
+++ b/src/imports/controls/fusion/SpinBox.qml
@@ -0,0 +1,183 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.SpinBox {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + 2 * padding +
+ Math.max(up.indicator ? up.indicator.implicitWidth : 0,
+ down.indicator ? down.indicator.implicitWidth : 0))
+ implicitHeight: Math.max(contentItem.implicitHeight + topPadding + bottomPadding,
+ background ? background.implicitHeight : 0,
+ (up.indicator ? up.indicator.implicitHeight : 0 +
+ down.indicator ? down.indicator.implicitHeight : 0))
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ padding: 4
+ leftPadding: padding + (control.mirrored ? (up.indicator ? up.indicator.width : 0) : (down.indicator ? down.indicator.width : 0))
+ rightPadding: padding + (control.mirrored ? (down.indicator ? down.indicator.width : 0) : (up.indicator ? up.indicator.width : 0))
+
+ validator: IntValidator {
+ locale: control.locale.name
+ bottom: Math.min(control.from, control.to)
+ top: Math.max(control.from, control.to)
+ }
+
+ contentItem: TextInput {
+ z: 2
+ text: control.textFromValue(control.value, control.locale)
+
+ font: control.font
+ color: control.palette.text
+ selectionColor: control.palette.highlight
+ selectedTextColor: control.palette.highlightedText
+ horizontalAlignment: Qt.AlignHCenter
+ verticalAlignment: Qt.AlignVCenter
+
+ readOnly: !control.editable
+ validator: control.validator
+ inputMethodHints: control.inputMethodHints
+ }
+
+ up.indicator: PaddedRectangle {
+ x: control.mirrored ? 1 : parent.width - width - 1
+ y: 1
+ height: parent.height / 2 - 1
+ implicitWidth: 16
+ implicitHeight: 10
+
+ radius: 1.7
+ clip: true
+ topPadding: -2
+ leftPadding: -2
+ color: control.up.pressed ? Fusion.buttonColor(control.palette, false, true, true) : "transparent"
+
+ ColorImage {
+ scale: -1
+ width: parent.width
+ height: parent.height
+ opacity: enabled ? 1.0 : 0.5
+ color: control.palette.buttonText
+ source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Fusion/images/arrow.png"
+ fillMode: Image.Pad
+ }
+ }
+
+ down.indicator: PaddedRectangle {
+ x: control.mirrored ? 1 : parent.width - width - 1
+ y: parent.height - height - 1
+ height: parent.height / 2 - 1
+ implicitWidth: 16
+ implicitHeight: 10
+
+ radius: 1.7
+ clip: true
+ topPadding: -2
+ leftPadding: -2
+ color: control.down.pressed ? Fusion.buttonColor(control.palette, false, true, true) : "transparent"
+
+ ColorImage {
+ width: parent.width
+ height: parent.height
+ opacity: enabled ? 1.0 : 0.5
+ color: control.palette.buttonText
+ source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Fusion/images/arrow.png"
+ fillMode: Image.Pad
+ }
+ }
+
+ background: Rectangle {
+ implicitWidth: 120
+ implicitHeight: 24
+
+ radius: 2
+ color: control.palette.base
+ border.color: control.activeFocus ? Fusion.highlightedOutline(control.palette) : Fusion.outline(control.palette)
+
+ Rectangle {
+ x: 2
+ y: 1
+ width: parent.width - 4
+ height: 1
+ color: Fusion.topShadow
+ }
+
+ Rectangle {
+ x: control.mirrored ? 1 : parent.width - width - 1
+ y: 1
+ width: Math.max(up.indicator ? up.indicator.width : 0,
+ down.indicator ? down.indicator.width : 0) + 1
+ height: parent.height - 2
+
+ radius: 2
+ gradient: Gradient {
+ GradientStop {
+ position: 0
+ color: Fusion.gradientStart(Fusion.buttonColor(control.palette, control.visualFocus, false, control.up.hovered || control.down.hovered))
+ }
+ GradientStop {
+ position: 1
+ color: Fusion.gradientStop(Fusion.buttonColor(control.palette, control.visualFocus, false, control.up.hovered || control.down.hovered))
+ }
+ }
+
+ Rectangle {
+ x: control.mirrored ? parent.width - 1 : 0
+ height: parent.height
+ width: 1
+ color: Fusion.outline(control.palette)
+ }
+ }
+
+ Rectangle {
+ x: 1; y: 1
+ width: parent.width - 2
+ height: parent.height - 2
+ color: "transparent"
+ border.color: Color.transparent(Fusion.highlightedOutline(control.palette), 40 / 255)
+ visible: control.activeFocus
+ radius: 1.7
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/SwipeDelegate.qml b/src/imports/controls/fusion/SwipeDelegate.qml
new file mode 100644
index 00000000..f279963b
--- /dev/null
+++ b/src/imports/controls/fusion/SwipeDelegate.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.SwipeDelegate {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ Math.max(contentItem.implicitHeight,
+ indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ padding: 6
+ spacing: 6
+
+ icon.width: 16
+ icon.height: 16
+
+ swipe.transition: Transition { SmoothedAnimation { velocity: 3; easing.type: Easing.InOutCubic } }
+
+ contentItem: IconLabel {
+ spacing: control.spacing
+ mirrored: control.mirrored
+ display: control.display
+ alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft
+
+ icon: control.icon
+ text: control.text
+ font: control.font
+ color: control.highlighted ? Fusion.highlightedText(control.palette) : control.palette.text
+ }
+
+ background: Rectangle {
+ implicitWidth: 100
+ implicitHeight: 20
+ color: control.down ? Fusion.buttonColor(control.palette, false, true, true)
+ : control.highlighted ? Fusion.highlight(control.palette) : control.palette.base
+ }
+}
diff --git a/src/imports/controls/fusion/Switch.qml b/src/imports/controls/fusion/Switch.qml
new file mode 100644
index 00000000..3bb7607d
--- /dev/null
+++ b/src/imports/controls/fusion/Switch.qml
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.Switch {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ Math.max(contentItem.implicitHeight,
+ indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ padding: 6
+ spacing: 6
+
+ indicator: SwitchIndicator {
+ x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
+ y: control.topPadding + (control.availableHeight - height) / 2
+ control: control
+ }
+
+ contentItem: Text {
+ leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0
+ rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0
+
+ text: control.text
+ font: control.font
+ color: control.palette.text
+ elide: Text.ElideRight
+ visible: control.text
+ horizontalAlignment: Text.AlignLeft
+ verticalAlignment: Text.AlignVCenter
+ }
+}
diff --git a/src/imports/controls/fusion/SwitchDelegate.qml b/src/imports/controls/fusion/SwitchDelegate.qml
new file mode 100644
index 00000000..fde4b38f
--- /dev/null
+++ b/src/imports/controls/fusion/SwitchDelegate.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.SwitchDelegate {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ Math.max(contentItem.implicitHeight,
+ indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ padding: 6
+ spacing: 6
+
+ icon.width: 16
+ icon.height: 16
+
+ indicator: SwitchIndicator {
+ x: text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2
+ y: control.topPadding + (control.availableHeight - height) / 2
+ control: control
+ }
+
+ contentItem: IconLabel {
+ leftPadding: control.mirrored ? control.indicator.width + control.spacing : 0
+ rightPadding: !control.mirrored ? control.indicator.width + control.spacing : 0
+
+ spacing: control.spacing
+ mirrored: control.mirrored
+ display: control.display
+ alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft
+
+ icon: control.icon
+ text: control.text
+ font: control.font
+ color: control.highlighted ? Fusion.highlightedText(control.palette) : control.palette.text
+ }
+
+ background: Rectangle {
+ implicitWidth: 100
+ implicitHeight: 20
+ color: control.down ? Fusion.buttonColor(control.palette, false, true, true)
+ : control.highlighted ? Fusion.highlight(control.palette) : control.palette.base
+ }
+}
diff --git a/src/imports/controls/fusion/SwitchIndicator.qml b/src/imports/controls/fusion/SwitchIndicator.qml
new file mode 100644
index 00000000..a674afe4
--- /dev/null
+++ b/src/imports/controls/fusion/SwitchIndicator.qml
@@ -0,0 +1,137 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+Rectangle {
+ id: indicator
+
+ property Item control
+ readonly property color pressedColor: Fusion.mergedColors(control.palette.base, control.palette.windowText, 85)
+ readonly property color checkMarkColor: Qt.darker(control.palette.text, 1.2)
+
+ implicitWidth: 40
+ implicitHeight: 16
+
+ radius: 2
+ border.color: Fusion.outline(control.palette)
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0
+ color: Qt.darker(Fusion.grooveColor(control.palette), 1.1)
+ }
+ GradientStop {
+ position: 1
+ color: Qt.lighter(Fusion.grooveColor(control.palette), 1.1)
+ }
+ }
+
+ Rectangle {
+ x: control.mirrored ? handle.x : 0
+ width: control.mirrored ? parent.width - handle.x : handle.x + handle.width
+ height: parent.height
+
+ opacity: control.checked ? 1 : 0
+ Behavior on opacity {
+ enabled: !control.down
+ NumberAnimation { duration: 80 }
+ }
+
+ radius: 2
+ border.color: Qt.darker(Fusion.highlightedOutline(control.palette), 1.1)
+ border.width: control.enabled ? 1 : 0
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0
+ color: Fusion.highlight(control.palette)
+ }
+ GradientStop {
+ position: 1
+ color: Qt.lighter(Fusion.highlight(control.palette), 1.2)
+ }
+ }
+ }
+
+ Rectangle {
+ id: handle
+ x: Math.max(0, Math.min(parent.width - width, control.visualPosition * parent.width - (width / 2)))
+ y: (parent.height - height) / 2
+ width: 20
+ height: 16
+ radius: 2
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0
+ color: Fusion.gradientStart(Fusion.buttonColor(control.palette, control.visualFocus, control.pressed, control.hovered))
+ }
+ GradientStop {
+ position: 1
+ color: Fusion.gradientStop(Fusion.buttonColor(control.palette, control.visualFocus, control.pressed, control.hovered))
+ }
+ }
+ border.width: 1
+ border.color: "transparent"
+
+ Rectangle {
+ width: parent.width
+ height: parent.height
+ border.color: control.visualFocus ? Fusion.highlightedOutline(control.palette) : Fusion.outline(control.palette)
+ color: "transparent"
+ radius: 2
+
+ Rectangle {
+ x: 1; y: 1
+ width: parent.width - 2
+ height: parent.height - 2
+ border.color: Fusion.innerContrastLine
+ color: "transparent"
+ radius: 2
+ }
+ }
+
+ Behavior on x {
+ enabled: !control.down
+ SmoothedAnimation { velocity: 200 }
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/TabBar.qml b/src/imports/controls/fusion/TabBar.qml
new file mode 100644
index 00000000..d28c55e4
--- /dev/null
+++ b/src/imports/controls/fusion/TabBar.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.TabBar {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentHeight + topPadding + bottomPadding)
+
+ spacing: -1
+
+ contentItem: ListView {
+ model: control.contentModel
+ currentIndex: control.currentIndex
+
+ spacing: control.spacing
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+ flickableDirection: Flickable.AutoFlickIfNeeded
+ snapMode: ListView.SnapToItem
+
+ highlightMoveDuration: 0
+ highlightRangeMode: ListView.ApplyRange
+ preferredHighlightBegin: 40
+ preferredHighlightEnd: width - 40
+ }
+
+ background: Item {
+ implicitHeight: 21
+
+ Rectangle {
+ width: parent.width
+ height: 1
+ y: control.position === T.TabBar.Header ? parent.height - 1 : 0
+ color: Fusion.outline(control.palette)
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/TabButton.qml b/src/imports/controls/fusion/TabButton.qml
new file mode 100644
index 00000000..fab406dc
--- /dev/null
+++ b/src/imports/controls/fusion/TabButton.qml
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.TabButton {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ padding: 2
+ leftPadding: 4
+ rightPadding: 4
+ spacing: 6
+
+ icon.width: 16
+ icon.height: 16
+
+ z: checked
+
+ contentItem: IconLabel {
+ spacing: control.spacing
+ mirrored: control.mirrored
+ display: control.display
+
+ icon: control.icon
+ text: control.text
+ font: control.font
+ color: control.palette.buttonText
+ }
+
+ background: Rectangle {
+ y: control.checked || control.TabBar.position !== T.TabBar.Header ? 0 : 2
+ implicitHeight: 21
+ height: control.height - (control.checked ? 0 : 2)
+
+ border.color: Qt.lighter(Fusion.outline(control.palette), 1.1)
+ gradient: control.checked ? selectedGradient : normalGradient
+
+ Gradient {
+ id: selectedGradient
+ GradientStop {
+ position: 0
+ color: Qt.lighter(Fusion.tabFrameColor(control.palette), 1.04)
+ }
+ GradientStop {
+ position: 1
+ color: Fusion.tabFrameColor(control.palette)
+ }
+ }
+
+ Gradient {
+ id: normalGradient
+ GradientStop {
+ position: 0
+ color: Qt.darker(Fusion.tabFrameColor(control.palette), 1.08)
+ }
+ GradientStop {
+ position: 0.85
+ color: Qt.darker(Fusion.tabFrameColor(control.palette), 1.08)
+ }
+ GradientStop {
+ position: 1
+ color: Qt.darker(Fusion.tabFrameColor(control.palette), 1.16)
+ }
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/TextArea.qml b/src/imports/controls/fusion/TextArea.qml
new file mode 100644
index 00000000..bf1de555
--- /dev/null
+++ b/src/imports/controls/fusion/TextArea.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.TextArea {
+ id: control
+
+ implicitWidth: Math.max(contentWidth + leftPadding + rightPadding,
+ background ? background.implicitWidth : 0,
+ placeholder.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(contentHeight + topPadding + bottomPadding,
+ background ? background.implicitHeight : 0,
+ placeholder.implicitHeight + topPadding + bottomPadding)
+
+ padding: 6
+ leftPadding: padding + 4
+
+ color: control.palette.text
+ selectionColor: control.palette.highlight
+ selectedTextColor: control.palette.highlightedText
+
+ PlaceholderText {
+ id: placeholder
+ x: control.leftPadding
+ y: control.topPadding
+ width: control.width - (control.leftPadding + control.rightPadding)
+ height: control.height - (control.topPadding + control.bottomPadding)
+
+ opacity: 0.5
+ text: control.placeholderText
+ font: control.font
+ color: control.palette.text
+ verticalAlignment: control.verticalAlignment
+ visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
+ elide: Text.ElideRight
+ }
+}
diff --git a/src/imports/controls/fusion/TextField.qml b/src/imports/controls/fusion/TextField.qml
new file mode 100644
index 00000000..49e38c1e
--- /dev/null
+++ b/src/imports/controls/fusion/TextField.qml
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.TextField {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ placeholderText ? placeholder.implicitWidth + leftPadding + rightPadding : 0)
+ || contentWidth + leftPadding + rightPadding
+ implicitHeight: Math.max(contentHeight + topPadding + bottomPadding,
+ background ? background.implicitHeight : 0,
+ placeholder.implicitHeight + topPadding + bottomPadding)
+
+ padding: 4
+
+ color: control.palette.text
+ selectionColor: control.palette.highlight
+ selectedTextColor: control.palette.highlightedText
+ verticalAlignment: TextInput.AlignVCenter
+
+ PlaceholderText {
+ id: placeholder
+ x: control.leftPadding
+ y: control.topPadding
+ width: control.width - (control.leftPadding + control.rightPadding)
+ height: control.height - (control.topPadding + control.bottomPadding)
+
+ opacity: 0.5
+ text: control.placeholderText
+ font: control.font
+ color: control.palette.text
+ verticalAlignment: control.verticalAlignment
+ visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
+ elide: Text.ElideRight
+ }
+
+ background: Rectangle {
+ implicitWidth: 120
+ implicitHeight: 24
+
+ radius: 2
+ color: control.palette.base
+ border.color: control.activeFocus ? Fusion.highlightedOutline(control.palette) : Fusion.outline(control.palette)
+
+ Rectangle {
+ x: 1; y: 1
+ width: parent.width - 2
+ height: parent.height - 2
+ color: "transparent"
+ border.color: Color.transparent(Fusion.highlightedOutline(control.palette), 40 / 255)
+ visible: control.activeFocus
+ radius: 1.7
+ }
+
+ Rectangle {
+ x: 2
+ y: 1
+ width: parent.width - 4
+ height: 1
+ color: Fusion.topShadow
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/ToolBar.qml b/src/imports/controls/fusion/ToolBar.qml
new file mode 100644
index 00000000..0181a509
--- /dev/null
+++ b/src/imports/controls/fusion/ToolBar.qml
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.ToolBar {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding)
+
+ contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
+ contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
+
+ leftPadding: 6
+ rightPadding: 6
+ topPadding: control.position === T.ToolBar.Footer ? 1 : 0
+ bottomPadding: control.position === T.ToolBar.Header ? 1 : 0
+
+ background: Rectangle {
+ implicitHeight: 26
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0
+ color: Qt.lighter(control.palette.window, 1.04)
+ }
+ GradientStop {
+ position: 1
+ color: control.palette.window
+ }
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 1
+ color: control.position === T.ToolBar.Header ? Fusion.lightShade : Fusion.darkShade
+ }
+
+ Rectangle {
+ y: parent.height - height
+ width: parent.width
+ height: 1
+ color: control.position === T.ToolBar.Header ? Fusion.darkShade : Fusion.lightShade
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/ToolButton.qml b/src/imports/controls/fusion/ToolButton.qml
new file mode 100644
index 00000000..aa7516b0
--- /dev/null
+++ b/src/imports/controls/fusion/ToolButton.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.ToolButton {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ padding: 6
+ spacing: 6
+
+ icon.width: 16
+ icon.height: 16
+
+ contentItem: IconLabel {
+ spacing: control.spacing
+ mirrored: control.mirrored
+ display: control.display
+
+ icon: control.icon
+ text: control.text
+ font: control.font
+ color: control.palette.buttonText
+ }
+
+ background: ButtonPanel {
+ implicitWidth: 20
+ implicitHeight: 20
+
+ control: control
+ visible: control.down || control.checked || control.highlighted || control.visualFocus || control.hovered
+ }
+}
diff --git a/src/imports/controls/fusion/ToolSeparator.qml b/src/imports/controls/fusion/ToolSeparator.qml
new file mode 100644
index 00000000..70509f3f
--- /dev/null
+++ b/src/imports/controls/fusion/ToolSeparator.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.ToolSeparator {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight + topPadding + bottomPadding)
+
+ padding: vertical ? 6 : 2
+ topPadding: vertical ? 2 : 6
+ bottomPadding: vertical ? 2 : 6
+
+ contentItem: Rectangle {
+ implicitWidth: vertical ? 2 : 8
+ implicitHeight: vertical ? 8 : 2
+ color: Qt.darker(control.palette.window, 1.1)
+
+ Rectangle {
+ x: 1
+ width: 1
+ height: parent.height
+ color: Qt.lighter(control.palette.window, 1.1)
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/ToolTip.qml b/src/imports/controls/fusion/ToolTip.qml
new file mode 100644
index 00000000..8e9be597
--- /dev/null
+++ b/src/imports/controls/fusion/ToolTip.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.ToolTip {
+ id: control
+
+ x: parent ? (parent.width - implicitWidth) / 2 : 0
+ y: -implicitHeight - 3
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding + bottomPadding)
+
+ margins: 6
+ padding: 6
+
+ closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent
+
+ contentItem: Text {
+ text: control.text
+ font: control.font
+ color: control.palette.toolTipText
+ // TODO: wrapMode: Label.Wrap
+ }
+
+ background: Rectangle {
+ color: control.palette.toolTipBase
+ border.color: control.palette.toolTipText
+
+ Rectangle {
+ z: -1
+ x: 1; y: 1
+ width: parent.width
+ height: parent.height
+ color: control.palette.shadow
+ opacity: 0.5
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/Tumbler.qml b/src/imports/controls/fusion/Tumbler.qml
new file mode 100644
index 00000000..77a0c93c
--- /dev/null
+++ b/src/imports/controls/fusion/Tumbler.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
+import QtQuick.Controls.Fusion 2.3
+import QtQuick.Controls.Fusion.impl 2.3
+
+T.Tumbler {
+ id: control
+ implicitWidth: 60
+ implicitHeight: 200
+
+ delegate: Text {
+ id: label
+ text: modelData
+ color: control.palette.windowText
+ font: control.font
+ opacity: (1.0 - Math.abs(Tumbler.displacement) / (visibleItemCount / 2)) * (control.enabled ? 1 : 0.6)
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+
+ contentItem: TumblerView {
+ id: tumblerView
+ model: control.model
+ delegate: control.delegate
+ path: Path {
+ startX: tumblerView.width / 2
+ startY: -tumblerView.delegateHeight / 2
+ PathLine {
+ x: tumblerView.width / 2
+ y: (control.visibleItemCount + 1) * tumblerView.delegateHeight - tumblerView.delegateHeight / 2
+ }
+ }
+
+ property real delegateHeight: control.availableHeight / control.visibleItemCount
+ }
+}
diff --git a/src/imports/controls/fusion/fusion.pri b/src/imports/controls/fusion/fusion.pri
new file mode 100644
index 00000000..9902e971
--- /dev/null
+++ b/src/imports/controls/fusion/fusion.pri
@@ -0,0 +1,65 @@
+HEADERS += \
+ $$PWD/qquickfusionbusyindicator_p.h \
+ $$PWD/qquickfusiondial_p.h \
+ $$PWD/qquickfusionknob_p.h \
+ $$PWD/qquickfusionstyle_p.h \
+ $$PWD/qquickfusiontheme_p.h
+
+SOURCES += \
+ $$PWD/qquickfusionbusyindicator.cpp \
+ $$PWD/qquickfusiondial.cpp \
+ $$PWD/qquickfusionknob.cpp \
+ $$PWD/qquickfusionstyle.cpp \
+ $$PWD/qquickfusiontheme.cpp
+
+QML_FILES += \
+ $$PWD/ApplicationWindow.qml \
+ $$PWD/BusyIndicator.qml \
+ $$PWD/Button.qml \
+ $$PWD/ButtonPanel.qml \
+ $$PWD/CheckBox.qml \
+ $$PWD/CheckDelegate.qml \
+ $$PWD/CheckIndicator.qml \
+ $$PWD/ComboBox.qml \
+ $$PWD/DelayButton.qml \
+ $$PWD/Dial.qml \
+ $$PWD/Dialog.qml \
+ $$PWD/DialogButtonBox.qml \
+ $$PWD/Drawer.qml \
+ $$PWD/Frame.qml \
+ $$PWD/GroupBox.qml \
+ $$PWD/ItemDelegate.qml \
+ $$PWD/Label.qml \
+ $$PWD/Menu.qml \
+ $$PWD/MenuItem.qml \
+ $$PWD/MenuSeparator.qml \
+ $$PWD/Page.qml \
+ $$PWD/PageIndicator.qml \
+ $$PWD/Pane.qml \
+ $$PWD/Popup.qml \
+ $$PWD/ProgressBar.qml \
+ $$PWD/RadioButton.qml \
+ $$PWD/RadioDelegate.qml \
+ $$PWD/RadioIndicator.qml \
+ $$PWD/RangeSlider.qml \
+ $$PWD/RoundButton.qml \
+ $$PWD/ScrollBar.qml \
+ $$PWD/ScrollIndicator.qml \
+ $$PWD/ScrollView.qml \
+ $$PWD/Slider.qml \
+ $$PWD/SliderGroove.qml \
+ $$PWD/SliderHandle.qml \
+ $$PWD/SpinBox.qml \
+ $$PWD/SwipeDelegate.qml \
+ $$PWD/SwitchDelegate.qml \
+ $$PWD/SwitchIndicator.qml \
+ $$PWD/Switch.qml \
+ $$PWD/TabBar.qml \
+ $$PWD/TabButton.qml \
+ $$PWD/TextArea.qml \
+ $$PWD/TextField.qml \
+ $$PWD/ToolBar.qml \
+ $$PWD/ToolButton.qml \
+ $$PWD/ToolSeparator.qml \
+ $$PWD/ToolTip.qml \
+ $$PWD/Tumbler.qml
diff --git a/src/imports/controls/fusion/fusion.pro b/src/imports/controls/fusion/fusion.pro
new file mode 100644
index 00000000..c2b649cf
--- /dev/null
+++ b/src/imports/controls/fusion/fusion.pro
@@ -0,0 +1,25 @@
+TARGET = qtquickcontrols2fusionstyleplugin
+TARGETPATH = QtQuick/Controls.2/Fusion
+IMPORT_VERSION = 2.3
+
+QT += qml quick
+QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private
+
+DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
+
+include(fusion.pri)
+
+OTHER_FILES += \
+ qmldir \
+ $$QML_FILES
+
+SOURCES += \
+ $$PWD/qtquickcontrols2fusionstyleplugin.cpp
+
+RESOURCES += \
+ $$PWD/qtquickcontrols2fusionstyle.qrc
+
+CONFIG += no_cxx_module
+load(qml_plugin)
+
+requires(qtConfig(quickcontrols2-fusion))
diff --git a/src/imports/controls/fusion/images/arrow.png b/src/imports/controls/fusion/images/arrow.png
new file mode 100644
index 00000000..ad8cdc95
--- /dev/null
+++ b/src/imports/controls/fusion/images/arrow.png
Binary files differ
diff --git a/src/imports/controls/fusion/images/arrow.svg b/src/imports/controls/fusion/images/arrow.svg
new file mode 100644
index 00000000..44383924
--- /dev/null
+++ b/src/imports/controls/fusion/images/arrow.svg
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="10"
+ height="6"
+ viewBox="0 0 10 6"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ inkscape:export-filename="/Users/jpnurmi/Downloads/arrow@4x.png"
+ inkscape:export-xdpi="360"
+ inkscape:export-ydpi="360"
+ sodipodi:docname="arrow.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="31.678384"
+ inkscape:cx="7.9810383"
+ inkscape:cy="3.0344775"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:snap-to-guides="true"
+ inkscape:snap-page="true"
+ inkscape:window-width="1440"
+ inkscape:window-height="851"
+ inkscape:window-x="0"
+ inkscape:window-y="1"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1046.3622)">
+ <path
+ transform="matrix(1.2371791,0,0,0.85714284,1.0769252,150.19463)"
+ style="fill:#000000;fill-opacity:0.7254902"
+ inkscape:transform-center-y="1.4999605"
+ d="m 3.1709837,1051.3622 -3.2331616,-4.6667 6.4663233,0 z"
+ id="path3365"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccc" />
+ </g>
+</svg>
diff --git a/src/imports/controls/fusion/images/arrow@2x.png b/src/imports/controls/fusion/images/arrow@2x.png
new file mode 100644
index 00000000..4f94c58f
--- /dev/null
+++ b/src/imports/controls/fusion/images/arrow@2x.png
Binary files differ
diff --git a/src/imports/controls/fusion/images/arrow@3x.png b/src/imports/controls/fusion/images/arrow@3x.png
new file mode 100644
index 00000000..68928ea9
--- /dev/null
+++ b/src/imports/controls/fusion/images/arrow@3x.png
Binary files differ
diff --git a/src/imports/controls/fusion/images/arrow@4x.png b/src/imports/controls/fusion/images/arrow@4x.png
new file mode 100644
index 00000000..edde50f3
--- /dev/null
+++ b/src/imports/controls/fusion/images/arrow@4x.png
Binary files differ
diff --git a/src/imports/controls/fusion/images/checkmark.png b/src/imports/controls/fusion/images/checkmark.png
new file mode 100644
index 00000000..9cb04883
--- /dev/null
+++ b/src/imports/controls/fusion/images/checkmark.png
Binary files differ
diff --git a/src/imports/controls/fusion/images/checkmark.svg b/src/imports/controls/fusion/images/checkmark.svg
new file mode 100644
index 00000000..f1afdc4f
--- /dev/null
+++ b/src/imports/controls/fusion/images/checkmark.svg
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="14"
+ height="14"
+ viewBox="0 0 14 14"
+ id="svg3386"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ inkscape:export-filename="/Users/jpnurmi/Downloads/checkmark@4x.png"
+ inkscape:export-xdpi="360"
+ inkscape:export-ydpi="360"
+ sodipodi:docname="checkmark.svg">
+ <defs
+ id="defs3388" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="1.9865044"
+ inkscape:cy="6.0706667"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ units="px"
+ inkscape:snap-page="true"
+ inkscape:snap-grids="true"
+ inkscape:snap-to-guides="true"
+ inkscape:window-width="1440"
+ inkscape:window-height="851"
+ inkscape:window-x="0"
+ inkscape:window-y="1"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata3391">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1038.3622)">
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.79999995;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 5,1045.3622 2,4 2.5,-8"
+ id="path4198"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccc"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ </g>
+</svg>
diff --git a/src/imports/controls/fusion/images/checkmark@2x.png b/src/imports/controls/fusion/images/checkmark@2x.png
new file mode 100644
index 00000000..ae9a7749
--- /dev/null
+++ b/src/imports/controls/fusion/images/checkmark@2x.png
Binary files differ
diff --git a/src/imports/controls/fusion/images/checkmark@3x.png b/src/imports/controls/fusion/images/checkmark@3x.png
new file mode 100644
index 00000000..4a67e88a
--- /dev/null
+++ b/src/imports/controls/fusion/images/checkmark@3x.png
Binary files differ
diff --git a/src/imports/controls/fusion/images/checkmark@4x.png b/src/imports/controls/fusion/images/checkmark@4x.png
new file mode 100644
index 00000000..0890d2ba
--- /dev/null
+++ b/src/imports/controls/fusion/images/checkmark@4x.png
Binary files differ
diff --git a/src/imports/controls/fusion/images/progressmask.png b/src/imports/controls/fusion/images/progressmask.png
new file mode 100644
index 00000000..683f9e2f
--- /dev/null
+++ b/src/imports/controls/fusion/images/progressmask.png
Binary files differ
diff --git a/src/imports/controls/fusion/images/progressmask.svg b/src/imports/controls/fusion/images/progressmask.svg
new file mode 100644
index 00000000..a0dfc426
--- /dev/null
+++ b/src/imports/controls/fusion/images/progressmask.svg
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="31"
+ height="22"
+ viewBox="0 0 8.202083 5.8208335"
+ version="1.1"
+ id="svg8"
+ inkscape:export-filename="/home/jpnurmi/Projects/qt-dev/qtquickcontrols2/src/imports/controls/fusion/images/progressmask@4x.png"
+ inkscape:export-xdpi="384"
+ inkscape:export-ydpi="384"
+ inkscape:version="0.92.1 r"
+ sodipodi:docname="progressmask.svg">
+ <defs
+ id="defs2" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="15.839192"
+ inkscape:cx="61.144853"
+ inkscape:cy="14.574824"
+ inkscape:document-units="mm"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ units="px"
+ inkscape:pagecheckerboard="true"
+ inkscape:window-width="3840"
+ inkscape:window-height="2031"
+ inkscape:window-x="0"
+ inkscape:window-y="55"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata5">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-291.17915)">
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:4.5;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 0,296.99998 4.7625,-5.82083"
+ id="path4485"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:4.5;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 8.2020833,296.99998 4.7624997,-5.82083"
+ id="path4485-3"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ </g>
+</svg>
diff --git a/src/imports/controls/fusion/images/progressmask@2x.png b/src/imports/controls/fusion/images/progressmask@2x.png
new file mode 100644
index 00000000..e101f5de
--- /dev/null
+++ b/src/imports/controls/fusion/images/progressmask@2x.png
Binary files differ
diff --git a/src/imports/controls/fusion/images/progressmask@3x.png b/src/imports/controls/fusion/images/progressmask@3x.png
new file mode 100644
index 00000000..784f01c0
--- /dev/null
+++ b/src/imports/controls/fusion/images/progressmask@3x.png
Binary files differ
diff --git a/src/imports/controls/fusion/images/progressmask@4x.png b/src/imports/controls/fusion/images/progressmask@4x.png
new file mode 100644
index 00000000..8af0b2c2
--- /dev/null
+++ b/src/imports/controls/fusion/images/progressmask@4x.png
Binary files differ
diff --git a/src/imports/controls/fusion/qmldir b/src/imports/controls/fusion/qmldir
new file mode 100644
index 00000000..c37b9f9f
--- /dev/null
+++ b/src/imports/controls/fusion/qmldir
@@ -0,0 +1,4 @@
+module QtQuick.Controls.Fusion
+plugin qtquickcontrols2fusionstyleplugin
+classname QtQuickControls2FusionStylePlugin
+depends QtQuick.Controls 2.3
diff --git a/src/imports/controls/fusion/qquickfusionbusyindicator.cpp b/src/imports/controls/fusion/qquickfusionbusyindicator.cpp
new file mode 100644
index 00000000..7254b7b7
--- /dev/null
+++ b/src/imports/controls/fusion/qquickfusionbusyindicator.cpp
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickfusionbusyindicator_p.h"
+
+#include <QtGui/qpainter.h>
+
+QT_BEGIN_NAMESPACE
+
+QQuickFusionBusyIndicator::QQuickFusionBusyIndicator(QQuickItem *parent)
+ : QQuickPaintedItem(parent)
+{
+}
+
+QColor QQuickFusionBusyIndicator::color() const
+{
+ return m_color;
+}
+
+void QQuickFusionBusyIndicator::setColor(const QColor &color)
+{
+ if (color == m_color)
+ return;
+
+ m_color = color;
+ update();
+}
+
+void QQuickFusionBusyIndicator::paint(QPainter *painter)
+{
+ const qreal w = width();
+ const qreal h = height();
+ if (w <= 0 || h <= 0 || !isVisible())
+ return;
+
+ const qreal sz = qMin(w, h);
+ const qreal dx = (w - sz) / 2;
+ const qreal dy = (h - sz) / 2;
+ const int hpw = qRound(qMax(1.0, sz / 14)) & -1;
+ const int pw = 2 * hpw;
+ const QRectF bounds(dx + hpw, dy + hpw, sz - pw - 1, sz - pw - 1);
+
+ QConicalGradient gradient;
+ gradient.setCenter(QPointF(dx + sz / 2, dy + sz / 2));
+ gradient.setColorAt(0, m_color);
+ gradient.setColorAt(0.1, m_color);
+ gradient.setColorAt(1, Qt::transparent);
+
+ painter->translate(0.5, 0.5);
+ painter->setRenderHint(QPainter::Antialiasing, true);
+ painter->setPen(QPen(gradient, pw, Qt::SolidLine));
+ painter->drawArc(bounds, 0, 360 * 16);
+ painter->setPen(QPen(m_color, pw, Qt::SolidLine, Qt::RoundCap));
+ painter->drawArc(bounds, 0, 20 * 16);
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/controls/fusion/qquickfusionbusyindicator_p.h b/src/imports/controls/fusion/qquickfusionbusyindicator_p.h
new file mode 100644
index 00000000..c8af3311
--- /dev/null
+++ b/src/imports/controls/fusion/qquickfusionbusyindicator_p.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKFUSIONBUSYINDICATOR_P_H
+#define QQUICKFUSIONBUSYINDICATOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtGui/qcolor.h>
+#include <QtQuick/qquickpainteditem.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickFusionBusyIndicator : public QQuickPaintedItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QColor color READ color WRITE setColor FINAL)
+
+public:
+ explicit QQuickFusionBusyIndicator(QQuickItem *parent = nullptr);
+
+ QColor color() const;
+ void setColor(const QColor &color);
+
+ void paint(QPainter *painter) override;
+
+private:
+ QColor m_color;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKFUSIONBUSYINDICATOR_P_H
diff --git a/src/imports/controls/fusion/qquickfusiondial.cpp b/src/imports/controls/fusion/qquickfusiondial.cpp
new file mode 100644
index 00000000..014078e6
--- /dev/null
+++ b/src/imports/controls/fusion/qquickfusiondial.cpp
@@ -0,0 +1,152 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickfusiondial_p.h"
+
+#include <QtGui/qpainter.h>
+#include <QtGui/private/qmath_p.h>
+
+QT_BEGIN_NAMESPACE
+
+QQuickFusionDial::QQuickFusionDial(QQuickItem *parent)
+ : QQuickPaintedItem(parent),
+ m_highlight(false)
+{
+}
+
+bool QQuickFusionDial::highlight() const
+{
+ return m_highlight;
+}
+
+void QQuickFusionDial::setHighlight(bool highlight)
+{
+ if (m_highlight == highlight)
+ return;
+
+ m_highlight = highlight;
+ update();
+}
+
+QPalette QQuickFusionDial::palette() const
+{
+ return m_palette;
+}
+
+void QQuickFusionDial::setPalette(const QPalette &palette)
+{
+ if (palette == m_palette)
+ return;
+
+ m_palette = palette;
+ update();
+}
+
+// based on QStyleHelper::drawDial()
+void QQuickFusionDial::paint(QPainter *painter)
+{
+ const int width = QQuickItem::width();
+ const int height = QQuickItem::height();
+ if (width <= 0 || height <= 0 || !isVisible())
+ return;
+
+ QColor buttonColor = m_palette.button().color();
+ const bool enabled = isEnabled();
+ qreal r = qMin(width, height) / 2;
+ r -= r/50;
+ const qreal penSize = r/20.0;
+
+ painter->setRenderHint(QPainter::Antialiasing);
+
+ const qreal d_ = r / 6;
+ const qreal dx = d_ + (width - 2 * r) / 2 + 1;
+ const qreal dy = d_ + (height - 2 * r) / 2 + 1;
+
+ QRectF br = QRectF(dx + 0.5, dy + 0.5,
+ int(r * 2 - 2 * d_ - 2),
+ int(r * 2 - 2 * d_ - 2));
+ buttonColor.setHsv(buttonColor .hue(),
+ qMin(140, buttonColor .saturation()),
+ qMax(180, buttonColor.value()));
+
+ if (enabled) {
+ // Drop shadow
+ qreal shadowSize = qMax(1.0, penSize/2.0);
+ QRectF shadowRect= br.adjusted(-2*shadowSize, -2*shadowSize,
+ 2*shadowSize, 2*shadowSize);
+ QRadialGradient shadowGradient(shadowRect.center().x(),
+ shadowRect.center().y(), shadowRect.width()/2.0,
+ shadowRect.center().x(), shadowRect.center().y());
+ shadowGradient.setColorAt(qreal(0.91), QColor(0, 0, 0, 40));
+ shadowGradient.setColorAt(qreal(1.0), Qt::transparent);
+ painter->setBrush(shadowGradient);
+ painter->setPen(Qt::NoPen);
+ painter->translate(shadowSize, shadowSize);
+ painter->drawEllipse(shadowRect);
+ painter->translate(-shadowSize, -shadowSize);
+
+ // Main gradient
+ QRadialGradient gradient(br.center().x() - br.width()/3, dy,
+ br.width()*1.3, br.center().x(),
+ br.center().y() - br.height()/2);
+ gradient.setColorAt(0, buttonColor.lighter(110));
+ gradient.setColorAt(qreal(0.5), buttonColor);
+ gradient.setColorAt(qreal(0.501), buttonColor.darker(102));
+ gradient.setColorAt(1, buttonColor.darker(115));
+ painter->setBrush(gradient);
+ } else {
+ painter->setBrush(Qt::NoBrush);
+ }
+
+ painter->setPen(QPen(buttonColor.darker(280)));
+ painter->drawEllipse(br);
+ painter->setBrush(Qt::NoBrush);
+ painter->setPen(buttonColor.lighter(110));
+ painter->drawEllipse(br.adjusted(1, 1, -1, -1));
+
+ if (m_highlight) {
+ QColor highlight = m_palette.highlight().color();
+ highlight.setHsv(highlight.hue(),
+ qMin(160, highlight.saturation()),
+ qMax(230, highlight.value()));
+ highlight.setAlpha(127);
+ painter->setPen(QPen(highlight, 2.0));
+ painter->setBrush(Qt::NoBrush);
+ painter->drawEllipse(br.adjusted(-1, -1, 1, 1));
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/controls/fusion/qquickfusiondial_p.h b/src/imports/controls/fusion/qquickfusiondial_p.h
new file mode 100644
index 00000000..d3216521
--- /dev/null
+++ b/src/imports/controls/fusion/qquickfusiondial_p.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKFUSIONDIAL_P_H
+#define QQUICKFUSIONDIAL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtGui/qpalette.h>
+#include <QtQuick/qquickpainteditem.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickFusionDial : public QQuickPaintedItem
+{
+ Q_OBJECT
+ Q_PROPERTY(bool highlight READ highlight WRITE setHighlight FINAL)
+ Q_PROPERTY(QPalette palette READ palette WRITE setPalette FINAL)
+
+public:
+ explicit QQuickFusionDial(QQuickItem *parent = nullptr);
+
+ bool highlight() const;
+ void setHighlight(bool highlight);
+
+ QPalette palette() const;
+ void setPalette(const QPalette &palette);
+
+ void paint(QPainter *painter) override;
+
+private:
+ bool m_highlight;
+ QPalette m_palette;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKFUSIONDIAL_P_H
diff --git a/src/imports/controls/fusion/qquickfusionknob.cpp b/src/imports/controls/fusion/qquickfusionknob.cpp
new file mode 100644
index 00000000..9f1824a6
--- /dev/null
+++ b/src/imports/controls/fusion/qquickfusionknob.cpp
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickfusionknob_p.h"
+
+#include <QtCore/qmath.h>
+#include <QtGui/qpainter.h>
+
+QT_BEGIN_NAMESPACE
+
+QQuickFusionKnob::QQuickFusionKnob(QQuickItem *parent)
+ : QQuickPaintedItem(parent)
+{
+}
+
+QPalette QQuickFusionKnob::palette() const
+{
+ return m_palette;
+}
+
+void QQuickFusionKnob::setPalette(const QPalette &palette)
+{
+ if (palette == m_palette)
+ return;
+
+ m_palette = palette;
+ update();
+}
+
+// extracted from QStyleHelper::drawDial()
+void QQuickFusionKnob::paint(QPainter *painter)
+{
+ const qreal w = width();
+ const qreal h = height();
+ if (w <= 0 || h <= 0)
+ return;
+
+ QColor color = m_palette.color(QPalette::Button);
+ color.setHsv(color.hue(),
+ qMin(140, color .saturation()),
+ qMax(180, color.value()));
+ color = color.lighter(104);
+ color.setAlphaF(qreal(0.8));
+
+ const qreal sz = qMin(w, h);
+ QRectF rect(0, 0, sz, sz);
+ rect.moveCenter(QPointF(w / 2.0, h / 2.0));
+ const QPointF center = rect.center();
+
+ QRadialGradient gradient(center.x() + rect.width() / 2,
+ center.y() + rect.width(),
+ rect.width() * 2,
+ center.x(), center.y());
+ gradient.setColorAt(1, color.darker(140));
+ gradient.setColorAt(qreal(0.4), color.darker(120));
+ gradient.setColorAt(0, color.darker(110));
+
+ painter->setRenderHint(QPainter::Antialiasing);
+ painter->setBrush(gradient);
+ painter->setPen(QColor(255, 255, 255, 150));
+ painter->drawEllipse(rect);
+ painter->setPen(QColor(0, 0, 0, 80));
+ painter->drawEllipse(rect.adjusted(1, 1, -1, -1));
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/controls/fusion/qquickfusionknob_p.h b/src/imports/controls/fusion/qquickfusionknob_p.h
new file mode 100644
index 00000000..062aaf21
--- /dev/null
+++ b/src/imports/controls/fusion/qquickfusionknob_p.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKFUSIONKNOB_P_H
+#define QQUICKFUSIONKNOB_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtGui/qpalette.h>
+#include <QtQuick/qquickpainteditem.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickFusionKnob : public QQuickPaintedItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QPalette palette READ palette WRITE setPalette FINAL)
+
+public:
+ explicit QQuickFusionKnob(QQuickItem *parent = nullptr);
+
+ QPalette palette() const;
+ void setPalette(const QPalette &palette);
+
+ void paint(QPainter *painter) override;
+
+private:
+ QPalette m_palette;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKFUSIONKNOB_P_H
diff --git a/src/imports/controls/fusion/qquickfusionstyle.cpp b/src/imports/controls/fusion/qquickfusionstyle.cpp
new file mode 100644
index 00000000..a66665fc
--- /dev/null
+++ b/src/imports/controls/fusion/qquickfusionstyle.cpp
@@ -0,0 +1,172 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickfusionstyle_p.h"
+
+#include <QtGui/qcolor.h>
+#include <QtGui/qpalette.h>
+#include <QtGui/qpa/qplatformtheme.h>
+#include <QtGui/private/qguiapplication_p.h>
+
+QT_BEGIN_NAMESPACE
+
+// On mac we want a standard blue color used when the system palette is used
+static bool isMacSystemPalette(const QPalette &palette)
+{
+ Q_UNUSED(palette);
+#if defined(Q_OS_MACOS)
+ const QPalette *themePalette = QGuiApplicationPrivate::platformTheme()->palette();
+ if (themePalette && themePalette->color(QPalette::Normal, QPalette::Highlight) ==
+ palette.color(QPalette::Normal, QPalette::Highlight) &&
+ themePalette->color(QPalette::Normal, QPalette::HighlightedText) ==
+ palette.color(QPalette::Normal, QPalette::HighlightedText))
+ return true;
+#endif
+ return false;
+}
+
+QQuickFusionStyle::QQuickFusionStyle(QObject *parent)
+ : QObject(parent)
+{
+}
+
+QColor QQuickFusionStyle::lightShade()
+{
+ return QColor(255, 255, 255, 90);
+}
+
+QColor QQuickFusionStyle::darkShade()
+{
+ return QColor(0, 0, 0, 60);
+}
+
+QColor QQuickFusionStyle::topShadow()
+{
+ return QColor(0, 0, 0, 18);
+}
+
+QColor QQuickFusionStyle::innerContrastLine()
+{
+ return QColor(255, 255, 255, 30);
+}
+
+QColor QQuickFusionStyle::highlight(const QPalette &palette)
+{
+ if (isMacSystemPalette(palette))
+ return QColor(60, 140, 230);
+ return palette.color(QPalette::Highlight);
+}
+
+QColor QQuickFusionStyle::highlightedText(const QPalette &palette)
+{
+ if (isMacSystemPalette(palette))
+ return Qt::white;
+ return palette.color(QPalette::HighlightedText);
+}
+
+QColor QQuickFusionStyle::outline(const QPalette &palette)
+{
+ if (palette.window().style() == Qt::TexturePattern)
+ return QColor(0, 0, 0, 160);
+ return palette.background().color().darker(140);
+}
+
+QColor QQuickFusionStyle::highlightedOutline(const QPalette &palette)
+{
+ QColor highlightedOutline = highlight(palette).darker(125);
+ if (highlightedOutline.value() > 160)
+ highlightedOutline.setHsl(highlightedOutline.hue(), highlightedOutline.saturation(), 160);
+ return highlightedOutline;
+}
+
+QColor QQuickFusionStyle::tabFrameColor(const QPalette &palette)
+{
+ if (palette.window().style() == Qt::TexturePattern)
+ return QColor(255, 255, 255, 8);
+ return buttonColor(palette).lighter(104);
+}
+
+QColor QQuickFusionStyle::buttonColor(const QPalette &palette, bool highlighted, bool down, bool hovered)
+{
+ QColor buttonColor = palette.button().color();
+ int val = qGray(buttonColor.rgb());
+ buttonColor = buttonColor.lighter(100 + qMax(1, (180 - val)/6));
+ buttonColor.setHsv(buttonColor.hue(), buttonColor.saturation() * 0.75, buttonColor.value());
+ if (highlighted)
+ buttonColor = mergedColors(buttonColor, highlightedOutline(palette).lighter(130), 90);
+ if (!hovered)
+ buttonColor = buttonColor.darker(104);
+ if (down)
+ buttonColor = buttonColor.darker(110);
+ return buttonColor;
+}
+
+QColor QQuickFusionStyle::buttonOutline(const QPalette &palette, bool highlighted, bool enabled)
+{
+ QColor darkOutline = enabled && highlighted ? highlightedOutline(palette) : outline(palette);
+ return !enabled ? darkOutline.lighter(115) : darkOutline;
+}
+
+QColor QQuickFusionStyle::gradientStart(const QColor &baseColor)
+{
+ return baseColor.lighter(124);
+}
+
+QColor QQuickFusionStyle::gradientStop(const QColor &baseColor)
+{
+ return baseColor.lighter(102);
+}
+
+QColor QQuickFusionStyle::mergedColors(const QColor &colorA, const QColor &colorB, int factor)
+{
+ const int maxFactor = 100;
+ QColor tmp = colorA;
+ tmp.setRed((tmp.red() * factor) / maxFactor + (colorB.red() * (maxFactor - factor)) / maxFactor);
+ tmp.setGreen((tmp.green() * factor) / maxFactor + (colorB.green() * (maxFactor - factor)) / maxFactor);
+ tmp.setBlue((tmp.blue() * factor) / maxFactor + (colorB.blue() * (maxFactor - factor)) / maxFactor);
+ return tmp;
+}
+
+QColor QQuickFusionStyle::grooveColor(const QPalette &palette)
+{
+ QColor color = buttonColor(palette);
+ color.setHsv(color.hue(),
+ qMin(255, color.saturation()),
+ qMin<int>(255, color.value() * 0.9));
+ return color;
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/controls/fusion/qquickfusionstyle_p.h b/src/imports/controls/fusion/qquickfusionstyle_p.h
new file mode 100644
index 00000000..e0a99cc6
--- /dev/null
+++ b/src/imports/controls/fusion/qquickfusionstyle_p.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKFUSIONSTYLE_P_H
+#define QQUICKFUSIONSTYLE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qobject.h>
+#include <QtGui/qcolor.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickFusionStyle : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QColor lightShade READ lightShade CONSTANT)
+ Q_PROPERTY(QColor darkShade READ darkShade CONSTANT)
+ Q_PROPERTY(QColor topShadow READ topShadow CONSTANT)
+ Q_PROPERTY(QColor innerContrastLine READ innerContrastLine CONSTANT)
+
+public:
+ explicit QQuickFusionStyle(QObject *parent = nullptr);
+
+ static QColor lightShade();
+ static QColor darkShade();
+ static QColor topShadow();
+ static QColor innerContrastLine();
+
+ Q_INVOKABLE static QColor highlight(const QPalette &palette);
+ Q_INVOKABLE static QColor highlightedText(const QPalette &palette);
+ Q_INVOKABLE static QColor outline(const QPalette &palette);
+ Q_INVOKABLE static QColor highlightedOutline(const QPalette &palette);
+ Q_INVOKABLE static QColor tabFrameColor(const QPalette &palette);
+ Q_INVOKABLE static QColor buttonColor(const QPalette &palette, bool highlighted = false, bool down = false, bool hovered = false);
+ Q_INVOKABLE static QColor buttonOutline(const QPalette &palette, bool highlighted = false, bool enabled = true);
+ Q_INVOKABLE static QColor gradientStart(const QColor &baseColor);
+ Q_INVOKABLE static QColor gradientStop(const QColor &baseColor);
+ Q_INVOKABLE static QColor mergedColors(const QColor &colorA, const QColor &colorB, int factor = 50);
+ Q_INVOKABLE static QColor grooveColor(const QPalette &palette);
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKFUSIONSTYLE_P_H
diff --git a/src/imports/controls/fusion/qquickfusiontheme.cpp b/src/imports/controls/fusion/qquickfusiontheme.cpp
new file mode 100644
index 00000000..54536101
--- /dev/null
+++ b/src/imports/controls/fusion/qquickfusiontheme.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickfusiontheme_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQuickFusionTheme::QQuickFusionTheme(QPlatformTheme *theme)
+ : QQuickProxyTheme(theme)
+{
+}
+
+const QPalette *QQuickFusionTheme::palette(Palette type) const
+{
+ return QQuickProxyTheme::palette(type);
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/controls/fusion/qquickfusiontheme_p.h b/src/imports/controls/fusion/qquickfusiontheme_p.h
new file mode 100644
index 00000000..c5949848
--- /dev/null
+++ b/src/imports/controls/fusion/qquickfusiontheme_p.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKFUSIONTHEME_P_H
+#define QQUICKFUSIONTHEME_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qvariant.h>
+#include <QtGui/qpalette.h>
+#include <QtQuickControls2/private/qquickproxytheme_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickFusionTheme : public QQuickProxyTheme
+{
+public:
+ explicit QQuickFusionTheme(QPlatformTheme *theme = nullptr);
+
+ const QPalette *palette(Palette type = SystemPalette) const override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKFUSIONTHEME_P_H
diff --git a/src/imports/controls/fusion/qtquickcontrols2fusionstyle.qrc b/src/imports/controls/fusion/qtquickcontrols2fusionstyle.qrc
new file mode 100644
index 00000000..74c8e671
--- /dev/null
+++ b/src/imports/controls/fusion/qtquickcontrols2fusionstyle.qrc
@@ -0,0 +1,16 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="qt-project.org/imports/QtQuick/Controls.2/Fusion">
+ <file>images/arrow.png</file>
+ <file>images/arrow@2x.png</file>
+ <file>images/arrow@3x.png</file>
+ <file>images/arrow@4x.png</file>
+ <file>images/checkmark.png</file>
+ <file>images/checkmark@2x.png</file>
+ <file>images/checkmark@3x.png</file>
+ <file>images/checkmark@4x.png</file>
+ <file>images/progressmask.png</file>
+ <file>images/progressmask@2x.png</file>
+ <file>images/progressmask@3x.png</file>
+ <file>images/progressmask@4x.png</file>
+</qresource>
+</RCC>
diff --git a/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp b/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp
new file mode 100644
index 00000000..1fcacc5e
--- /dev/null
+++ b/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp
@@ -0,0 +1,121 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtQuickControls2/private/qquickstyleplugin_p.h>
+#include <QtQml/qqml.h>
+
+#include "qquickfusionbusyindicator_p.h"
+#include "qquickfusiondial_p.h"
+#include "qquickfusionknob_p.h"
+#include "qquickfusionstyle_p.h"
+#include "qquickfusiontheme_p.h"
+
+static inline void initResources()
+{
+ Q_INIT_RESOURCE(qtquickcontrols2fusionstyle);
+#ifdef QT_STATIC
+ Q_INIT_RESOURCE(qmake_QtQuick_Controls_2_Fusion);
+#endif
+}
+
+QT_BEGIN_NAMESPACE
+
+static QObject *styleSingleton(QQmlEngine *engine, QJSEngine *scriptEngine)
+{
+ Q_UNUSED(engine);
+ Q_UNUSED(scriptEngine);
+ return new QQuickFusionStyle;
+}
+
+class QtQuickControls2FusionStylePlugin: public QQuickStylePlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
+
+public:
+ QtQuickControls2FusionStylePlugin(QObject *parent = nullptr);
+
+ void registerTypes(const char *uri) override;
+ void initializeEngine(QQmlEngine *engine, const char *uri) override;
+
+ QString name() const override;
+ QQuickProxyTheme *createTheme() const override;
+};
+
+QtQuickControls2FusionStylePlugin::QtQuickControls2FusionStylePlugin(QObject *parent) : QQuickStylePlugin(parent)
+{
+ initResources();
+}
+
+void QtQuickControls2FusionStylePlugin::registerTypes(const char *uri)
+{
+ qmlRegisterModule(uri, 2, QT_VERSION_MINOR - 7); // Qt 5.10->2.3, 5.11->2.4...
+}
+
+void QtQuickControls2FusionStylePlugin::initializeEngine(QQmlEngine *engine, const char *uri)
+{
+ QQuickStylePlugin::initializeEngine(engine, uri);
+
+ QByteArray import = QByteArray(uri) + ".impl";
+ qmlRegisterModule(import, 2, QT_VERSION_MINOR - 7); // Qt 5.10->2.3, 5.11->2.4...
+
+ qmlRegisterSingletonType<QQuickFusionStyle>(import, 2, 3, "Fusion", styleSingleton);
+
+ qmlRegisterType<QQuickFusionBusyIndicator>(import, 2, 3, "BusyIndicatorImpl");
+ qmlRegisterType<QQuickFusionDial>(import, 2, 3, "DialImpl");
+ qmlRegisterType<QQuickFusionKnob>(import, 2, 3, "KnobImpl");
+
+ qmlRegisterType(typeUrl(QStringLiteral("ButtonPanel.qml")), import, 2, 3, "ButtonPanel");
+ qmlRegisterType(typeUrl(QStringLiteral("CheckIndicator.qml")), import, 2, 3, "CheckIndicator");
+ qmlRegisterType(typeUrl(QStringLiteral("RadioIndicator.qml")), import, 2, 3, "RadioIndicator");
+ qmlRegisterType(typeUrl(QStringLiteral("SliderGroove.qml")), import, 2, 3, "SliderGroove");
+ qmlRegisterType(typeUrl(QStringLiteral("SliderHandle.qml")), import, 2, 3, "SliderHandle");
+ qmlRegisterType(typeUrl(QStringLiteral("SwitchIndicator.qml")), import, 2, 3, "SwitchIndicator");
+}
+
+QString QtQuickControls2FusionStylePlugin::name() const
+{
+ return QStringLiteral("fusion");
+}
+
+QQuickProxyTheme *QtQuickControls2FusionStylePlugin::createTheme() const
+{
+ return new QQuickFusionTheme;
+}
+
+QT_END_NAMESPACE
+
+#include "qtquickcontrols2fusionstyleplugin.moc"
diff --git a/src/imports/imports.pro b/src/imports/imports.pro
index e1da66c9..dfba46ac 100644
--- a/src/imports/imports.pro
+++ b/src/imports/imports.pro
@@ -6,5 +6,6 @@ SUBDIRS += \
templates
SUBDIRS += \
+ controls/fusion/fusion.pro \
controls/material/material.pro \
controls/universal/universal.pro
diff --git a/src/quickcontrols2/configure.json b/src/quickcontrols2/configure.json
index 113d321a..121f3f49 100644
--- a/src/quickcontrols2/configure.json
+++ b/src/quickcontrols2/configure.json
@@ -3,6 +3,7 @@
"commandline": {
"options": {
+ "style-fusion": { "type": "boolean", "name": "quickcontrols2-fusion" },
"style-material": { "type": "boolean", "name": "quickcontrols2-material" },
"style-universal": { "type": "boolean", "name": "quickcontrols2-universal" }
}
@@ -13,6 +14,12 @@
"label": "Default",
"output": [ "privateFeature" ]
},
+ "quickcontrols2-fusion": {
+ "label": "Fusion",
+ "purpose": "Provides a platform agnostic Fusion style for the Qt Quick Controls 2",
+ "condition": "features.quickcontrols2-default",
+ "output": [ "privateFeature" ]
+ },
"quickcontrols2-material": {
"label": "Material",
"purpose": "Provides a Qt Quick Controls 2 style based on the Material Design guidelines",
@@ -34,7 +41,7 @@
{
"message": "Styles",
"type": "featureList",
- "args": "quickcontrols2-default quickcontrols2-material quickcontrols2-universal"
+ "args": "quickcontrols2-default quickcontrols2-fusion quickcontrols2-material quickcontrols2-universal"
}
]
}
diff --git a/tests/auto/controls/controls.pro b/tests/auto/controls/controls.pro
index 8f2f8e69..c61dff0e 100644
--- a/tests/auto/controls/controls.pro
+++ b/tests/auto/controls/controls.pro
@@ -1,5 +1,6 @@
TEMPLATE = subdirs
SUBDIRS += \
default \
+ fusion \
material \
universal
diff --git a/tests/auto/controls/fusion/dependencies.qml b/tests/auto/controls/fusion/dependencies.qml
new file mode 100644
index 00000000..30c32fa5
--- /dev/null
+++ b/tests/auto/controls/fusion/dependencies.qml
@@ -0,0 +1,6 @@
+import QtTest 1.0
+import QtQuick 2.10
+import QtQuick.Controls 2.3
+import QtQuick.Controls.Fusion 2.3
+
+TestCase { }
diff --git a/tests/auto/controls/fusion/fusion.pro b/tests/auto/controls/fusion/fusion.pro
new file mode 100644
index 00000000..f3374f34
--- /dev/null
+++ b/tests/auto/controls/fusion/fusion.pro
@@ -0,0 +1,15 @@
+TEMPLATE = app
+TARGET = tst_fusion
+CONFIG += qmltestcase
+QT += quickcontrols2
+
+DEFINES += TST_CONTROLS_DATA=\\\"$$QQC2_SOURCE_TREE/tests/auto/controls/data\\\"
+
+SOURCES += \
+ $$PWD/tst_fusion.cpp
+
+OTHER_FILES += \
+ $$PWD/../data/*.qml
+
+TESTDATA += \
+ $$PWD/../data/tst_*
diff --git a/tests/auto/controls/fusion/tst_fusion.cpp b/tests/auto/controls/fusion/tst_fusion.cpp
new file mode 100644
index 00000000..84f9c231
--- /dev/null
+++ b/tests/auto/controls/fusion/tst_fusion.cpp
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtQuickTest/quicktest.h>
+#include <QtQuickControls2/qquickstyle.h>
+
+int main(int argc, char *argv[])
+{
+ QTEST_ADD_GPU_BLACKLIST_SUPPORT
+ QTEST_SET_MAIN_SOURCE_PATH
+ qputenv("QML_NO_TOUCH_COMPRESSION", "1");
+ QQuickStyle::setStyle("Fusion");
+ return quick_test_main(argc, argv, "tst_controls::Fusion", TST_CONTROLS_DATA);
+}
diff --git a/tests/auto/sanity/tst_sanity.cpp b/tests/auto/sanity/tst_sanity.cpp
index 2988c96c..25e118e3 100644
--- a/tests/auto/sanity/tst_sanity.cpp
+++ b/tests/auto/sanity/tst_sanity.cpp
@@ -314,6 +314,7 @@ void tst_Sanity::attachedObjects_data()
QTest::addColumn<QUrl>("url");
addTestRows(&engine, "calendar", "Qt/labs/calendar");
addTestRows(&engine, "controls", "QtQuick/Controls.2", QStringList() << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator");
+ addTestRows(&engine, "controls/fusion", "QtQuick/Controls.2", QStringList() << "CheckIndicator" << "RadioIndicator" << "SliderGroove" << "SliderHandle" << "SwitchIndicator");
addTestRows(&engine, "controls/material", "QtQuick/Controls.2/Material", QStringList() << "Ripple" << "SliderHandle" << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator" << "BoxShadow" << "ElevationEffect" << "CursorDelegate");
addTestRows(&engine, "controls/universal", "QtQuick/Controls.2/Universal", QStringList() << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator");
}
diff --git a/tests/benchmarks/objectcount/tst_objectcount.cpp b/tests/benchmarks/objectcount/tst_objectcount.cpp
index d12f3293..551d2009 100644
--- a/tests/benchmarks/objectcount/tst_objectcount.cpp
+++ b/tests/benchmarks/objectcount/tst_objectcount.cpp
@@ -124,6 +124,7 @@ static void addTestRows(QQmlEngine *engine, const QString &sourcePath, const QSt
static void initTestRows(QQmlEngine *engine)
{
addTestRows(engine, "controls", "QtQuick/Controls.2", QStringList() << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator");
+ addTestRows(engine, "controls/fusion", "QtQuick/Controls.2/Fusion", QStringList() << "ButtonPanel" << "CheckIndicator" << "RadioIndicator" << "SliderGroove" << "SliderHandle" << "SwitchIndicator");
addTestRows(engine, "controls/material", "QtQuick/Controls.2/Material", QStringList() << "Ripple" << "SliderHandle" << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator" << "BoxShadow" << "ElevationEffect" << "CursorDelegate");
addTestRows(engine, "controls/universal", "QtQuick/Controls.2/Universal", QStringList() << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator");
}