Compare commits
No commits in common. "75f780753f9cf0ad4cc0ab42bfb86a730f722e2a" and "75f1fc1905b18723837078bdb4fbcae6afaa2ef8" have entirely different histories.
75f780753f
...
75f1fc1905
5 changed files with 59 additions and 89 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
import qs.config
|
import qs.config
|
||||||
import qs.services
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
|
||||||
|
|
@ -11,11 +10,6 @@ Menu {
|
||||||
|
|
||||||
focus: true
|
focus: true
|
||||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
||||||
popupType: Popup.Window
|
|
||||||
|
|
||||||
function toggle() {
|
|
||||||
visible ? close() : open();
|
|
||||||
}
|
|
||||||
|
|
||||||
enter: Transition {
|
enter: Transition {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,8 @@ import "launcher"
|
||||||
import "pomodoro"
|
import "pomodoro"
|
||||||
import "powermenu"
|
import "powermenu"
|
||||||
import "storybook"
|
import "storybook"
|
||||||
import QtQuick
|
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Wayland
|
import QtQuick
|
||||||
|
|
||||||
Variants {
|
Variants {
|
||||||
model: Quickshell.screens
|
model: Quickshell.screens
|
||||||
|
|
@ -16,65 +15,7 @@ Variants {
|
||||||
|
|
||||||
required property ShellScreen modelData
|
required property ShellScreen modelData
|
||||||
|
|
||||||
PanelWindow {
|
Bar {}
|
||||||
id: exclusionZone
|
|
||||||
|
|
||||||
anchors.top: true
|
|
||||||
anchors.left: true
|
|
||||||
anchors.right: true
|
|
||||||
|
|
||||||
implicitWidth: bar.width
|
|
||||||
implicitHeight: bar.height
|
|
||||||
|
|
||||||
color: "transparent"
|
|
||||||
}
|
|
||||||
|
|
||||||
PanelWindow {
|
|
||||||
id: topWindow
|
|
||||||
|
|
||||||
anchors.top: true
|
|
||||||
anchors.left: true
|
|
||||||
anchors.right: true
|
|
||||||
anchors.bottom: true
|
|
||||||
|
|
||||||
color: 'transparent'
|
|
||||||
|
|
||||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
|
||||||
WlrLayershell.layer: WlrLayer.Top
|
|
||||||
|
|
||||||
mask: Region {
|
|
||||||
width: topWindow.width
|
|
||||||
height: topWindow.height
|
|
||||||
intersection: Intersection.Xor
|
|
||||||
regions: regions.instances
|
|
||||||
}
|
|
||||||
|
|
||||||
Variants {
|
|
||||||
id: regions
|
|
||||||
|
|
||||||
model: panels.children
|
|
||||||
|
|
||||||
Region {
|
|
||||||
required property Item modelData
|
|
||||||
|
|
||||||
x: modelData.x
|
|
||||||
y: modelData.y
|
|
||||||
width: modelData.width
|
|
||||||
height: modelData.height
|
|
||||||
intersection: Intersection.Subtract
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: panels
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
Bar {
|
|
||||||
id: bar
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Launcher {}
|
Launcher {}
|
||||||
Pomodoro {}
|
Pomodoro {}
|
||||||
PowerMenu {}
|
PowerMenu {}
|
||||||
|
|
|
||||||
|
|
@ -3,29 +3,55 @@ import "components/bluetooth"
|
||||||
import "components/hyprland"
|
import "components/hyprland"
|
||||||
import "components/notifications"
|
import "components/notifications"
|
||||||
import "components/tray"
|
import "components/tray"
|
||||||
import qs.components
|
|
||||||
import qs.config
|
import qs.config
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Wayland
|
||||||
|
|
||||||
StyledWrapperRectangle {
|
PanelWindow {
|
||||||
id: root
|
id: parentWindow
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.top: true
|
||||||
anchors.right: parent.right
|
anchors.left: true
|
||||||
anchors.top: parent.top
|
anchors.right: true
|
||||||
anchors.leftMargin: Dimensions.bar.horizontalMargins
|
|
||||||
anchors.rightMargin: Dimensions.bar.horizontalMargins
|
|
||||||
anchors.topMargin: Dimensions.bar.verticalMargins
|
|
||||||
anchors.bottomMargin: Dimensions.bar.verticalMargins
|
|
||||||
|
|
||||||
margin: 6
|
implicitHeight: Dimensions.bar.height
|
||||||
|
color: 'transparent'
|
||||||
|
|
||||||
RowLayout {
|
WlrLayershell.layer: WlrLayer.Top
|
||||||
|
|
||||||
|
Item {
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.leftMargin: Dimensions.bar.horizontalMargins
|
||||||
|
anchors.rightMargin: Dimensions.bar.horizontalMargins
|
||||||
|
anchors.topMargin: Dimensions.bar.verticalMargins
|
||||||
|
anchors.bottomMargin: Dimensions.bar.verticalMargins
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: background
|
||||||
|
anchors.fill: parent
|
||||||
|
color: Theme.palette.base300
|
||||||
|
radius: Dimensions.radius
|
||||||
|
|
||||||
|
border {
|
||||||
|
color: Theme.palette.base100
|
||||||
|
width: Dimensions.bar.border
|
||||||
|
pixelAligned: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: leftbar
|
id: leftbar
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
anchors.leftMargin: Dimensions.bar.horizontalPadding
|
||||||
|
anchors.topMargin: Dimensions.bar.verticalPadding
|
||||||
|
anchors.bottomMargin: Dimensions.bar.verticalPadding
|
||||||
|
|
||||||
spacing: Dimensions.bar.spacing
|
spacing: Dimensions.bar.spacing
|
||||||
|
|
||||||
SystemLogo {
|
SystemLogo {
|
||||||
|
|
@ -40,7 +66,11 @@ StyledWrapperRectangle {
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: centerbar
|
id: centerbar
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
anchors.topMargin: Dimensions.bar.verticalPadding
|
||||||
|
anchors.bottomMargin: Dimensions.bar.verticalPadding
|
||||||
|
|
||||||
spacing: Dimensions.bar.spacing
|
spacing: Dimensions.bar.spacing
|
||||||
|
|
||||||
|
|
@ -50,7 +80,12 @@ StyledWrapperRectangle {
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: rightbar
|
id: rightbar
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignRight
|
anchors.right: parent.right
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
anchors.rightMargin: Dimensions.bar.horizontalPadding
|
||||||
|
anchors.topMargin: Dimensions.bar.verticalPadding
|
||||||
|
anchors.bottomMargin: Dimensions.bar.verticalPadding
|
||||||
|
|
||||||
spacing: Dimensions.bar.spacing
|
spacing: Dimensions.bar.spacing
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,10 +55,10 @@ StyledWindow {
|
||||||
id: circle
|
id: circle
|
||||||
radius: 150
|
radius: 150
|
||||||
borderColor: Theme.palette.base100
|
borderColor: Theme.palette.base100
|
||||||
strokeColor: PomodoroService.state == "timer" ? Theme.palette.primary : Theme.palette.warning
|
strokeColor: Pomodoro.state == "timer" ? Theme.palette.primary : Theme.palette.warning
|
||||||
strokeWidth: 12
|
strokeWidth: 12
|
||||||
fillColor: button.hovered ? Theme.palette.primary : "transparent"
|
fillColor: button.hovered ? Theme.palette.primary : "transparent"
|
||||||
percentage: (PomodoroService.state == "timer" ? (PomodoroService.initialTime - PomodoroService.remainingTime) : PomodoroService.remainingTime) / PomodoroService.initialTime % 1
|
percentage: (Pomodoro.state == "timer" ? (Pomodoro.initialTime - Pomodoro.remainingTime) : Pomodoro.remainingTime) / Pomodoro.initialTime % 1
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledIconButton {
|
StyledIconButton {
|
||||||
|
|
@ -69,17 +69,17 @@ StyledWindow {
|
||||||
radius: 9999
|
radius: 9999
|
||||||
|
|
||||||
focus: root.visible
|
focus: root.visible
|
||||||
text: PomodoroService.running ? Icons.square : Icons.play
|
text: Pomodoro.running ? Icons.square : Icons.play
|
||||||
font.pixelSize: 48
|
font.pixelSize: 48
|
||||||
|
|
||||||
background: undefined
|
background: undefined
|
||||||
onClicked: {
|
onClicked: {
|
||||||
PomodoroService.toggle();
|
Pomodoro.toggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
Keys.onSpacePressed: event => {
|
Keys.onSpacePressed: event => {
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
PomodoroService.toggle();
|
Pomodoro.toggle();
|
||||||
}
|
}
|
||||||
Keys.onEscapePressed: event => {
|
Keys.onEscapePressed: event => {
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
|
|
@ -87,7 +87,7 @@ StyledWindow {
|
||||||
}
|
}
|
||||||
Keys.onTabPressed: event => {
|
Keys.onTabPressed: event => {
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
PomodoroService.reset();
|
Pomodoro.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -95,7 +95,7 @@ StyledWindow {
|
||||||
StyledText {
|
StyledText {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
text: {
|
text: {
|
||||||
const date = new Date(PomodoroService.remainingTime);
|
const date = new Date(Pomodoro.remainingTime);
|
||||||
return `${date.getMinutes().toString().padStart(2, "0")}:${(date.getSeconds() % 3600).toString().padStart(2, "0")}`;
|
return `${date.getMinutes().toString().padStart(2, "0")}:${(date.getSeconds() % 3600).toString().padStart(2, "0")}`;
|
||||||
}
|
}
|
||||||
font.pixelSize: 16
|
font.pixelSize: 16
|
||||||
|
|
@ -108,7 +108,7 @@ StyledWindow {
|
||||||
text: "Reset"
|
text: "Reset"
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
PomodoroService.reset();
|
Pomodoro.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue