From 21b9e6ac7fbec381a8fe8cb08d043a340dbccc46 Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Mon, 19 Sep 2022 22:02:27 +0200 Subject: [PATCH] QmlDesigner: Add ProgressBar to StudioControls Change-Id: I2d79e4af008fe7ef66ebbe2bf31813230451ee18 Reviewed-by: Reviewed-by: Thomas Hartmann --- .../imports/StudioControls/ProgressBar.qml | 54 +++++++++++++++++++ .../imports/StudioControls/qmldir | 1 + 2 files changed, 55 insertions(+) create mode 100644 share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ProgressBar.qml diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ProgressBar.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ProgressBar.qml new file mode 100644 index 00000000000..01e2a3a1c55 --- /dev/null +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ProgressBar.qml @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** 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 General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick +import QtQuick.Templates as T +import StudioTheme 1.0 as StudioTheme + +T.ProgressBar { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + contentItem: Item { + implicitWidth: 200 + implicitHeight: 6 + + Rectangle { + width: control.visualPosition * parent.width + height: parent.height + color: StudioTheme.Values.themeInteraction + } + } + + background: Rectangle { + implicitWidth: 200 + implicitHeight: 6 + color: StudioTheme.Values.themeThumbnailLabelBackground + } +} diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/qmldir b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/qmldir index dbc558ca105..61c35a00490 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/qmldir +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/qmldir @@ -22,6 +22,7 @@ Menu 1.0 Menu.qml MenuItem 1.0 MenuItem.qml MenuItemWithIcon 1.0 MenuItemWithIcon.qml MenuSeparator 1.0 MenuSeparator.qml +ProgressBar 1.0 ProgressBar.qml RadioButton 1.0 RadioButton.qml RealSliderPopup 1.0 RealSliderPopup.qml RealSpinBox 1.0 RealSpinBox.qml