aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/controls')
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-tabbar-flickable.pngbin0 -> 3349 bytes
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-tabbar-flickable.qml50
-rw-r--r--src/imports/controls/material/qquickmaterialprogressring.cpp22
-rw-r--r--src/imports/controls/universal/TextArea.qml3
-rw-r--r--src/imports/controls/universal/TextField.qml3
5 files changed, 64 insertions, 14 deletions
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-tabbar-flickable.png b/src/imports/controls/doc/images/qtquickcontrols2-tabbar-flickable.png
new file mode 100644
index 00000000..ede59233
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-tabbar-flickable.png
Binary files differ
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar-flickable.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar-flickable.qml
new file mode 100644
index 00000000..2a4fac0e
--- /dev/null
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tabbar-flickable.qml
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://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: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.6
+import QtQuick.Controls 2.0
+
+Item {
+ width: 360
+ height: bar.height
+
+//! [1]
+TabBar {
+ id: bar
+ width: parent.width
+
+ Repeater {
+ model: ["First", "Second", "Third", "Fourth", "Fifth"]
+
+ TabButton {
+ text: modelData
+ width: Math.max(100, bar.width / 5)
+ }
+ }
+}
+//! [1]
+}
diff --git a/src/imports/controls/material/qquickmaterialprogressring.cpp b/src/imports/controls/material/qquickmaterialprogressring.cpp
index aec92631..a3564c17 100644
--- a/src/imports/controls/material/qquickmaterialprogressring.cpp
+++ b/src/imports/controls/material/qquickmaterialprogressring.cpp
@@ -74,6 +74,8 @@ public:
void afterNodeSync() override;
private:
+ int m_lastStartAngle;
+ int m_lastEndAngle;
qreal m_devicePixelRatio;
QSGNode *m_containerNode;
QQuickWindow *m_window;
@@ -155,6 +157,8 @@ QQuickAnimatorJob *QQuickMaterialRingAnimator::createJob() const
}
QQuickMaterialRingAnimatorJob::QQuickMaterialRingAnimatorJob() :
+ m_lastStartAngle(0),
+ m_lastEndAngle(0),
m_devicePixelRatio(1.0),
m_containerNode(nullptr),
m_window(nullptr)
@@ -203,27 +207,25 @@ void QQuickMaterialRingAnimatorJob::updateCurrentTime(int time)
const int iteration = time / spanAnimationDuration;
int startAngle = 0;
int endAngle = 0;
- static int lastStartAngle = 0;
- static int lastEndAngle = 0;
if (iteration % 2 == 0) {
- if (lastStartAngle > 360 * oneDegree) {
- lastStartAngle -= 360 * oneDegree;
+ if (m_lastStartAngle > 360 * oneDegree) {
+ m_lastStartAngle -= 360 * oneDegree;
}
// The start angle is only affected by the rotation animation for the "grow" phase.
- startAngle = lastStartAngle;
+ startAngle = m_lastStartAngle;
QEasingCurve angleCurve(QEasingCurve::OutQuad);
const qreal percentage = angleCurve.valueForProgress(spanPercentageComplete);
- endAngle = lastStartAngle + minSweepSpan + percentage * (maxSweepSpan - minSweepSpan);
- lastEndAngle = endAngle;
+ endAngle = m_lastStartAngle + minSweepSpan + percentage * (maxSweepSpan - minSweepSpan);
+ m_lastEndAngle = endAngle;
} else {
// Both the start angle *and* the span are affected by the "shrink" phase.
QEasingCurve angleCurve(QEasingCurve::InQuad);
const qreal percentage = angleCurve.valueForProgress(spanPercentageComplete);
- startAngle = lastEndAngle - maxSweepSpan + percentage * (maxSweepSpan - minSweepSpan);
- endAngle = lastEndAngle;
- lastStartAngle = startAngle;
+ startAngle = m_lastEndAngle - maxSweepSpan + percentage * (maxSweepSpan - minSweepSpan);
+ endAngle = m_lastEndAngle;
+ m_lastStartAngle = startAngle;
}
const int halfPen = pen.width() / 2;
diff --git a/src/imports/controls/universal/TextArea.qml b/src/imports/controls/universal/TextArea.qml
index 96d3cc13..0e2953ed 100644
--- a/src/imports/controls/universal/TextArea.qml
+++ b/src/imports/controls/universal/TextArea.qml
@@ -58,8 +58,7 @@ T.TextArea {
Universal.theme: activeFocus ? Universal.Light : undefined
- color: !enabled ? Universal.chromeDisabledLowColor :
- activeFocus ? Universal.chromeBlackHighColor : Universal.foreground
+ color: !enabled ? Universal.chromeDisabledLowColor : Universal.foreground
selectionColor: Universal.accent
selectedTextColor: Universal.chromeWhiteColor
diff --git a/src/imports/controls/universal/TextField.qml b/src/imports/controls/universal/TextField.qml
index ba24a155..88bc4fc9 100644
--- a/src/imports/controls/universal/TextField.qml
+++ b/src/imports/controls/universal/TextField.qml
@@ -58,8 +58,7 @@ T.TextField {
Universal.theme: activeFocus ? Universal.Light : undefined
- color: !enabled ? Universal.chromeDisabledLowColor :
- activeFocus ? Universal.chromeBlackHighColor : Universal.foreground
+ color: !enabled ? Universal.chromeDisabledLowColor : Universal.foreground
selectionColor: Universal.accent
selectedTextColor: Universal.chromeWhiteColor
verticalAlignment: TextInput.AlignVCenter