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.services
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
|
|
@ -11,11 +10,6 @@ Menu {
|
|||
|
||||
focus: true
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
||||
popupType: Popup.Window
|
||||
|
||||
function toggle() {
|
||||
visible ? close() : open();
|
||||
}
|
||||
|
||||
enter: Transition {
|
||||
NumberAnimation {
|
||||
|
|
|
|||
|
|
@ -4,9 +4,8 @@ import "launcher"
|
|||
import "pomodoro"
|
||||
import "powermenu"
|
||||
import "storybook"
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import QtQuick
|
||||
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
|
|
@ -16,65 +15,7 @@ Variants {
|
|||
|
||||
required property ShellScreen modelData
|
||||
|
||||
PanelWindow {
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
Bar {}
|
||||
Launcher {}
|
||||
Pomodoro {}
|
||||
PowerMenu {}
|
||||
|
|
|
|||
|
|
@ -3,29 +3,55 @@ import "components/bluetooth"
|
|||
import "components/hyprland"
|
||||
import "components/notifications"
|
||||
import "components/tray"
|
||||
import qs.components
|
||||
import qs.config
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
|
||||
StyledWrapperRectangle {
|
||||
id: root
|
||||
PanelWindow {
|
||||
id: parentWindow
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.top: true
|
||||
anchors.left: true
|
||||
anchors.right: true
|
||||
|
||||
implicitHeight: Dimensions.bar.height
|
||||
color: 'transparent'
|
||||
|
||||
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
|
||||
|
||||
margin: 6
|
||||
Rectangle {
|
||||
id: background
|
||||
anchors.fill: parent
|
||||
color: Theme.palette.base300
|
||||
radius: Dimensions.radius
|
||||
|
||||
RowLayout {
|
||||
border {
|
||||
color: Theme.palette.base100
|
||||
width: Dimensions.bar.border
|
||||
pixelAligned: true
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
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
|
||||
|
||||
SystemLogo {
|
||||
|
|
@ -40,7 +66,11 @@ StyledWrapperRectangle {
|
|||
RowLayout {
|
||||
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
|
||||
|
||||
|
|
@ -50,7 +80,12 @@ StyledWrapperRectangle {
|
|||
RowLayout {
|
||||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -55,10 +55,10 @@ StyledWindow {
|
|||
id: circle
|
||||
radius: 150
|
||||
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
|
||||
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 {
|
||||
|
|
@ -69,17 +69,17 @@ StyledWindow {
|
|||
radius: 9999
|
||||
|
||||
focus: root.visible
|
||||
text: PomodoroService.running ? Icons.square : Icons.play
|
||||
text: Pomodoro.running ? Icons.square : Icons.play
|
||||
font.pixelSize: 48
|
||||
|
||||
background: undefined
|
||||
onClicked: {
|
||||
PomodoroService.toggle();
|
||||
Pomodoro.toggle();
|
||||
}
|
||||
|
||||
Keys.onSpacePressed: event => {
|
||||
event.accepted = true;
|
||||
PomodoroService.toggle();
|
||||
Pomodoro.toggle();
|
||||
}
|
||||
Keys.onEscapePressed: event => {
|
||||
event.accepted = true;
|
||||
|
|
@ -87,7 +87,7 @@ StyledWindow {
|
|||
}
|
||||
Keys.onTabPressed: event => {
|
||||
event.accepted = true;
|
||||
PomodoroService.reset();
|
||||
Pomodoro.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -95,7 +95,7 @@ StyledWindow {
|
|||
StyledText {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
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")}`;
|
||||
}
|
||||
font.pixelSize: 16
|
||||
|
|
@ -108,7 +108,7 @@ StyledWindow {
|
|||
text: "Reset"
|
||||
|
||||
onClicked: {
|
||||
PomodoroService.reset();
|
||||
Pomodoro.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue