looks better

This commit is contained in:
Benjamin Palko 2025-08-29 13:28:19 -04:00
parent 4c5dc4df41
commit d78b9b275f
2 changed files with 53 additions and 45 deletions

View file

@ -1,5 +1,6 @@
pragma ComponentBehavior: Bound pragma ComponentBehavior: Bound
import qs.components
import qs.config import qs.config
import qs.constants import qs.constants
import qs.services import qs.services
@ -49,29 +50,32 @@ StyledWindow {
font.pixelSize: 22 font.pixelSize: 22
} }
Item {
implicitWidth: circle.width
implicitHeight: circle.height
Circle { Circle {
id: circle id: circle
radius: 150 radius: 150
color: Pomodoro.state == "timer" ? Theme.palette.primary : Theme.palette.warning borderColor: Theme.palette.base100
strokeColor: Pomodoro.state == "timer" ? Theme.palette.primary : Theme.palette.warning
strokeWidth: 12
fillColor: button.hovered ? Theme.palette.primary : "transparent"
percentage: (Pomodoro.state == "timer" ? (Pomodoro.initialTime - Pomodoro.remainingTime) : Pomodoro.remainingTime) / Pomodoro.initialTime % 1 percentage: (Pomodoro.state == "timer" ? (Pomodoro.initialTime - Pomodoro.remainingTime) : Pomodoro.remainingTime) / Pomodoro.initialTime % 1
WrapperRectangle {
color: "transparent"
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
ColumnLayout {
spacing: 18
StyledButton {
Layout.alignment: Qt.AlignHCenter
focus: root.visible
content: LucideIcon {
text: Pomodoro.running ? Icons.square : Icons.play
font.pixelSize: 20
} }
StyledIconButton {
id: button
anchors.centerIn: circle
radius: 9999
focus: root.visible
text: Pomodoro.running ? Icons.square : Icons.play
font.pixelSize: 48
background: undefined
onClicked: { onClicked: {
Pomodoro.toggle(); Pomodoro.toggle();
} }
@ -89,6 +93,8 @@ StyledWindow {
Pomodoro.reset(); Pomodoro.reset();
} }
} }
}
StyledText { StyledText {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
text: { text: {
@ -97,9 +103,6 @@ StyledWindow {
} }
font.pixelSize: 16 font.pixelSize: 16
} }
}
}
}
StyledButton { StyledButton {

View file

@ -7,7 +7,10 @@ Item {
property int radius: 0 property int radius: 0
property double percentage: 0 property double percentage: 0
property alias color: path.strokeColor property alias borderColor: fill.strokeColor
property alias strokeColor: path.strokeColor
property alias strokeWidth: path.strokeWidth
property alias fillColor: fill.fillColor
implicitWidth: radius * 2 implicitWidth: radius * 2
implicitHeight: radius * 2 implicitHeight: radius * 2
@ -17,6 +20,8 @@ Item {
preferredRendererType: Shape.CurveRenderer preferredRendererType: Shape.CurveRenderer
ShapePath { ShapePath {
id: fill
fillColor: Theme.palette.base100 fillColor: Theme.palette.base100
strokeColor: Theme.palette.base200 strokeColor: Theme.palette.base200
strokeWidth: 8 strokeWidth: 8
@ -34,8 +39,8 @@ Item {
id: path id: path
fillColor: "transparent" fillColor: "transparent"
strokeWidth: 8 strokeWidth: 0
strokeColor: "white" strokeColor: "transparent"
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
PathAngleArc { PathAngleArc {