Compare commits
2 commits
112ed0d6de
...
96d8ab6534
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96d8ab6534 | ||
|
|
8130cb1bdd |
12 changed files with 184 additions and 144 deletions
12
components/StyledLayoutSeparator.qml
Normal file
12
components/StyledLayoutSeparator.qml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
import qs.config
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
color: Styling.theme.basecontent
|
||||||
|
opacity: 0.33
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.margins: 2
|
||||||
|
implicitWidth: 0.5
|
||||||
|
radius: 9999
|
||||||
|
}
|
||||||
|
|
@ -1,70 +1,79 @@
|
||||||
import qs.config
|
import qs.services
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Hyprland
|
import Quickshell.Widgets
|
||||||
|
|
||||||
PopupWindow {
|
PopupWindow {
|
||||||
id: root
|
id: root
|
||||||
|
property bool opened: false
|
||||||
|
property int animationDuration: 200
|
||||||
|
property alias margins: background.margin
|
||||||
|
property alias backgroundColor: background.color
|
||||||
|
property alias radius: background.radius
|
||||||
|
property alias state: background.state
|
||||||
required property Component content
|
required property Component content
|
||||||
|
|
||||||
implicitWidth: background.width
|
|
||||||
implicitHeight: background.height
|
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
HyprlandFocusGrab {
|
|
||||||
id: grab
|
|
||||||
active: root.visible
|
|
||||||
windows: [root]
|
|
||||||
onCleared: {
|
|
||||||
background.state = "closed";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggle() {
|
function toggle() {
|
||||||
background.state = background.state == "opened" ? "closed" : "opened";
|
Visibility.togglePopup(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledWrapperRectangle {
|
implicitWidth: background.width
|
||||||
|
Behavior on implicitWidth {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: 100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
implicitHeight: background.height
|
||||||
|
Behavior on implicitHeight {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: 100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: timer
|
||||||
|
interval: 750
|
||||||
|
onTriggered: {
|
||||||
|
if (!root.visible) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
root.toggle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WrapperMouseArea {
|
||||||
|
hoverEnabled: true
|
||||||
|
onExited: {
|
||||||
|
timer.start();
|
||||||
|
}
|
||||||
|
onEntered: {
|
||||||
|
timer.stop();
|
||||||
|
}
|
||||||
|
WrapperRectangle {
|
||||||
id: background
|
id: background
|
||||||
|
|
||||||
margin: 16
|
opacity: 0
|
||||||
focus: true
|
|
||||||
onFocusChanged: {
|
|
||||||
if (!focus) {
|
|
||||||
grab.active = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Styling.animations.speed.normal
|
duration: root.animationDuration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
state: "closed"
|
states: State {
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "closed"
|
|
||||||
PropertyChanges {
|
|
||||||
background {
|
|
||||||
opacity: 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "opened"
|
name: "opened"
|
||||||
|
when: root.opened
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
background {
|
background {
|
||||||
opacity: 1
|
opacity: 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
|
||||||
|
|
||||||
transitions: [
|
transitions: [
|
||||||
Transition {
|
Transition {
|
||||||
from: "closed"
|
from: ""
|
||||||
to: "opened"
|
to: "opened"
|
||||||
ScriptAction {
|
ScriptAction {
|
||||||
script: root.visible = true
|
script: root.visible = true
|
||||||
|
|
@ -72,7 +81,7 @@ PopupWindow {
|
||||||
},
|
},
|
||||||
Transition {
|
Transition {
|
||||||
from: "opened"
|
from: "opened"
|
||||||
to: "closed"
|
to: ""
|
||||||
SequentialAnimation {
|
SequentialAnimation {
|
||||||
PauseAnimation {
|
PauseAnimation {
|
||||||
duration: root.animationDuration
|
duration: root.animationDuration
|
||||||
|
|
@ -90,3 +99,4 @@ PopupWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ StyledWrapperRectangle {
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: leftbar
|
id: leftbar
|
||||||
|
|
||||||
spacing: Styling.layout.spacing.base
|
spacing: Styling.layout.spacing.lg
|
||||||
|
|
||||||
SystemLogo {
|
SystemLogo {
|
||||||
implicitSize: 22
|
implicitSize: 22
|
||||||
|
|
@ -44,7 +44,7 @@ StyledWrapperRectangle {
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
||||||
spacing: Styling.layout.spacing.base
|
spacing: Styling.layout.spacing.lg
|
||||||
|
|
||||||
Mpris {}
|
Mpris {}
|
||||||
}
|
}
|
||||||
|
|
@ -54,18 +54,14 @@ StyledWrapperRectangle {
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.alignment: Qt.AlignRight
|
||||||
|
|
||||||
spacing: Styling.layout.spacing.base
|
spacing: Styling.layout.spacing.lg
|
||||||
|
|
||||||
Pywal {}
|
|
||||||
|
|
||||||
Pipewire {}
|
Pipewire {}
|
||||||
|
|
||||||
Caffeine {}
|
StyledLayoutSeparator {}
|
||||||
|
|
||||||
Network {}
|
Network {}
|
||||||
|
|
||||||
Bluetooth {}
|
|
||||||
|
|
||||||
Storage {}
|
Storage {}
|
||||||
|
|
||||||
Memory {}
|
Memory {}
|
||||||
|
|
@ -74,10 +70,20 @@ StyledWrapperRectangle {
|
||||||
|
|
||||||
Gpu {}
|
Gpu {}
|
||||||
|
|
||||||
Power {}
|
StyledLayoutSeparator {}
|
||||||
|
|
||||||
|
Pywal {}
|
||||||
|
|
||||||
|
Caffeine {}
|
||||||
|
|
||||||
|
Bluetooth {}
|
||||||
|
|
||||||
|
StyledLayoutSeparator {}
|
||||||
|
|
||||||
Clock {}
|
Clock {}
|
||||||
|
|
||||||
|
Power {}
|
||||||
|
|
||||||
Notifications {}
|
Notifications {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ StyledIconButton {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
border.width: 2
|
border.width: 2
|
||||||
border.color: Caffeine.enabled ? Styling.theme.secondary : root.hovered ? Styling.theme.primary : Styling.theme.base300
|
border.color: Caffeine.enabled ? Styling.theme.secondary : root.hovered ? Styling.theme.primary : Styling.theme.base200
|
||||||
text: Styling.lucide.icons.coffee
|
text: Styling.lucide.icons.coffee
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import qs.components
|
import qs.components
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
|
||||||
StyledRectangle {
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: ` ${Qt.formatDateTime(clock.date, "hh:mm:ss AP")}`
|
text: ` ${Qt.formatDateTime(clock.date, "hh:mm:ss AP")}`
|
||||||
SystemClock {
|
SystemClock {
|
||||||
|
|
@ -9,4 +8,3 @@ StyledRectangle {
|
||||||
precision: SystemClock.Seconds
|
precision: SystemClock.Seconds
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,6 @@ import qs.utils
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
||||||
StyledRectangle {
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|
||||||
Ref {
|
Ref {
|
||||||
|
|
@ -21,4 +19,3 @@ StyledRectangle {
|
||||||
text: ` ${(SystemInfo.memPerc * 100).toFixed()}%`
|
text: ` ${(SystemInfo.memPerc * 100).toFixed()}%`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,6 @@ import qs.utils
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
||||||
StyledRectangle {
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|
||||||
Ref {
|
Ref {
|
||||||
|
|
@ -52,4 +50,3 @@ StyledRectangle {
|
||||||
text: ` ${(NetworkService.active?.strength ?? 0).toFixed()}%`
|
text: ` ${(NetworkService.active?.strength ?? 0).toFixed()}%`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,6 @@ import qs.utils
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
||||||
StyledRectangle {
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|
||||||
Ref {
|
Ref {
|
||||||
|
|
@ -23,4 +21,3 @@ StyledRectangle {
|
||||||
text: ` ${(SystemInfo.storagePerc * 100).toFixed()}%`
|
text: ` ${(SystemInfo.storagePerc * 100).toFixed()}%`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import qs.components
|
import qs.components
|
||||||
|
import qs.config
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
|
@ -9,6 +10,10 @@ import Quickshell.Bluetooth
|
||||||
StyledPopupWindow {
|
StyledPopupWindow {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
backgroundColor: Styling.theme.base300
|
||||||
|
margins: 16
|
||||||
|
radius: 8
|
||||||
|
|
||||||
content: ColumnLayout {
|
content: ColumnLayout {
|
||||||
spacing: 8
|
spacing: 8
|
||||||
StyledWrapperRectangle {
|
StyledWrapperRectangle {
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,10 @@ import QtQuick.Layouts
|
||||||
StyledPopupWindow {
|
StyledPopupWindow {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
backgroundColor: Styling.theme.base300
|
||||||
|
margins: 16
|
||||||
|
radius: 8
|
||||||
|
|
||||||
content: GridLayout {
|
content: GridLayout {
|
||||||
|
|
||||||
columns: 2
|
columns: 2
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,10 @@ import Quickshell
|
||||||
StyledPopupWindow {
|
StyledPopupWindow {
|
||||||
id: window
|
id: window
|
||||||
|
|
||||||
|
backgroundColor: Styling.theme.base300
|
||||||
|
margins: 14
|
||||||
|
radius: 8
|
||||||
|
|
||||||
property QsMenuOpener menuOpener
|
property QsMenuOpener menuOpener
|
||||||
|
|
||||||
content: ColumnLayout {
|
content: ColumnLayout {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
pragma Singleton
|
pragma Singleton
|
||||||
|
|
||||||
|
import qs.components
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
|
|
@ -8,6 +9,15 @@ Singleton {
|
||||||
property alias pomodoro: properties.pomodoro
|
property alias pomodoro: properties.pomodoro
|
||||||
property alias powermenu: properties.powermenu
|
property alias powermenu: properties.powermenu
|
||||||
property alias storybook: properties.storybook
|
property alias storybook: properties.storybook
|
||||||
|
property StyledPopupWindow activePopup
|
||||||
|
|
||||||
|
function togglePopup(popup: StyledPopupWindow) {
|
||||||
|
if (activePopup && popup != activePopup) {
|
||||||
|
activePopup.state = "";
|
||||||
|
}
|
||||||
|
popup.state = popup.state == "opened" ? "" : "opened";
|
||||||
|
activePopup = popup;
|
||||||
|
}
|
||||||
|
|
||||||
PersistentProperties {
|
PersistentProperties {
|
||||||
id: properties
|
id: properties
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue