chore: removed unused components

0xdeadbeef
This commit is contained in:
Lukáš Tinkl 2023-06-06 18:35:00 +02:00 committed by Lukáš Tinkl
parent 0f9f5de267
commit 0bf5c64b06
3 changed files with 0 additions and 467 deletions

View File

@ -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}
}
##^##*/

View File

@ -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}
}
##^##*/

View File

@ -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: `<a href='${root.link}' style='color:${Style.current.textColorTertiary};text-decoration:none;'>${root.linkText}</a>`
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
}
}