splitted the code base into more components and implemented safety measures to Crypto.qml, also added missing themes and removed hardcoded values
This commit is contained in:
43
components/PopupCard.qml
Normal file
43
components/PopupCard.qml
Normal file
@@ -0,0 +1,43 @@
|
||||
import QtQuick
|
||||
import "../config" as Cfg
|
||||
|
||||
Rectangle {
|
||||
id: card
|
||||
|
||||
required property bool popupOpen
|
||||
required property bool isTop
|
||||
property bool animEnabled: true
|
||||
|
||||
width: parent.width
|
||||
|
||||
anchors.top: isTop ? parent.top : undefined
|
||||
anchors.bottom: isTop ? undefined : parent.bottom
|
||||
|
||||
transform: Translate {
|
||||
y: popupOpen ? 0 : (isTop ? -card.height : card.height)
|
||||
Behavior on y {
|
||||
NumberAnimation {
|
||||
duration: Cfg.Config.popupAnimDuration
|
||||
easing.type: Easing.OutExpo
|
||||
}
|
||||
enabled: animEnabled
|
||||
}
|
||||
}
|
||||
|
||||
opacity: popupOpen ? 1.0 : 0.0
|
||||
Behavior on opacity { NumberAnimation { duration: 200 } }
|
||||
|
||||
default property alias _popupCardContent: _content.data
|
||||
|
||||
Item {
|
||||
id: _content
|
||||
anchors.fill: parent
|
||||
z: 2
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
propagateComposedEvents: false
|
||||
z: 1
|
||||
}
|
||||
}
|
||||
7
components/PopupHideTimer.qml
Normal file
7
components/PopupHideTimer.qml
Normal file
@@ -0,0 +1,7 @@
|
||||
import QtQuick
|
||||
import "../config" as Cfg
|
||||
|
||||
Timer {
|
||||
id: timer
|
||||
interval: Cfg.Config.popupAnimDuration + 70
|
||||
}
|
||||
@@ -30,9 +30,8 @@ PanelWindow {
|
||||
function close() { popupOpen = false; hideTimer.restart() }
|
||||
function toggle() { popupOpen ? close() : open() }
|
||||
|
||||
Timer {
|
||||
PopupHideTimer {
|
||||
id: hideTimer
|
||||
interval: Cfg.Config.popupAnimDuration + 70
|
||||
onTriggered: popup.visible = false
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
|
||||
Reference in New Issue
Block a user