diff options
Diffstat (limited to 'src/imports/controls/material')
-rw-r--r-- | src/imports/controls/material/BusyIndicator.qml | 4 | ||||
-rw-r--r-- | src/imports/controls/material/CheckBox.qml | 2 | ||||
-rw-r--r-- | src/imports/controls/material/ComboBox.qml | 1 | ||||
-rw-r--r-- | src/imports/controls/material/Dial.qml | 2 | ||||
-rw-r--r-- | src/imports/controls/material/GroupBox.qml | 1 | ||||
-rw-r--r-- | src/imports/controls/material/LICENSE_ANGULARJS.txt | 19 | ||||
-rw-r--r-- | src/imports/controls/material/RadioButton.qml | 2 | ||||
-rw-r--r-- | src/imports/controls/material/ScrollBar.qml | 2 | ||||
-rw-r--r-- | src/imports/controls/material/ScrollIndicator.qml | 6 | ||||
-rw-r--r-- | src/imports/controls/material/SwipeView.qml | 1 | ||||
-rw-r--r-- | src/imports/controls/material/Switch.qml | 2 | ||||
-rw-r--r-- | src/imports/controls/material/ToolButton.qml | 2 | ||||
-rw-r--r-- | src/imports/controls/material/qquickmaterialbusyindicator.cpp | 24 | ||||
-rw-r--r-- | src/imports/controls/material/qquickmaterialbusyindicator_p.h | 4 | ||||
-rw-r--r-- | src/imports/controls/material/qt_attribution.json | 13 |
15 files changed, 64 insertions, 21 deletions
diff --git a/src/imports/controls/material/BusyIndicator.qml b/src/imports/controls/material/BusyIndicator.qml index d32b7299..a483e13e 100644 --- a/src/imports/controls/material/BusyIndicator.qml +++ b/src/imports/controls/material/BusyIndicator.qml @@ -52,8 +52,8 @@ T.BusyIndicator { implicitHeight: 48 color: control.Material.accentColor + running: control.running opacity: control.running ? 1 : 0 - visible: control.running || animator.running - Behavior on opacity { OpacityAnimator { id: animator; duration: 250 } } + Behavior on opacity { OpacityAnimator { duration: 250 } } } } diff --git a/src/imports/controls/material/CheckBox.qml b/src/imports/controls/material/CheckBox.qml index 64a89756..d5e65255 100644 --- a/src/imports/controls/material/CheckBox.qml +++ b/src/imports/controls/material/CheckBox.qml @@ -80,8 +80,6 @@ T.CheckBox { font: control.font color: control.enabled ? control.Material.foreground : control.Material.hintTextColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } } diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml index 79fbda4f..dd319ebc 100644 --- a/src/imports/controls/material/ComboBox.qml +++ b/src/imports/controls/material/ComboBox.qml @@ -92,7 +92,6 @@ T.ComboBox { color: control.enabled ? control.Material.foreground : control.Material.hintTextColor selectionColor: control.Material.accentColor selectedTextColor: control.Material.primaryHighlightedTextColor - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter cursorDelegate: CursorDelegate { } diff --git a/src/imports/controls/material/Dial.qml b/src/imports/controls/material/Dial.qml index 9d6969cf..cb0c3acc 100644 --- a/src/imports/controls/material/Dial.qml +++ b/src/imports/controls/material/Dial.qml @@ -57,8 +57,6 @@ T.Dial { } handle: SliderHandle { - id: handleItem - x: background.x + background.width / 2 - handle.width / 2 y: background.y + background.height / 2 - handle.height / 2 transform: [ diff --git a/src/imports/controls/material/GroupBox.qml b/src/imports/controls/material/GroupBox.qml index 55bcd71f..12f7eac4 100644 --- a/src/imports/controls/material/GroupBox.qml +++ b/src/imports/controls/material/GroupBox.qml @@ -62,7 +62,6 @@ T.GroupBox { font: control.font color: control.enabled ? control.Material.foreground : control.Material.hintTextColor elide: Text.ElideRight - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } diff --git a/src/imports/controls/material/LICENSE_ANGULARJS.txt b/src/imports/controls/material/LICENSE_ANGULARJS.txt new file mode 100644 index 00000000..c1f2a826 --- /dev/null +++ b/src/imports/controls/material/LICENSE_ANGULARJS.txt @@ -0,0 +1,19 @@ +Copyright (c) 2014-2016 Google, Inc. http://angularjs.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/imports/controls/material/RadioButton.qml b/src/imports/controls/material/RadioButton.qml index b16c4d99..9d2aaac8 100644 --- a/src/imports/controls/material/RadioButton.qml +++ b/src/imports/controls/material/RadioButton.qml @@ -80,8 +80,6 @@ T.RadioButton { font: control.font color: control.enabled ? control.Material.foreground : control.Material.hintTextColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } } diff --git a/src/imports/controls/material/ScrollBar.qml b/src/imports/controls/material/ScrollBar.qml index c782e6f7..2153cadc 100644 --- a/src/imports/controls/material/ScrollBar.qml +++ b/src/imports/controls/material/ScrollBar.qml @@ -50,8 +50,6 @@ T.ScrollBar { visible: control.policy !== T.ScrollBar.AlwaysOff contentItem: Rectangle { - id: handle - implicitWidth: control.interactive ? 13 : 4 implicitHeight: control.interactive ? 13 : 4 diff --git a/src/imports/controls/material/ScrollIndicator.qml b/src/imports/controls/material/ScrollIndicator.qml index 7664500a..f0889782 100644 --- a/src/imports/controls/material/ScrollIndicator.qml +++ b/src/imports/controls/material/ScrollIndicator.qml @@ -49,8 +49,6 @@ T.ScrollIndicator { padding: 2 contentItem: Rectangle { - id: indicator - implicitWidth: 4 implicitHeight: 4 @@ -61,7 +59,7 @@ T.ScrollIndicator { states: State { name: "active" when: control.active - PropertyChanges { target: indicator; opacity: 0.75 } + PropertyChanges { target: control.contentItem; opacity: 0.75 } } transitions: [ @@ -69,7 +67,7 @@ T.ScrollIndicator { from: "active" SequentialAnimation { PauseAnimation { duration: 450 } - NumberAnimation { target: indicator; duration: 200; property: "opacity"; to: 0.0 } + NumberAnimation { target: control.contentItem; duration: 200; property: "opacity"; to: 0.0 } } } ] diff --git a/src/imports/controls/material/SwipeView.qml b/src/imports/controls/material/SwipeView.qml index 78e25aab..7fc8b915 100644 --- a/src/imports/controls/material/SwipeView.qml +++ b/src/imports/controls/material/SwipeView.qml @@ -60,5 +60,6 @@ T.SwipeView { preferredHighlightBegin: 0 preferredHighlightEnd: 0 highlightMoveDuration: 250 + maximumFlickVelocity: 4 * (control.orientation === Qt.Horizontal ? width : height) } } diff --git a/src/imports/controls/material/Switch.qml b/src/imports/controls/material/Switch.qml index d41c8579..9183f8c8 100644 --- a/src/imports/controls/material/Switch.qml +++ b/src/imports/controls/material/Switch.qml @@ -75,8 +75,6 @@ T.Switch { font: control.font color: control.enabled ? control.Material.foreground : control.Material.hintTextColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } } diff --git a/src/imports/controls/material/ToolButton.qml b/src/imports/controls/material/ToolButton.qml index c67523ae..b8f7a4ef 100644 --- a/src/imports/controls/material/ToolButton.qml +++ b/src/imports/controls/material/ToolButton.qml @@ -73,7 +73,7 @@ T.ToolButton { implicitWidth: 48 implicitHeight: 48 - readonly property bool square: control.contentItem.implicitWidth <= control.contentItem.implicitHeight + readonly property bool square: control.contentItem.width <= control.contentItem.height x: (parent.width - width) / 2 y: (parent.height - height) / 2 diff --git a/src/imports/controls/material/qquickmaterialbusyindicator.cpp b/src/imports/controls/material/qquickmaterialbusyindicator.cpp index 9df8f5d2..bd15390b 100644 --- a/src/imports/controls/material/qquickmaterialbusyindicator.cpp +++ b/src/imports/controls/material/qquickmaterialbusyindicator.cpp @@ -197,6 +197,17 @@ void QQuickMaterialBusyIndicator::setColor(QColor color) update(); } +bool QQuickMaterialBusyIndicator::isRunning() const +{ + return isVisible(); +} + +void QQuickMaterialBusyIndicator::setRunning(bool running) +{ + if (running) + setVisible(true); +} + int QQuickMaterialBusyIndicator::elapsed() const { return m_elapsed; @@ -205,14 +216,23 @@ int QQuickMaterialBusyIndicator::elapsed() const void QQuickMaterialBusyIndicator::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) { QQuickItem::itemChange(change, data); - if (change == ItemVisibleHasChanged) + switch (change) { + case ItemOpacityHasChanged: + if (qFuzzyIsNull(data.realValue)) + setVisible(false); + break; + case ItemVisibleHasChanged: update(); + break; + default: + break; + } } QSGNode *QQuickMaterialBusyIndicator::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) { QQuickMaterialBusyIndicatorNode *node = static_cast<QQuickMaterialBusyIndicatorNode *>(oldNode); - if (isVisible() && width() > 0 && height() > 0) { + if (isRunning() && width() > 0 && height() > 0) { if (!node) { node = new QQuickMaterialBusyIndicatorNode(this); node->start(); diff --git a/src/imports/controls/material/qquickmaterialbusyindicator_p.h b/src/imports/controls/material/qquickmaterialbusyindicator_p.h index da84c7b1..6c6d2445 100644 --- a/src/imports/controls/material/qquickmaterialbusyindicator_p.h +++ b/src/imports/controls/material/qquickmaterialbusyindicator_p.h @@ -57,6 +57,7 @@ class QQuickMaterialBusyIndicator : public QQuickItem { Q_OBJECT Q_PROPERTY(QColor color READ color WRITE setColor FINAL) + Q_PROPERTY(bool running READ isRunning WRITE setRunning FINAL) public: explicit QQuickMaterialBusyIndicator(QQuickItem *parent = nullptr); @@ -64,6 +65,9 @@ public: QColor color() const; void setColor(QColor color); + bool isRunning() const; + void setRunning(bool running); + int elapsed() const; protected: diff --git a/src/imports/controls/material/qt_attribution.json b/src/imports/controls/material/qt_attribution.json new file mode 100644 index 00000000..01b45e9f --- /dev/null +++ b/src/imports/controls/material/qt_attribution.json @@ -0,0 +1,13 @@ +{ + "Id": "shadow_angular_material", + "Name": "Shadow values from Angular Material", + "QDocModule": "qtquickcontrols2", + "QtUsage": "Used in the Material Style of Qt Quick Controls 2.", + "Files": "ElevationEffect.qml", + "Description": "Shadow values for the elevation effect.", + "Homepage": "https://angularjs.org/", + "License": "MIT License", + "LicenseId": "MIT", + "LicenseFile": "LICENSE_ANGULARJS.txt", + "Copyright": "Copyright (c) 2014-2016 Google, Inc" +} |