From b0d5dd8d4bd6e890e571080e41b93e18cec0b527 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 30 Jan 2019 15:13:16 +0100 Subject: [PATCH] QmlDesigner: Remove unused QML files Change-Id: Ica20f3029cdc66f1917c738ad5f339930c62cc35 Reviewed-by: Alessandro Portale --- .../timelineeditor/qml/BezierCanvas.qml | 416 ------------------ .../timelineeditor/qml/EasingUI.qml | 368 ---------------- .../timelineeditor/qml/StyledButton.qml | 55 --- .../timelineeditor/timeline.qrc | 3 - 4 files changed, 842 deletions(-) delete mode 100644 src/plugins/qmldesigner/qmldesignerextension/timelineeditor/qml/BezierCanvas.qml delete mode 100644 src/plugins/qmldesigner/qmldesignerextension/timelineeditor/qml/EasingUI.qml delete mode 100644 src/plugins/qmldesigner/qmldesignerextension/timelineeditor/qml/StyledButton.qml diff --git a/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/qml/BezierCanvas.qml b/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/qml/BezierCanvas.qml deleted file mode 100644 index a2c1073d0ab..00000000000 --- a/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/qml/BezierCanvas.qml +++ /dev/null @@ -1,416 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 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 2.6 -import QtQuickDesignerTheme 1.0 - -Item { - - id: root - property alias color: background.color - width: 110 - height: 110 - - Rectangle { - id: background - color: Theme.qmlDesignerBackgroundColorDarker() - anchors.fill: parent - anchors.rightMargin: 4 - anchors.bottomMargin: 5 - anchors.leftMargin: 2 - } - - - property bool interactive: true - - property alias bezierCurve: canvas.curve - - property alias caption: label.text - - property color handleColor: "#d5d251" - property color bezierColor: Theme.color(Theme.PanelTextColorLight) - property color textColor: Theme.color(Theme.PanelTextColorLight) - - property real bezierLineWidth: 2 - property real handleLineWidth: 1 - - signal clicked - - Text { - x: -7 - y: 3 - color: root.textColor - text: qsTr("value") - visible: root.interactive - rotation: 90 - font.pixelSize: 5 - } - - Text { - x: 105 - width - y: 112 - height - color: root.textColor - text: qsTr("time") - visible: root.interactive - font.pixelSize: 5 - } - - Canvas { - id: canvas - - width:110 - height:110 - property real bezierLineWidth: root.bezierLineWidth * 2 - property real handleLineWidth: root.handleLineWidth - property color strokeStyle: root.bezierColor - property color secondaryStrokeStyle: root.handleColor - antialiasing: true - onStrokeStyleChanged:requestPaint(); - - property string curve: "0,0,1,1" - - function curveToBezier() - { - var res = canvas.curve.split(","); - - var array = [res[0], res[1], res[2], res[3], 1, 1]; - return array; - } - - Component.onCompleted: { - var old = curve - curve = "" - curve = old - } - property bool block: false - onCurveChanged: { - textEdit.text = curve - if (canvas.block) - return - - var res = canvas.curve.split(","); - - control1.x = res[0] * 100 - 5 - control1.y = (1 - res[1]) * 100 - 5 - control2.x = res[2] * 100 - 5 - control2.y = (1 - res[3]) * 100 - 5 - } - - function curveFromControls() - { - canvas.block = true - canvas.curve = ((control1.x + 5) / 100).toFixed(2) +","+(1 - (control1.y + 5) / 100).toFixed(2) +"," - + ((control2.x + 5) / 100).toFixed(2) +","+(1 - (control2.y + 5) / 100).toFixed(2) - canvas.block = false - } - - onPaint: { - var ctx = canvas.getContext('2d'); - ctx.save(); - ctx.clearRect(0, 0, canvas.width, canvas.height); - ctx.translate(4, 4); - - var res = canvas.curve.split(","); - - ctx.lineWidth = canvas.handleLineWidth; - - ctx.strokeStyle = canvas.secondaryStrokeStyle; - - ctx.beginPath(); - ctx.moveTo(0,100); - ctx.lineTo(control1.x+5,control1.y+5); - ctx.stroke(); - - ctx.beginPath(); - ctx.moveTo(100,0); - ctx.lineTo(control2.x+5,control2.y+5); - ctx.stroke(); - - ctx.strokeStyle = canvas.strokeStyle; - ctx.lineWidth = canvas.bezierLineWidth; - - ctx.beginPath(); - ctx.moveTo(0,100); - ctx.bezierCurveTo(res[0]*100,(1-res[1])*100,res[2]*100,(1-res[3])*100, 100, 0); - - ctx.stroke(); - ctx.restore(); - } - } - MouseArea { - //visible: !root.interactive - anchors.fill: parent - onClicked: root.clicked() - onDoubleClicked: animation.start() - SequentialAnimation { - id: animation - loops: 1 - running: false - - PropertyAction { - target: animationIndicator - property: "visible" - value: true - } - ParallelAnimation { - PropertyAnimation { - duration: 800 - target: animationIndicator - property: "x" - from: -5 - to: 95 - - } - - PropertyAnimation { - duration: 800 - target: animationIndicator - property: "y" - from: 95 - to: -5 - easing.bezierCurve: canvas.curveToBezier() - } - } - PropertyAction { - target: animationIndicator - property: "visible" - value: false - } - } - } - - Item { - width: 100 - height: 100 - x: 5 - y: 5 - - Rectangle { - visible: root.interactive - id: control1 - color: root.handleColor - width: 8 - height: 8 - radius: 4 - x: -4 - y: 96 - - onXChanged: { - if (mirrorShift) - control2.x = 96 - x - 4 - if (mirrorControl) - control2.x = y - - canvas.curveFromControls() - canvas.requestPaint() - } - onYChanged: { - if (mirrorShift) - control2.y = 96 - y - 4 - if (mirrorControl) - control2.y = x - - canvas.curveFromControls() - canvas.requestPaint() - } - property bool mirrorShift: false - property bool mirrorControl: false - - - - MouseArea { - anchors.fill: parent - - drag.target: parent - drag.maximumX: 95 - drag.maximumY: 95 - drag.minimumX: -5 - drag.minimumY: -5 - - onPressed: { - if ((mouse.button == Qt.LeftButton) && (mouse.modifiers & Qt.ShiftModifier)) { - parent.mirrorShift = true - } else if ((mouse.button == Qt.LeftButton) && (mouse.modifiers & Qt.ControlModifier)) { - parent.mirrorControl = true - } else { - parent.mirrorShift = false - } - } - onReleased: { - parent.mirrorControl = false - parent.mirrorShift = false - } - } - } - - Rectangle { - color: root.handleColor - width: radius * 2 - height: radius * 2 - radius: root.interactive ? 3 : 4 - y: -4 - x: 96 - } - - Rectangle { - color: root.handleColor - width: radius * 2 - height: radius * 2 - radius: root.interactive ? 3 : 4 - x: -4 - y: 96 - } - - - Rectangle { - visible: root.interactive - id: control2 - color: root.handleColor - width: 8 - height: 8 - radius: 4 - y: -5 - x: 5 - onXChanged: { - if (mirrorShift) - control1.x = 96 - x - 4 - if (mirrorControl) - control1.x = y - canvas.curveFromControls() - canvas.requestPaint() - } - onYChanged: { - if (mirrorShift) - control1.y = 96 - y -4 - if (mirrorControl) - control1.y = x - canvas.curveFromControls() - canvas.requestPaint() - } - property bool mirrorShift: false - property bool mirrorControl: false - - - MouseArea { - anchors.fill: parent - - drag.target: parent - drag.maximumX: 95 - drag.maximumY: 95 - drag.minimumX: -5 - drag.minimumY: -5 - onPressed: { - if ((mouse.button == Qt.LeftButton) && (mouse.modifiers & Qt.ShiftModifier)) { - parent.mirrorShift = true - } else if ((mouse.button == Qt.LeftButton) && (mouse.modifiers & Qt.ControlModifier)) { - parent.mirrorControl = true - } else { - parent.mirrorShift = false - } - } - onReleased: { - parent.mirrorControl = false - parent.mirrorShift = false - } - } - } - - Rectangle { - visible: animationIndicator.visible - color: animationIndicator.color - height: 1 - x: -2 - width: animationIndicator.x + 2 - y: animationIndicator.y + 2 - } - - Rectangle { - visible: animationIndicator.visible - color: animationIndicator.color - height: 1 - x: animationIndicator.x - 2 - width: 120 - animationIndicator.x - y: animationIndicator.y + 2 - } - - Rectangle { - visible: animationIndicator.visible - color: animationIndicator.color - width: 1 - y: -2 - height: animationIndicator.y + 2 - x: animationIndicator.x + 2 - } - - Rectangle { - visible: animationIndicator.visible - color: animationIndicator.color - width: 1 - y: animationIndicator.y - 2 - height: 110 - animationIndicator.y - x: animationIndicator.x + 2 - } - - Rectangle { - x: 5 - y: 5 - id: animationIndicator - visible: false - color: Theme.color(Theme.QmlDesigner_HighlightColor) - width: 4 - height: 4 - radius: 2 - } - } - - TextInput { - visible: false - id: textEdit - - height: 24 - anchors.right: parent.right - anchors.left: parent.left - anchors.top: parent.bottom - color: root.textColor - horizontalAlignment: Text.AlignHCenter - anchors.topMargin: -20 - onEditingFinished: canvas.curve = text - } - - Text { - id: label - visible: !root.interactive - height: 24 - anchors.right: parent.right - anchors.left: parent.left - anchors.top: parent.bottom - color: root.textColor - horizontalAlignment: Text.AlignHCenter - anchors.topMargin: -2 - font.pixelSize: 16 - - } - -} diff --git a/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/qml/EasingUI.qml b/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/qml/EasingUI.qml deleted file mode 100644 index b6afee41e92..00000000000 --- a/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/qml/EasingUI.qml +++ /dev/null @@ -1,368 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 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 2.6 -import QtQuick.Controls 2.2 -import QtQuick.Layouts 1.2 -import QtQuickDesignerTheme 1.0 - -Rectangle { - id: root - - width: 640 - height: 200 - color: Theme.color(Theme.BackgroundColorDark) - - property string bezierCurve - - onBezierCurveChanged: bezierCanvas.bezierCurve = bezierCurve - - signal okClicked - signal cancelClicked - - focus: true - - Keys.onPressed: { - if (event.key === Qt.Key_Escape) - root.cancelClicked() - else if (event.key === Qt.Key_Return) - root.okClicked() - } - - TextInput { - id: textEdit - - anchors.left: parent.left - anchors.bottom: parent.bottom - color: Theme.color(Theme.PanelTextColorLight) - horizontalAlignment: Text.AlignHCenter - anchors.bottomMargin: 2 - anchors.leftMargin: 10 - onEditingFinished: bezierCanvas.bezierCurve = text - } - - RowLayout { - id: contentLayout - anchors.fill: parent - - anchors.rightMargin: 10 - anchors.leftMargin: 8 - anchors.topMargin: 10 - anchors.bottomMargin: 20 - - Item { - Layout.preferredWidth: 215 - Layout.preferredHeight: 220 - - Layout.alignment: Qt.AlignLeft | Qt.AlignTop - - BezierCanvas { - id: bezierCanvas - scale: 2 - transformOrigin: Item.TopLeft - bezierLineWidth: 1 - handleLineWidth: 0.8 - onBezierCurveChanged: { - textEdit.text = bezierCanvas.bezierCurve - root.bezierCurve = bezierCanvas.bezierCurve - } - } - } - - - Rectangle { - Layout.fillWidth: true - Layout.fillHeight: true - Layout.bottomMargin: 10 - Layout.leftMargin: 5 - - color: Theme.qmlDesignerBackgroundColorDarker() - - ScrollView { - anchors.fill: parent - - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - ScrollBar.vertical.policy: ScrollBar.AlwaysOff - - GridView { - interactive: true - - anchors.fill: parent - anchors.leftMargin: 4 - anchors.topMargin: 4 - anchors.bottomMargin: 4 - anchors.rightMargin: 2 - - clip: true - - ScrollBar.vertical: ScrollBar { - x: 1 - width: 10 - readonly property color scrollbarColor: Theme.color(Theme.BackgroundColorDark) - readonly property color scrollBarHandleColor: Theme.qmlDesignerButtonColor() - contentItem: Item { - width: 4 - Rectangle { - anchors.fill: parent - anchors.margins: 0 - color: Theme.qmlDesignerButtonColor() - } - } - background: Rectangle { - color: Theme.color(Theme.BackgroundColorDark) - border.width: 2 - border.color: Theme.qmlDesignerBackgroundColorDarker() - } - } - - model: ListModel { - - ListElement { - name: "linear" - curve: "0.250, 0.250, 0.750, 0.750" - } - - ListElement { - name: "ease in out" - curve: "0.420, 0.000, 0.580, 1.000" - } - - ListElement { - name: "ease" - curve: "0.250, 0.100, 0.250, 1.00" - } - - ListElement { - name: "ease in" - curve: "0.420, 0.00, 1.00, 1.00" - } - - ListElement { - name: "ease out" - curve: "0.00, 0.00, 0.580, 1.00" - } - - ListElement { - name: "quad in out" - curve: "0.455, 0.030, 0.515, 0.955" - } - - ListElement { - name: "quad in" - curve: "0.550, 0.085, 0.680, 0.530" - } - - ListElement { - name: "quad out" - curve: "0.250, 0.460, 0.450, 0.940" - } - - ListElement { - name: "quad ease" - curve: "0.550, 0.085, 0.680, 0.530" - } - - ListElement { - name: "cubic in out" - curve: "0.645, 0.045, 0.355, 1.00" - } - - ListElement { - name: "cubic in" - curve: "0.550, 0.055, 0.675, 0.190" - } - - ListElement { - name: "cubic out" - curve: "0.215, 0.610, 0.355, 1.00" - } - - ListElement { - name: "quart in out" - curve: "0.770, 0.000, 0.175, 1.00" - } - - ListElement { - name: "quart in" - curve: "0.895, 0.030, 0.685, 0.220" - } - - ListElement { - name: "quart out" - curve: "0.165, 0.840, 0.440, 1.00" - } - - ListElement { - name: "quint in out" - curve: "0.860, 0.000, 0.070, 1.00" - } - - ListElement { - name: "quint in" - curve: "0.755, 0.050, 0.855, 0.060" - } - - ListElement { - name: "quint out" - curve: "0.230, 1.000, 0.320, 1.00" - } - - ListElement { - name: "expo in out" - curve: "1.000, 0.000, 0.000, 1.000" - } - - ListElement { - name: "expo in" - curve: "0.950, 0.050, 0.795, 0.035" - } - - ListElement { - name: "expo out" - curve: "0.190, 1.000, 0.220, 1.000" - } - - ListElement { - name: "circ in out" - curve: "0.785, 0.135, 0.150, 0.860" - } - - ListElement { - name: "circ in" - curve: "0.600, 0.040, 0.980, 0.335" - } - - ListElement { - name: "circ out" - curve: "0.075, 0.820, 0.165, 1.00" - } - - ListElement { - name: "back in out" - curve: "0.680, -0.550, 0.265, 1.550" - } - - ListElement { - name: "back in" - curve: "0.600, -0.280, 0.735, 0.045" - } - - ListElement { - name: "back out" - curve: "0.175, 0.885, 0.320, 1.275" - } - - ListElement { - name: "standard" - curve: "0.40,0.00,0.20,1.00" - } - - ListElement { - name: "deceleration" - curve: "0.00,0.00,0.20,1.00" - } - - ListElement { - name: "acceleration" - curve: "0.40,0.00,1.00,1.00" - } - - ListElement { - name: "sharp" - curve: "0.40,0.00,0.60,1.00" - } - - ListElement { - name: "sine in out" - curve: "0.445, 0.05, 0.55, 0.95" - } - - ListElement { - name: "sine in" - curve: "0.470, 0.00, 0.745, 0.715" - } - - ListElement { - name: "sine out" - curve: "0.39, 0.575, 0.565, 1.00" - } - - } - - cellHeight: 68 - cellWidth: 68 - delegate: Rectangle { - width: 64 - height: 64 - color: Theme.color(Theme.BackgroundColorDark) - - Rectangle { - color: Theme.qmlDesignerBackgroundColorDarkAlternate() - width: 64 - anchors.bottom: parent.bottom - height: 11 - } - - BezierCanvas { - x: 4 - y: 0 - scale: 0.5 - transformOrigin: Item.TopLeft - caption: name - bezierCurve: curve - interactive: false - onClicked: bezierCanvas.bezierCurve = curve - color: Theme.color(Theme.BackgroundColorDark) - } - } - } - - } - } - } - - RowLayout { - height: 30 - anchors.bottom: parent.bottom - anchors.right: parent.right - - anchors.rightMargin: 10 - Layout.bottomMargin: 0 - - StyledButton { - text: qsTr("Cancel") - onClicked: root.cancelClicked() - } - - StyledButton { - text: qsTr("Apply") - onClicked: root.okClicked() - } - } -} - - - - diff --git a/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/qml/StyledButton.qml b/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/qml/StyledButton.qml deleted file mode 100644 index 779c4d0954c..00000000000 --- a/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/qml/StyledButton.qml +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 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 2.6 -import QtQuick.Controls 2.2 -import QtQuickDesignerTheme 1.0 - -Button { - id: control - text: qsTr("") - - font.pixelSize: 12 - topPadding: 0.5 - bottomPadding: 0.5 - - contentItem: Text { - color: Theme.color(Theme.PanelTextColorLight) - text: control.text - font: control.font - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - - background: Rectangle { - implicitWidth: 70 - implicitHeight: 20 - color: Theme.qmlDesignerButtonColor() - radius: 3 - - border.width: 1 - border.color: Theme.qmlDesignerBackgroundColorDarker() - } -} diff --git a/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timeline.qrc b/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timeline.qrc index ada8db8cdd8..b793c1f8dac 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timeline.qrc +++ b/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timeline.qrc @@ -57,9 +57,6 @@ images/to_first_frame@2x.png images/to_last_frame.png images/to_last_frame@2x.png - qml/BezierCanvas.qml - qml/EasingUI.qml - qml/StyledButton.qml images/pause_playback.png images/pause_playback@2x.png images/playhead.png