diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-03-17 09:54:04 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-03-17 09:54:04 +0100 |
commit | f52b95a96cc8f36f766635f9ddb6c95fa6b3c934 (patch) | |
tree | 0a74d23575ae74e93a7b2dedb7a03827c42e8266 /src/imports/controls/imagine | |
parent | 2bd4f5cd587e258227c69b3124757d7b8e019c9f (diff) | |
parent | 7da5842647f75fd990f69f400f75d9b090e39306 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: Ieb9bcfba9651d646509afd065ce2389ef74448cc
Diffstat (limited to 'src/imports/controls/imagine')
-rw-r--r-- | src/imports/controls/imagine/ComboBox.qml | 13 | ||||
-rw-r--r-- | src/imports/controls/imagine/Dial.qml | 3 | ||||
-rw-r--r-- | src/imports/controls/imagine/HorizontalHeaderView.qml | 66 | ||||
-rw-r--r-- | src/imports/controls/imagine/VerticalHeaderView.qml | 66 | ||||
-rw-r--r-- | src/imports/controls/imagine/imagine.pri | 4 | ||||
-rw-r--r-- | src/imports/controls/imagine/qquickimaginestyle.cpp | 2 |
6 files changed, 145 insertions, 9 deletions
diff --git a/src/imports/controls/imagine/ComboBox.qml b/src/imports/controls/imagine/ComboBox.qml index 2d582e98..92937826 100644 --- a/src/imports/controls/imagine/ComboBox.qml +++ b/src/imports/controls/imagine/ComboBox.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.14 -import QtQuick.Window 2.14 -import QtQuick.Templates 2.14 as T -import QtQuick.Controls 2.14 -import QtQuick.Controls.Imagine 2.14 -import QtQuick.Controls.Imagine.impl 2.14 +import QtQuick 2.15 +import QtQuick.Window 2.15 +import QtQuick.Templates 2.15 as T +import QtQuick.Controls 2.15 +import QtQuick.Controls.Imagine 2.15 +import QtQuick.Controls.Imagine.impl 2.15 T.ComboBox { id: control @@ -98,6 +98,7 @@ T.ComboBox { readOnly: control.down inputMethodHints: control.inputMethodHints validator: control.validator + selectByMouse: control.selectTextByMouse font: control.font color: control.flat ? control.palette.windowText : control.editable ? control.palette.text : control.palette.buttonText diff --git a/src/imports/controls/imagine/Dial.qml b/src/imports/controls/imagine/Dial.qml index f10634e6..f8c394f3 100644 --- a/src/imports/controls/imagine/Dial.qml +++ b/src/imports/controls/imagine/Dial.qml @@ -74,7 +74,7 @@ T.Dial { transform: [ Translate { - y: -background.height * 0.4 + handle.height / 2 + y: -Math.min(control.background.width, control.background.height) * 0.4 + control.handle.height / 2 }, Rotation { angle: control.angle @@ -89,6 +89,7 @@ T.Dial { y: control.height / 2 - height / 2 width: Math.max(64, Math.min(control.width, control.height)) height: width + fillMode: Image.PreserveAspectFit source: Imagine.url + "dial-background" NinePatchImageSelector on source { diff --git a/src/imports/controls/imagine/HorizontalHeaderView.qml b/src/imports/controls/imagine/HorizontalHeaderView.qml new file mode 100644 index 00000000..7f0454da --- /dev/null +++ b/src/imports/controls/imagine/HorizontalHeaderView.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2020 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.15 +import QtQuick.Controls 2.15 +import QtQuick.Templates 2.15 as T + +T.HorizontalHeaderView { + id: control + + implicitWidth: syncView ? syncView.width : 0 + implicitHeight: contentHeight + + delegate: Rectangle { + // Qt6: add cellPadding (and font etc) as public API in headerview + readonly property real cellPadding: 8 + + implicitWidth: text.implicitWidth + (cellPadding * 2) + implicitHeight: Math.max(control.height, text.implicitHeight + (cellPadding * 2)) + color: "#f6f6f6" + border.color: "#e4e4e4" + + Text { + id: text + text: model[control.textRole] + width: parent.width + height: parent.height + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + color: "#ff26282a" + } + } +} diff --git a/src/imports/controls/imagine/VerticalHeaderView.qml b/src/imports/controls/imagine/VerticalHeaderView.qml new file mode 100644 index 00000000..5fbfaedf --- /dev/null +++ b/src/imports/controls/imagine/VerticalHeaderView.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2020 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.15 +import QtQuick.Controls 2.15 +import QtQuick.Templates 2.15 as T + +T.VerticalHeaderView { + id: control + + implicitWidth: contentWidth + implicitHeight: syncView ? syncView.height : 0 + + delegate: Rectangle { + // Qt6: add cellPadding (and font etc) as public API in headerview + readonly property real cellPadding: 8 + + implicitWidth: Math.max(control.width, text.implicitWidth + (cellPadding * 2)) + implicitHeight: text.implicitHeight + (cellPadding * 2) + color: "#f6f6f6" + border.color: "#e4e4e4" + + Text { + id: text + text: model[control.textRole] + width: parent.width + height: parent.height + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + color: "#ff26282a" + } + } +} diff --git a/src/imports/controls/imagine/imagine.pri b/src/imports/controls/imagine/imagine.pri index 081a509e..4c6bcf1b 100644 --- a/src/imports/controls/imagine/imagine.pri +++ b/src/imports/controls/imagine/imagine.pri @@ -12,6 +12,7 @@ QML_FILES += \ $$PWD/Drawer.qml \ $$PWD/Frame.qml \ $$PWD/GroupBox.qml \ + $$PWD/HorizontalHeaderView.qml \ $$PWD/ItemDelegate.qml \ $$PWD/Label.qml \ $$PWD/Menu.qml \ @@ -44,7 +45,8 @@ QML_FILES += \ $$PWD/ToolButton.qml \ $$PWD/ToolSeparator.qml \ $$PWD/ToolTip.qml \ - $$PWD/Tumbler.qml + $$PWD/Tumbler.qml \ + $$PWD/VerticalHeaderView.qml HEADERS += \ $$PWD/qquickimageselector_p.h \ diff --git a/src/imports/controls/imagine/qquickimaginestyle.cpp b/src/imports/controls/imagine/qquickimaginestyle.cpp index 9e1431de..745bef10 100644 --- a/src/imports/controls/imagine/qquickimaginestyle.cpp +++ b/src/imports/controls/imagine/qquickimaginestyle.cpp @@ -43,7 +43,7 @@ QT_BEGIN_NAMESPACE Q_GLOBAL_STATIC_WITH_ARGS(QString, GlobalPath, (QLatin1String("qrc:/qt-project.org/imports/QtQuick/Controls.2/Imagine/images/"))) -static const QString ensureSlash(const QString &path) +static QString ensureSlash(const QString &path) { const QChar slash = QLatin1Char('/'); return path.endsWith(slash) ? path : path + slash; |