Compare commits
3 commits
65b4762c90
...
875551777c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
875551777c | ||
|
|
7d7f7b9fd6 | ||
|
|
6202b0d6c7 |
4 changed files with 85 additions and 67 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
import "root:styled"
|
import "../../styled/"
|
||||||
|
|
||||||
Variants {
|
Variants {
|
||||||
model: Quickshell.screens
|
model: Quickshell.screens
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,9 @@ Scope {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tray {
|
Tray {
|
||||||
// anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
|
|
|
||||||
|
|
@ -6,72 +6,15 @@ import Quickshell
|
||||||
import "../../../../../config/"
|
import "../../../../../config/"
|
||||||
import "../../../../../styled/"
|
import "../../../../../styled/"
|
||||||
|
|
||||||
PopupWindow {
|
StyledPopupWindow {
|
||||||
id: window
|
id: window
|
||||||
|
|
||||||
property QsMenuOpener menuOpener
|
backgroundColor: Theme.palette.base300
|
||||||
property bool opened: false
|
|
||||||
|
|
||||||
color: 'transparent'
|
|
||||||
|
|
||||||
implicitWidth: menu.width
|
|
||||||
implicitHeight: menu.height
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: background
|
|
||||||
|
|
||||||
anchors.fill: menu
|
|
||||||
color: Theme.palette.base300
|
|
||||||
border.color: Theme.palette.base200
|
|
||||||
border.width: 2
|
|
||||||
radius: 8
|
radius: 8
|
||||||
|
|
||||||
opacity: 0
|
property QsMenuOpener menuOpener
|
||||||
|
|
||||||
states: State {
|
content: ColumnLayout {
|
||||||
name: "opened"
|
|
||||||
when: window.opened
|
|
||||||
PropertyChanges {
|
|
||||||
background {
|
|
||||||
opacity: 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
transitions: [
|
|
||||||
Transition {
|
|
||||||
from: ""
|
|
||||||
to: "opened"
|
|
||||||
SequentialAnimation {
|
|
||||||
ScriptAction {
|
|
||||||
script: window.visible = true
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
property: "background.opacity"
|
|
||||||
duration: 200
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Transition {
|
|
||||||
from: "opened"
|
|
||||||
to: ""
|
|
||||||
SequentialAnimation {
|
|
||||||
PauseAnimation {
|
|
||||||
duration: repeater.count * 15
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
property: "background.opacity"
|
|
||||||
duration: 200
|
|
||||||
}
|
|
||||||
ScriptAction {
|
|
||||||
script: window.visible = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: menu
|
id: menu
|
||||||
|
|
||||||
anchors.margins: 30
|
anchors.margins: 30
|
||||||
|
|
@ -118,7 +61,7 @@ PopupWindow {
|
||||||
to: "opened"
|
to: "opened"
|
||||||
SequentialAnimation {
|
SequentialAnimation {
|
||||||
PauseAnimation {
|
PauseAnimation {
|
||||||
duration: 15 * loader.index
|
duration: (repeater.count / root.animationDuration) * loader.index
|
||||||
}
|
}
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
property: "opacity"
|
property: "opacity"
|
||||||
|
|
|
||||||
75
styled/StyledPopupWindow.qml
Normal file
75
styled/StyledPopupWindow.qml
Normal file
|
|
@ -0,0 +1,75 @@
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Widgets
|
||||||
|
|
||||||
|
PopupWindow {
|
||||||
|
id: root
|
||||||
|
property bool opened: false
|
||||||
|
property int animationDuration: 200
|
||||||
|
property int margins: 10
|
||||||
|
property alias backgroundColor: background.color
|
||||||
|
property alias radius: background.radius
|
||||||
|
required property Component content
|
||||||
|
|
||||||
|
color: "transparent"
|
||||||
|
|
||||||
|
implicitWidth: background.width
|
||||||
|
implicitHeight: background.height
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: background
|
||||||
|
|
||||||
|
implicitWidth: margins.width
|
||||||
|
implicitHeight: margins.height
|
||||||
|
|
||||||
|
opacity: 0
|
||||||
|
Behavior on opacity {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: root.animationDuration
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
states: State {
|
||||||
|
name: "opened"
|
||||||
|
when: root.opened
|
||||||
|
PropertyChanges {
|
||||||
|
background {
|
||||||
|
opacity: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
transitions: [
|
||||||
|
Transition {
|
||||||
|
from: ""
|
||||||
|
to: "opened"
|
||||||
|
ScriptAction {
|
||||||
|
script: root.visible = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Transition {
|
||||||
|
from: "opened"
|
||||||
|
to: ""
|
||||||
|
SequentialAnimation {
|
||||||
|
PauseAnimation {
|
||||||
|
duration: root.animationDuration
|
||||||
|
}
|
||||||
|
ScriptAction {
|
||||||
|
script: root.visible = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
WrapperItem {
|
||||||
|
id: margins
|
||||||
|
|
||||||
|
margin: root.margins
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
active: root.visible
|
||||||
|
sourceComponent: content
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue