init: working version
This commit is contained in:
commit
7d8d7dacae
109 changed files with 15066 additions and 0 deletions
61
modules/notifications/Background.qml
Normal file
61
modules/notifications/Background.qml
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
import qs.config
|
||||
import qs.custom
|
||||
import qs.services
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Shapes
|
||||
|
||||
Shape {
|
||||
id: root
|
||||
|
||||
required property Item wrapper
|
||||
readonly property real rounding: Config.border.rounding
|
||||
readonly property bool flatten: wrapper.height < rounding * 2
|
||||
readonly property real roundingY: flatten ? wrapper.height / 2 : rounding
|
||||
property real fullHeightRounding: wrapper.height >= QsWindow.window?.height - Config.border.thickness * 2 ? -rounding : rounding
|
||||
|
||||
ShapePath {
|
||||
startX: root.wrapper.width + 0.5
|
||||
startY: root.wrapper.height + 0.5
|
||||
strokeWidth: -1
|
||||
fillColor: Config.colors.bg
|
||||
|
||||
PathLine {
|
||||
relativeX: -(root.wrapper.width + root.rounding)
|
||||
relativeY: 0
|
||||
}
|
||||
PathArc {
|
||||
relativeX: root.rounding
|
||||
relativeY: -root.roundingY
|
||||
radiusX: root.rounding
|
||||
radiusY: Math.min(root.rounding, root.wrapper.height)
|
||||
direction: PathArc.Counterclockwise
|
||||
}
|
||||
PathLine {
|
||||
relativeX: 0
|
||||
relativeY: -root.wrapper.height + root.roundingY * 2
|
||||
}
|
||||
PathArc {
|
||||
relativeX: root.fullHeightRounding
|
||||
relativeY: -root.roundingY
|
||||
radiusX: Math.abs(root.fullHeightRounding)
|
||||
radiusY: Math.min(root.rounding, root.wrapper.height)
|
||||
direction: root.fullHeightRounding < 0 ? PathArc.Counterclockwise : PathArc.Clockwise
|
||||
}
|
||||
PathLine {
|
||||
relativeX: root.wrapper.height > 0 ? root.wrapper.width - root.rounding - root.fullHeightRounding : root.wrapper.width
|
||||
relativeY: 0
|
||||
}
|
||||
PathArc {
|
||||
relativeX: root.rounding
|
||||
relativeY: -root.rounding
|
||||
radiusX: root.rounding
|
||||
radiusY: root.rounding
|
||||
direction: PathArc.Counterclockwise
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on fullHeightRounding {
|
||||
Anim {}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue