From 0bf5c64b0604c765c2e6b18cfac4e9c448380f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tinkl?= Date: Tue, 6 Jun 2023 18:35:00 +0200 Subject: [PATCH] chore: removed unused components 0xdeadbeef --- .../AppLayouts/UIComponents/UIComponents.qml | 197 ------------------ .../shared/panels/NotificationWindow.qml | 110 ---------- ui/imports/shared/popups/ToastMessage.qml | 160 -------------- 3 files changed, 467 deletions(-) delete mode 100644 ui/app/AppLayouts/UIComponents/UIComponents.qml delete mode 100644 ui/imports/shared/panels/NotificationWindow.qml delete mode 100644 ui/imports/shared/popups/ToastMessage.qml diff --git a/ui/app/AppLayouts/UIComponents/UIComponents.qml b/ui/app/AppLayouts/UIComponents/UIComponents.qml deleted file mode 100644 index d5973ce72f..0000000000 --- a/ui/app/AppLayouts/UIComponents/UIComponents.qml +++ /dev/null @@ -1,197 +0,0 @@ -import QtQuick 2.13 -import QtQuick.Controls 2.13 -import QtQuick.Layouts 1.13 - -import utils 1.0 -import shared 1.0 -import shared.panels 1.0 -import shared.status 1.0 - - -Item { - id: uiComponentCatalog - Layout.fillHeight: true - Layout.fillWidth: true - - ColumnLayout { - id: buttons - spacing: 6 - width: parent.width - - RowLayout { - Text { - text: "Buttons" - } - } - - /* Commented due to high cpu usage */ - /* - RowLayout { - StatusButton { - text: "Primary Large Button" - } - - StatusButton { - text: "Secondary Large Button" - type: "secondary" - } - - StatusButton { - text: "Primary Small Button" - size: "small" - } - - StatusButton { - text: "Secondary Small Button" - size: "small" - } - - StatusRoundButton { - icon.name: "arrow-right" - icon.height: 15 - icon.width: 20 - } - - StatusRoundButton { - size: "medium" - icon.name: "arrow-right" - icon.height: 15 - icon.width: 20 - } - - StatusRoundButton { - size: "small" - icon.name: "arrow-right" - icon.height: 12 - icon.width: 18 - } - } - - RowLayout { - StatusButton { - text: "Primary Large Button" - enabled: false - } - - StatusButton { - text: "Secondary Large Button" - type: "secondary" - enabled: false - } - - StatusButton { - text: "Primary Small Button" - enabled: false - size: "small" - } - - StatusButton { - text: "Secondary Small Button" - type: "secondary" - enabled: false - size: "small" - } - - StatusRoundButton { - icon.name: "arrow-right" - icon.height: 15 - icon.width: 20 - enabled: false - } - - StatusRoundButton { - size: "medium" - icon.name: "arrow-right" - icon.height: 15 - icon.width: 20 - enabled: false - } - - StatusRoundButton { - size: "small" - icon.name: "arrow-right" - icon.height: 12 - icon.width: 18 - enabled: false - } - } - - RowLayout { - StatusButton { - text: "Primary Large Button" - state: "pending" - } - - StatusButton { - text: "Secondary Large Button" - type: "secondary" - state: "pending" - } - - StatusButton { - text: "Primary Large Button" - state: "pending" - size: "small" - } - - StatusButton { - text: "Secondary Large Button" - type: "secondary" - state: "pending" - size: "small" - } - - StatusRoundButton { - state: "pending" - } - - StatusRoundButton { - size: "medium" - state: "pending" - } - - StatusRoundButton { - size: "small" - state: "pending" - } - } - - RowLayout { - width: parent.width - Layout.fillWidth: true - Item { - width: parent.width - height: addressComponent.height - Layout.fillWidth: true - Address { - id: addressComponent - text: "0x9ce0056c5fc6bb9459a4dcfa35eaad8c1fee5ce9" - width: 100 - } - } - } - RowLayout { - width: parent.width - Layout.fillWidth: true - Item { - width: parent.width - height: addressComponent.height - Layout.fillWidth: true - Address { - id: addressComponentWidthAnchors - text: "0x9ce0056c5fc6bb9459a4dcfa35eaad8c1fee5ce9" - anchors.left: parent.left - anchors.right: parent.right - anchors.rightMargin: parent.width - 100 - } - } - } - */ - } -} - -/*##^## -Designer { - D{i:0;autoSize:true;formeditorColor:"#ffffff";formeditorZoom:0.75;height:480;width:1000} -} -##^##*/ diff --git a/ui/imports/shared/panels/NotificationWindow.qml b/ui/imports/shared/panels/NotificationWindow.qml deleted file mode 100644 index f10b3a6e37..0000000000 --- a/ui/imports/shared/panels/NotificationWindow.qml +++ /dev/null @@ -1,110 +0,0 @@ -import QtQuick 2.13 -import QtQuick.Controls 2.13 -import QtQuick.Window 2.12 -import QtQml 2.13 -import QtGraphicalEffects 1.13 - -import StatusQ.Platform 0.1 - -import utils 1.0 -import "../status" -import "../controls" - -Item { - id: root - property string chatId: "" - property string name: "channel name" - property string message: qsTr("Everything is connected") - property int chatType: 1 - property var onClick - - property var processClick: Backpressure.oneInTime(root, 1000, function () { - notificationSound.play() - var w1 = winInit.createObject(null) - w1.destroy() - }) - - Component { - id: winInit - Window { - flags: Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint | Qt.Popup - | Qt.WA_ShowWithoutActivating | Qt.BypassWindowManagerHint - width: 1 - height: 1 - Component.onCompleted: { - requestActivate() - mainWin.createObject(root) - } - } - } - - Component { - id: mainWin - - Window { - id: notificationWindowSub - flags: Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint | Qt.WA_ShowWithoutActivating | Qt.BypassWindowManagerHint - height: channelNotif.height - width: channelNotif.width - x: Screen.width - (width + 50) - y: 50 - visible: true - color: Style.current.transparent - - StatusMacNotification { - id: channelNotif - chatId: root.chatId - name: root.name - message: root.message - - MouseArea { - cursorShape: Qt.PointingHandCursor - anchors.fill: parent - onClicked: { - timer.stop() - notificationWindowSub.close() - root.onClick(root.chatId) - notificationWindowSub.destroy() - } - } - - Timer { - id: timer - interval: Constants.notificationPopupTTL - running: true - repeat: false - onTriggered: { - notificationWindowSub.close() - notificationWindowSub.destroy() - } - } - onVisibleChanged: { - if (visible) { - timer.running = true - if (Global.applicationWindow.active) { - this.flags |= Qt.Popup - } else { - this.flags = Qt.FramelessWindowHint | Qt.WA_ShowWithoutActivating - | Qt.WindowStaysOnTopHint | Qt.BypassWindowManagerHint - } - } - } - } - } - } - - function notifyUser(chatId, name, msg, chatType, onClick) { - this.chatId = chatId - this.name = name - this.message = msg - this.chatType = chatType - this.onClick = onClick - processClick() - } -} - -/*##^## -Designer { - D{i:0;autoSize:true;height:480;width:640} -} -##^##*/ diff --git a/ui/imports/shared/popups/ToastMessage.qml b/ui/imports/shared/popups/ToastMessage.qml deleted file mode 100644 index 21dba10a6f..0000000000 --- a/ui/imports/shared/popups/ToastMessage.qml +++ /dev/null @@ -1,160 +0,0 @@ -import QtQuick 2.13 -import QtGraphicalEffects 1.13 -import QtQuick.Controls 2.13 - -import utils 1.0 -import "../" -import "../panels" -import "../controls" - -Popup { - id: root - closePolicy: Popup.NoAutoClose - height: 68 - padding: 0 - margins: 0 - width: Math.max(Math.max(titleText.width, linkStyledText.width) - + (toastImage.visible? toastImage.width + rowId.spacing : 0) - + rowId.leftPadding + rowId.rightPadding, - 343) - x: parent.width - width - Style.current.bigPadding - y: parent.height - height - Style.current.bigPadding - - - readonly property string defaultLinkText: qsTr("View on Etherscan") - - property string uuid: "" // set this if you want to distinct among multiple toasts - property url source: Style.svg("check-circle") - property color iconColor: Style.current.primary - property bool iconRotates: false - property string title: qsTr("Transaction pending...") - property string link: "https://etherscan.io/" - property string linkText: defaultLinkText - property int dissapearInMs: 4000 /* setting this to -1 makes caller responsible to close it */ - property bool displayCloseButton: true - property bool displayLink: true - - onOpened: { - if(dissapearInMs == -1) - return - - timer.setTimeout(function() { - root.close() - }, dissapearInMs); - } - onClosed: { - // Reset props - source = Style.svg("check-circle") - iconColor = Style.current.primary - iconRotates = false - title = qsTr("Transaction pending...") - link = "https://etherscan.io/" - linkText = defaultLinkText - dissapearInMs = 4000 - displayCloseButton = true - displayLink = true - root.destroy(); - } - - Timer { - id: timer - } - - background: Rectangle { - id: container - radius: Style.current.radius - color: Style.current.background - - layer.enabled: true - layer.effect: DropShadow{ - width: container.width - height: container.height - x: container.x - y: container.y + 10 - visible: container.visible - source: container - horizontalOffset: 0 - verticalOffset: 2 - radius: 10 - samples: 15 - color: Style.current.dropShadow - } - } - - Row { - id: rowId - anchors.fill: parent - leftPadding: 12 - rightPadding: 12 - topPadding: Style.current.padding - bottomPadding: Style.current.padding - spacing: 12 - - RoundedIcon { - id: toastImage - visible: root.source != "" - width: 32 - height: 32 - iconHeight: 20 - iconWidth: 20 - color: Utils.setColorAlpha(root.iconColor, 0.1) - anchors.verticalCenter: parent.verticalCenter - source: root.source - iconColor: root.iconColor - rotates: root.iconRotates - } - - Column { - anchors.verticalCenter: parent.verticalCenter - - StyledText { - id: titleText - text: root.title - font.pixelSize: 13 - font.weight: Font.Medium - } - - StyledText { - id: linkStyledText - visible: displayLink - text: `${root.linkText}` - color: Style.current.textColorTertiary - textFormat: Text.RichText - font.pixelSize: 13 - font.weight: Font.Medium - onLinkActivated: { - Global.openLink(root.link) - root.close() - } - } - } - } - - SVGImage { - id: closeImage - visible: displayCloseButton - anchors.right: parent.right - anchors.top: parent.top - source: Style.svg("plusSign") - anchors.topMargin: Style.current.padding - anchors.rightMargin: Style.current.padding - width: 9 - height: 9 - rotation: 45 - - MouseArea { - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - onClicked: { - root.close() - } - } - } - ColorOverlay { - visible: displayCloseButton - anchors.fill: closeImage - source: closeImage - rotation: 45 - color: Style.current.textColor - } -}