* reworked fullscreen mode as transforming shell * controlcenter configuring of toasts & notifs * fix animation on fs switch * border rounding & shadow animation * change controlcenter notifications layout * stay on WlrLayer.Overlay, use Anim * ci: update action versions * qmlformat * format take two * third time's the charm * fix: special workspace fullscreen * fix: bar width border.thickness on non-persistent behaviour * merge fix * stop layout shift on close * last few conventions sorted * linting * maximized state to fullscreen --------- Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
98 lines
2.5 KiB
QML
98 lines
2.5 KiB
QML
import QtQuick
|
|
import qs.components
|
|
import qs.components.effects
|
|
import qs.services
|
|
import qs.config
|
|
|
|
StyledRect {
|
|
id: root
|
|
|
|
required property int activeWsId
|
|
required property Repeater workspaces
|
|
required property Item mask
|
|
required property bool fullscreen
|
|
|
|
readonly property int currentWsIdx: {
|
|
let i = activeWsId - 1;
|
|
while (i < 0)
|
|
i += Config.bar.workspaces.shown;
|
|
return i % Config.bar.workspaces.shown;
|
|
}
|
|
|
|
property real leading: workspaces.count > 0 ? workspaces.itemAt(currentWsIdx)?.y ?? 0 : 0
|
|
property real trailing: workspaces.count > 0 ? workspaces.itemAt(currentWsIdx)?.y ?? 0 : 0
|
|
property real currentSize: workspaces.count > 0 ? (workspaces.itemAt(currentWsIdx) as Workspace)?.size ?? 0 : 0
|
|
property real offset: Math.min(leading, trailing)
|
|
property real size: {
|
|
const s = Math.abs(leading - trailing) + currentSize;
|
|
if (Config.bar.workspaces.activeTrail && lastWs > currentWsIdx) {
|
|
const ws = workspaces.itemAt(lastWs) as Workspace;
|
|
return ws ? Math.min(ws.y + ws.size - offset, s) : 0;
|
|
}
|
|
return s;
|
|
}
|
|
|
|
property int cWs
|
|
property int lastWs
|
|
|
|
onCurrentWsIdxChanged: {
|
|
lastWs = cWs;
|
|
cWs = currentWsIdx;
|
|
}
|
|
|
|
clip: true
|
|
y: offset + mask.y
|
|
implicitWidth: Config.bar.sizes.innerWidth - Appearance.padding.small * 2
|
|
implicitHeight: size
|
|
radius: Appearance.rounding.full
|
|
color: Colours.palette.m3primary
|
|
|
|
Colouriser {
|
|
source: root.mask
|
|
sourceColor: Colours.palette.m3onSurface
|
|
colorizationColor: Colours.palette.m3onPrimary
|
|
|
|
x: 0
|
|
y: -parent.offset
|
|
implicitWidth: root.mask.implicitWidth
|
|
implicitHeight: root.mask.implicitHeight
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
}
|
|
|
|
Behavior on leading {
|
|
enabled: Config.bar.workspaces.activeTrail
|
|
|
|
EAnim {}
|
|
}
|
|
|
|
Behavior on trailing {
|
|
enabled: Config.bar.workspaces.activeTrail
|
|
|
|
EAnim {
|
|
duration: Appearance.anim.durations.normal * 2
|
|
}
|
|
}
|
|
|
|
Behavior on currentSize {
|
|
enabled: Config.bar.workspaces.activeTrail
|
|
|
|
EAnim {}
|
|
}
|
|
|
|
Behavior on offset {
|
|
enabled: !Config.bar.workspaces.activeTrail
|
|
|
|
EAnim {}
|
|
}
|
|
|
|
Behavior on size {
|
|
enabled: !Config.bar.workspaces.activeTrail
|
|
|
|
EAnim {}
|
|
}
|
|
|
|
component EAnim: Anim {
|
|
easing.bezierCurve: Appearance.anim.curves.emphasized
|
|
}
|
|
}
|