internal: bar only vertical
The bar can only be vertical Remove box, boxlayout and anchortext Add StyledClippingRect
This commit is contained in:
parent
7d1ee06807
commit
63da636144
18 changed files with 107 additions and 225 deletions
|
|
@ -24,8 +24,6 @@ StyledRect {
|
||||||
Item {
|
Item {
|
||||||
id: child
|
id: child
|
||||||
|
|
||||||
readonly property bool vertical: true
|
|
||||||
|
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
@ -40,7 +38,7 @@ StyledRect {
|
||||||
anchors.topMargin: Appearance.padding.large
|
anchors.topMargin: Appearance.padding.large
|
||||||
}
|
}
|
||||||
|
|
||||||
ClippingRectangle {
|
StyledClippingRect {
|
||||||
id: workspaces
|
id: workspaces
|
||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
@ -57,16 +55,6 @@ StyledRect {
|
||||||
id: workspacesInner
|
id: workspacesInner
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
vertical: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Appearance.anim.durations.normal
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Appearance.anim.curves.standard
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import QtQuick
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property bool vertical: parent?.vertical ?? false
|
|
||||||
property color colour: Colours.palette.m3primary
|
property color colour: Colours.palette.m3primary
|
||||||
|
|
||||||
implicitWidth: child.implicitWidth
|
implicitWidth: child.implicitWidth
|
||||||
|
|
@ -18,13 +17,11 @@ Item {
|
||||||
Item {
|
Item {
|
||||||
id: child
|
id: child
|
||||||
|
|
||||||
readonly property bool vertical: root.vertical
|
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
implicitWidth: root.vertical ? Math.max(icon.implicitWidth, text.implicitHeight) : icon.implicitWidth + text.implicitWidth + text.anchors.leftMargin
|
implicitWidth: Math.max(icon.implicitWidth, text.implicitHeight)
|
||||||
implicitHeight: root.vertical ? icon.implicitHeight + text.implicitWidth + text.anchors.topMargin : Math.max(icon.implicitHeight, text.implicitheight)
|
implicitHeight: icon.implicitHeight + text.implicitWidth + text.anchors.topMargin
|
||||||
|
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
id: icon
|
id: icon
|
||||||
|
|
@ -33,13 +30,15 @@ Item {
|
||||||
text: Icons.getAppCategoryIcon(Hyprland.activeClient?.wmClass, "desktop_windows")
|
text: Icons.getAppCategoryIcon(Hyprland.activeClient?.wmClass, "desktop_windows")
|
||||||
color: root.colour
|
color: root.colour
|
||||||
|
|
||||||
anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
AnchorText {
|
StyledText {
|
||||||
id: text
|
id: text
|
||||||
|
|
||||||
prevAnchor: icon
|
anchors.horizontalCenter: icon.horizontalCenter
|
||||||
|
anchors.top: icon.bottom
|
||||||
|
anchors.topMargin: Appearance.spacing.small
|
||||||
|
|
||||||
text: metrics.elidedText
|
text: metrics.elidedText
|
||||||
font.pointSize: metrics.font.pointSize
|
font.pointSize: metrics.font.pointSize
|
||||||
|
|
@ -47,13 +46,13 @@ Item {
|
||||||
color: root.colour
|
color: root.colour
|
||||||
|
|
||||||
transform: Rotation {
|
transform: Rotation {
|
||||||
angle: vertical ? 90 : 0
|
angle: 90
|
||||||
origin.x: text.implicitHeight / 2
|
origin.x: text.implicitHeight / 2
|
||||||
origin.y: text.implicitHeight / 2
|
origin.y: text.implicitHeight / 2
|
||||||
}
|
}
|
||||||
|
|
||||||
width: vertical ? implicitHeight : implicitWidth
|
width: implicitHeight
|
||||||
height: vertical ? implicitWidth : implicitHeight
|
height: implicitWidth
|
||||||
}
|
}
|
||||||
|
|
||||||
TextMetrics {
|
TextMetrics {
|
||||||
|
|
@ -63,7 +62,7 @@ Item {
|
||||||
font.pointSize: Appearance.font.size.smaller
|
font.pointSize: Appearance.font.size.smaller
|
||||||
font.family: Appearance.font.family.mono
|
font.family: Appearance.font.family.mono
|
||||||
elide: Qt.ElideRight
|
elide: Qt.ElideRight
|
||||||
elideWidth: root.vertical ? root.height - icon.height : root.width - icon.width
|
elideWidth: root.height - icon.height
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on implicitWidth {
|
Behavior on implicitWidth {
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,12 @@ import "root:/services"
|
||||||
import "root:/config"
|
import "root:/config"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
Item {
|
Column {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property bool vertical: parent?.vertical ?? false
|
|
||||||
property color colour: Colours.palette.m3tertiary
|
property color colour: Colours.palette.m3tertiary
|
||||||
|
|
||||||
implicitWidth: vertical ? Math.max(icon.implicitWidth, text.implicitWidth) : icon.implicitWidth + text.implicitWidth + text.anchors.leftMargin
|
spacing: Appearance.spacing.small
|
||||||
implicitHeight: vertical ? icon.implicitHeight + text.implicitHeight + text.anchors.topMargin : Math.max(icon.implicitHeight, text.implicitHeight)
|
|
||||||
|
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
id: icon
|
id: icon
|
||||||
|
|
@ -18,16 +16,16 @@ Item {
|
||||||
text: "calendar_month"
|
text: "calendar_month"
|
||||||
color: root.colour
|
color: root.colour
|
||||||
|
|
||||||
anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
AnchorText {
|
StyledText {
|
||||||
id: text
|
id: text
|
||||||
|
|
||||||
prevAnchor: icon
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
horizontalAlignment: StyledText.AlignHCenter
|
horizontalAlignment: StyledText.AlignHCenter
|
||||||
text: root.vertical ? Time.format("hh\nmm") : Time.format("hh:mm • dddd, dd MMMM")
|
text: Time.format("hh\nmm")
|
||||||
font.pointSize: Appearance.font.size.smaller
|
font.pointSize: Appearance.font.size.smaller
|
||||||
font.family: Appearance.font.family.mono
|
font.family: Appearance.font.family.mono
|
||||||
color: root.colour
|
color: root.colour
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,11 @@ import QtQuick
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property bool vertical: parent?.vertical ?? false
|
|
||||||
property color colour: Colours.palette.m3secondary
|
property color colour: Colours.palette.m3secondary
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
implicitWidth: vertical ? Math.max(network.implicitWidth, bluetooth.implicitWidth, devices.implicitWidth, battery.implicitWidth) : network.implicitWidth + bluetooth.implicitWidth + bluetooth.anchors.leftMargin + (repeater.count > 0 ? devices.implicitWidth + devices.anchors.leftMargin : 0) + (battery.active ? battery.implicitWidth + battery.anchors.leftMargin : 0)
|
implicitWidth: Math.max(network.implicitWidth, bluetooth.implicitWidth, devices.implicitWidth, battery.implicitWidth)
|
||||||
implicitHeight: vertical ? network.implicitHeight + bluetooth.implicitHeight + bluetooth.anchors.topMargin + (repeater.count > 0 ? devices.implicitHeight + devices.anchors.topMargin : 0) + (battery.active ? battery.implicitHeight + battery.anchors.topMargin : 0) : Math.max(network.implicitHeight, bluetooth.implicitHeight, devices.implicitHeight, battery.implicitHeight)
|
implicitHeight: network.implicitHeight + bluetooth.implicitHeight + bluetooth.anchors.topMargin + (repeater.count > 0 ? devices.implicitHeight + devices.anchors.topMargin : 0) + (battery.active ? battery.implicitHeight + battery.anchors.topMargin : 0)
|
||||||
|
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
id: network
|
id: network
|
||||||
|
|
@ -23,31 +22,27 @@ Item {
|
||||||
text: Icons.getNetworkIcon(Network.active?.strength ?? 0)
|
text: Icons.getNetworkIcon(Network.active?.strength ?? 0)
|
||||||
color: root.colour
|
color: root.colour
|
||||||
|
|
||||||
anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
AnchorText {
|
MaterialIcon {
|
||||||
id: bluetooth
|
id: bluetooth
|
||||||
|
|
||||||
prevAnchor: network
|
anchors.horizontalCenter: network.horizontalCenter
|
||||||
|
anchors.top: network.bottom
|
||||||
|
anchors.topMargin: Appearance.spacing.small
|
||||||
|
|
||||||
animate: true
|
animate: true
|
||||||
text: Bluetooth.powered ? "bluetooth" : "bluetooth_disabled"
|
text: Bluetooth.powered ? "bluetooth" : "bluetooth_disabled"
|
||||||
color: root.colour
|
color: root.colour
|
||||||
font.family: Appearance.font.family.material
|
|
||||||
font.pointSize: Appearance.font.size.larger
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Box {
|
Column {
|
||||||
id: devices
|
id: devices
|
||||||
|
|
||||||
anchors.left: vertical ? undefined : bluetooth.right
|
anchors.horizontalCenter: bluetooth.horizontalCenter
|
||||||
anchors.leftMargin: vertical ? 0 : Appearance.padding.smaller
|
anchors.top: bluetooth.bottom
|
||||||
anchors.top: vertical ? bluetooth.bottom : undefined
|
anchors.topMargin: Appearance.spacing.small
|
||||||
anchors.topMargin: vertical ? Appearance.padding.smaller : 0
|
|
||||||
|
|
||||||
anchors.horizontalCenter: vertical ? bluetooth.horizontalCenter : undefined
|
|
||||||
anchors.verticalCenter: vertical ? undefined : bluetooth.verticalCenter
|
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
id: repeater
|
id: repeater
|
||||||
|
|
@ -69,13 +64,9 @@ Item {
|
||||||
Loader {
|
Loader {
|
||||||
id: battery
|
id: battery
|
||||||
|
|
||||||
anchors.left: root.vertical ? undefined : repeater.count > 0 ? devices.right : bluetooth.right
|
anchors.horizontalCenter: devices.horizontalCenter
|
||||||
anchors.leftMargin: root.vertical ? 0 : Appearance.padding.smaller
|
anchors.top: repeater.count > 0 ? devices.bottom : bluetooth.bottom
|
||||||
anchors.top: root.vertical ? repeater.count > 0 ? devices.bottom : bluetooth.bottom : undefined
|
anchors.topMargin: Appearance.spacing.small
|
||||||
anchors.topMargin: root.vertical ? Appearance.padding.smaller : 0
|
|
||||||
|
|
||||||
anchors.horizontalCenter: root.vertical ? devices.horizontalCenter : undefined
|
|
||||||
anchors.verticalCenter: root.vertical ? undefined : devices.verticalCenter
|
|
||||||
|
|
||||||
active: UPower.displayDevice.isLaptopBattery
|
active: UPower.displayDevice.isLaptopBattery
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
|
|
@ -84,7 +75,7 @@ Item {
|
||||||
text: {
|
text: {
|
||||||
const device = UPower.displayDevice;
|
const device = UPower.displayDevice;
|
||||||
const perc = device.percentage;
|
const perc = device.percentage;
|
||||||
const charging = device.changeRate >= 0;
|
const charging = device.changeRate > 0;
|
||||||
if (perc === 1)
|
if (perc === 1)
|
||||||
return charging ? "battery_charging_full" : "battery_full";
|
return charging ? "battery_charging_full" : "battery_full";
|
||||||
let level = Math.floor(perc * 7);
|
let level = Math.floor(perc * 7);
|
||||||
|
|
@ -92,7 +83,7 @@ Item {
|
||||||
level--;
|
level--;
|
||||||
return charging ? `battery_charging_${(level + 3) * 10}` : `battery_${level}_bar`;
|
return charging ? `battery_charging_${(level + 3) * 10}` : `battery_${level}_bar`;
|
||||||
}
|
}
|
||||||
color: UPower.displayDevice.percentage > 0.2 ? root.colour : Colours.palette.m3error
|
color: UPower.displayDevice.percentage > 0.2 || UPower.displayDevice.changeRate > 0 ? root.colour : Colours.palette.m3error
|
||||||
fill: 1
|
fill: 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
import "root:/widgets"
|
|
||||||
import "root:/services"
|
|
||||||
import "root:/config"
|
import "root:/config"
|
||||||
import Quickshell.Services.SystemTray
|
import Quickshell.Services.SystemTray
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
@ -7,17 +5,28 @@ import QtQuick
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property bool vertical: parent?.vertical ?? false
|
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
visible: width > 0 && height > 0 // To avoid warnings about being visible with no size
|
visible: width > 0 && height > 0 // To avoid warnings about being visible with no size
|
||||||
|
|
||||||
implicitWidth: layout.implicitWidth
|
implicitWidth: layout.implicitWidth
|
||||||
implicitHeight: layout.implicitHeight
|
implicitHeight: layout.implicitHeight
|
||||||
|
|
||||||
BoxLayout {
|
Column {
|
||||||
id: layout
|
id: layout
|
||||||
|
|
||||||
|
spacing: Appearance.spacing.small
|
||||||
|
|
||||||
|
add: Transition {
|
||||||
|
NumberAnimation {
|
||||||
|
properties: "scale"
|
||||||
|
from: 0
|
||||||
|
to: 1
|
||||||
|
duration: Appearance.anim.durations.normal
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: Appearance.anim.curves.standardDecel
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: SystemTray.items
|
model: SystemTray.items
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,9 @@ import "root:/config"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Effects
|
import QtQuick.Effects
|
||||||
|
|
||||||
Rectangle {
|
StyledRect {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property bool vertical
|
|
||||||
required property list<Workspace> workspaces
|
required property list<Workspace> workspaces
|
||||||
required property Item mask
|
required property Item mask
|
||||||
required property real maskWidth
|
required property real maskWidth
|
||||||
|
|
@ -15,34 +14,26 @@ Rectangle {
|
||||||
required property int groupOffset
|
required property int groupOffset
|
||||||
|
|
||||||
readonly property Workspace currentWs: workspaces[Hyprland.activeWsId - 1 - groupOffset] ?? null
|
readonly property Workspace currentWs: workspaces[Hyprland.activeWsId - 1 - groupOffset] ?? null
|
||||||
property real leading: (vertical ? currentWs?.y : currentWs?.x) ?? 0
|
property real leading: currentWs?.y ?? 0
|
||||||
property real trailing: (vertical ? currentWs?.y : currentWs?.x) ?? 0
|
property real trailing: currentWs?.y ?? 0
|
||||||
property real currentSize: (currentWs?.size) ?? 0
|
property real currentSize: (currentWs?.size) ?? 0
|
||||||
property real size: Math.abs(leading - trailing) + currentSize
|
property real size: Math.abs(leading - trailing) + currentSize
|
||||||
property real offset: Math.min(leading, trailing)
|
property real offset: Math.min(leading, trailing)
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
x: vertical ? 1 : offset + 1
|
x: 1
|
||||||
y: vertical ? offset + 1 : 1
|
y: offset + 1
|
||||||
implicitWidth: (vertical ? BarConfig.sizes.innerHeight : size) - 2
|
implicitWidth: BarConfig.sizes.innerHeight - 2
|
||||||
implicitHeight: (vertical ? size : BarConfig.sizes.innerHeight) - 2
|
implicitHeight: size - 2
|
||||||
radius: BarConfig.workspaces.rounded ? Appearance.rounding.full : 0
|
radius: BarConfig.workspaces.rounded ? Appearance.rounding.full : 0
|
||||||
color: Colours.palette.m3primary
|
color: Colours.palette.m3primary
|
||||||
|
|
||||||
Rectangle {
|
StyledRect {
|
||||||
id: base
|
id: base
|
||||||
|
|
||||||
visible: false
|
visible: false
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: Colours.palette.m3onPrimary
|
color: Colours.palette.m3onPrimary
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Appearance.anim.durations.normal
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Appearance.anim.curves.standard
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MultiEffect {
|
MultiEffect {
|
||||||
|
|
@ -52,21 +43,12 @@ Rectangle {
|
||||||
maskSpreadAtMin: 1
|
maskSpreadAtMin: 1
|
||||||
maskThresholdMin: 0.5
|
maskThresholdMin: 0.5
|
||||||
|
|
||||||
x: root.vertical ? 0 : -parent.offset
|
x: 0
|
||||||
y: root.vertical ? -parent.offset : 0
|
y: -parent.offset
|
||||||
implicitWidth: root.maskWidth
|
implicitWidth: root.maskWidth
|
||||||
implicitHeight: root.maskHeight
|
implicitHeight: root.maskHeight
|
||||||
|
|
||||||
anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.verticalCenter: root.vertical ? undefined : parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Appearance.anim.durations.normal
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Appearance.anim.curves.standard
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on leading {
|
Behavior on leading {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import QtQuick
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property bool vertical
|
|
||||||
required property list<Workspace> workspaces
|
required property list<Workspace> workspaces
|
||||||
required property var occupied
|
required property var occupied
|
||||||
required property int groupOffset
|
required property int groupOffset
|
||||||
|
|
@ -44,7 +43,7 @@ Item {
|
||||||
values: root.pills.filter(p => p)
|
values: root.pills.filter(p => p)
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
StyledRect {
|
||||||
id: rect
|
id: rect
|
||||||
|
|
||||||
required property var modelData
|
required property var modelData
|
||||||
|
|
@ -57,23 +56,14 @@ Item {
|
||||||
|
|
||||||
x: start?.x ?? 0
|
x: start?.x ?? 0
|
||||||
y: start?.y ?? 0
|
y: start?.y ?? 0
|
||||||
implicitWidth: root.vertical ? BarConfig.sizes.innerHeight : end?.x + end?.width - start?.x
|
implicitWidth: BarConfig.sizes.innerHeight
|
||||||
implicitHeight: root.vertical ? end?.y + end?.height - start?.y : BarConfig.sizes.innerHeight
|
implicitHeight: end?.y + end?.height - start?.y
|
||||||
|
|
||||||
anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.verticalCenter: root.vertical ? undefined : parent.verticalCenter
|
|
||||||
|
|
||||||
scale: 0
|
scale: 0
|
||||||
Component.onCompleted: scale = 1
|
Component.onCompleted: scale = 1
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Appearance.anim.durations.normal
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Appearance.anim.curves.standard
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
Anim {
|
Anim {
|
||||||
easing.bezierCurve: Appearance.anim.curves.standardDecel
|
easing.bezierCurve: Appearance.anim.curves.standardDecel
|
||||||
|
|
|
||||||
|
|
@ -10,20 +10,19 @@ Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property int index
|
required property int index
|
||||||
required property bool vertical
|
|
||||||
required property var occupied
|
required property var occupied
|
||||||
required property int groupOffset
|
required property int groupOffset
|
||||||
|
|
||||||
readonly property bool isWorkspace: true // Flag for finding workspace children
|
readonly property bool isWorkspace: true // Flag for finding workspace children
|
||||||
// Unanimated prop for others to use as reference
|
// Unanimated prop for others to use as reference
|
||||||
readonly property real size: childrenRect[vertical ? "height" : "width"] + (hasWindows ? Appearance.padding.normal : 0)
|
readonly property real size: childrenRect.height + (hasWindows ? Appearance.padding.normal : 0)
|
||||||
|
|
||||||
readonly property int ws: groupOffset + index + 1
|
readonly property int ws: groupOffset + index + 1
|
||||||
readonly property bool isOccupied: occupied[ws] ?? false
|
readonly property bool isOccupied: occupied[ws] ?? false
|
||||||
readonly property bool hasWindows: isOccupied && BarConfig.workspaces.showWindows
|
readonly property bool hasWindows: isOccupied && BarConfig.workspaces.showWindows
|
||||||
|
|
||||||
Layout.preferredWidth: childrenRect.width + (hasWindows && !vertical ? Appearance.padding.normal : 0)
|
Layout.preferredWidth: childrenRect.width
|
||||||
Layout.preferredHeight: childrenRect.height + (hasWindows && vertical ? Appearance.padding.normal : 0)
|
Layout.preferredHeight: size
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
id: indicator
|
id: indicator
|
||||||
|
|
@ -43,16 +42,25 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
|
id: windows
|
||||||
|
|
||||||
active: BarConfig.workspaces.showWindows
|
active: BarConfig.workspaces.showWindows
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
|
|
||||||
anchors.left: root.vertical ? undefined : indicator.right
|
anchors.horizontalCenter: indicator.horizontalCenter
|
||||||
anchors.top: root.vertical ? indicator.bottom : undefined
|
anchors.top: indicator.bottom
|
||||||
anchors.verticalCenter: root.vertical ? undefined : indicator.verticalCenter
|
|
||||||
anchors.horizontalCenter: root.vertical ? indicator.horizontalCenter : undefined
|
|
||||||
|
|
||||||
sourceComponent: Box {
|
sourceComponent: Column {
|
||||||
vertical: root.vertical
|
spacing: Appearance.spacing.small
|
||||||
|
|
||||||
|
add: Transition {
|
||||||
|
Anim {
|
||||||
|
properties: "scale"
|
||||||
|
from: 0
|
||||||
|
to: 1
|
||||||
|
easing.bezierCurve: Appearance.anim.curves.standardDecel
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: ScriptModel {
|
model: ScriptModel {
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,11 @@ import "root:/widgets"
|
||||||
import "root:/services"
|
import "root:/services"
|
||||||
import "root:/config"
|
import "root:/config"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property alias vertical: layout.vertical
|
|
||||||
|
|
||||||
readonly property list<Workspace> workspaces: layout.children.filter(c => c.isWorkspace).sort((w1, w2) => w1.ws - w2.ws)
|
readonly property list<Workspace> workspaces: layout.children.filter(c => c.isWorkspace).sort((w1, w2) => w1.ws - w2.ws)
|
||||||
readonly property var occupied: Hyprland.workspaces.values.reduce((acc, curr) => {
|
readonly property var occupied: Hyprland.workspaces.values.reduce((acc, curr) => {
|
||||||
acc[curr.id] = curr.lastIpcObject.windows > 0;
|
acc[curr.id] = curr.lastIpcObject.windows > 0;
|
||||||
|
|
@ -20,7 +19,7 @@ Item {
|
||||||
implicitWidth: layout.implicitWidth
|
implicitWidth: layout.implicitWidth
|
||||||
implicitHeight: layout.implicitHeight
|
implicitHeight: layout.implicitHeight
|
||||||
|
|
||||||
BoxLayout {
|
ColumnLayout {
|
||||||
id: layout
|
id: layout
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
@ -31,7 +30,6 @@ Item {
|
||||||
model: BarConfig.workspaces.shown
|
model: BarConfig.workspaces.shown
|
||||||
|
|
||||||
Workspace {
|
Workspace {
|
||||||
vertical: root.vertical
|
|
||||||
occupied: root.occupied
|
occupied: root.occupied
|
||||||
groupOffset: root.groupOffset
|
groupOffset: root.groupOffset
|
||||||
}
|
}
|
||||||
|
|
@ -46,7 +44,6 @@ Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
sourceComponent: OccupiedBg {
|
sourceComponent: OccupiedBg {
|
||||||
vertical: root.vertical
|
|
||||||
workspaces: root.workspaces
|
workspaces: root.workspaces
|
||||||
occupied: root.occupied
|
occupied: root.occupied
|
||||||
groupOffset: root.groupOffset
|
groupOffset: root.groupOffset
|
||||||
|
|
@ -58,7 +55,6 @@ Item {
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
|
|
||||||
sourceComponent: ActiveIndicator {
|
sourceComponent: ActiveIndicator {
|
||||||
vertical: root.vertical
|
|
||||||
workspaces: root.workspaces
|
workspaces: root.workspaces
|
||||||
mask: layout
|
mask: layout
|
||||||
maskWidth: root.width
|
maskWidth: root.width
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ClippingRectangle {
|
StyledClippingRect {
|
||||||
id: cover
|
id: cover
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
@ -130,14 +130,6 @@ Item {
|
||||||
sourceSize.width: width
|
sourceSize.width: width
|
||||||
sourceSize.height: height
|
sourceSize.height: height
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Appearance.anim.durations.normal
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Appearance.anim.curves.standard
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ClippingRectangle {
|
StyledClippingRect {
|
||||||
id: cover
|
id: cover
|
||||||
|
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
|
@ -118,14 +118,6 @@ Item {
|
||||||
sourceSize.width: width
|
sourceSize.width: width
|
||||||
sourceSize.height: height
|
sourceSize.height: height
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Appearance.anim.durations.normal
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Appearance.anim.curves.standard
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ Row {
|
||||||
padding: Appearance.padding.large
|
padding: Appearance.padding.large
|
||||||
spacing: Appearance.spacing.large
|
spacing: Appearance.spacing.large
|
||||||
|
|
||||||
ClippingRectangle {
|
StyledClippingRect {
|
||||||
implicitWidth: info.implicitHeight
|
implicitWidth: info.implicitHeight
|
||||||
implicitHeight: info.implicitHeight
|
implicitHeight: info.implicitHeight
|
||||||
|
|
||||||
|
|
@ -32,14 +32,6 @@ Row {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
path: `${Paths.home}/.face`
|
path: `${Paths.home}/.face`
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Appearance.anim.durations.normal
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Appearance.anim.curves.standard
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
|
|
@ -109,10 +101,11 @@ Row {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
AnchorText {
|
StyledText {
|
||||||
id: text
|
id: text
|
||||||
|
|
||||||
prevAnchor: icon
|
anchors.verticalCenter: icon.verticalCenter
|
||||||
|
anchors.left: icon.right
|
||||||
anchors.leftMargin: icon.anchors.leftMargin
|
anchors.leftMargin: icon.anchors.leftMargin
|
||||||
text: `: ${line.text}`
|
text: `: ${line.text}`
|
||||||
font.pointSize: Appearance.font.size.normal
|
font.pointSize: Appearance.font.size.normal
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
import "root:/config"
|
|
||||||
import QtQuick
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
required property Item prevAnchor
|
|
||||||
property bool vertical: parent.vertical ?? false
|
|
||||||
|
|
||||||
anchors.left: vertical ? undefined : prevAnchor.right
|
|
||||||
anchors.leftMargin: vertical ? 0 : Appearance.padding.smaller
|
|
||||||
anchors.top: vertical ? prevAnchor.bottom : undefined
|
|
||||||
anchors.topMargin: vertical ? Appearance.padding.smaller : 0
|
|
||||||
|
|
||||||
anchors.horizontalCenter: vertical ? prevAnchor.horizontalCenter : undefined
|
|
||||||
anchors.verticalCenter: vertical ? undefined : prevAnchor.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
import "root:/config"
|
|
||||||
import QtQuick
|
|
||||||
|
|
||||||
Grid {
|
|
||||||
property bool vertical: parent.vertical ?? false // Propagate from parent
|
|
||||||
|
|
||||||
flow: vertical ? Grid.TopToBottom : Grid.LeftToRight
|
|
||||||
spacing: Appearance.spacing.small
|
|
||||||
|
|
||||||
onVerticalChanged: {
|
|
||||||
if (vertical) {
|
|
||||||
rows = -1;
|
|
||||||
columns = 1;
|
|
||||||
} else {
|
|
||||||
columns = -1;
|
|
||||||
rows = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
add: Transition {
|
|
||||||
NumberAnimation {
|
|
||||||
properties: "scale"
|
|
||||||
from: 0
|
|
||||||
to: 1
|
|
||||||
duration: Appearance.anim.durations.normal
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Appearance.anim.curves.standardDecel
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
import "root:/config"
|
|
||||||
import QtQuick.Layouts
|
|
||||||
|
|
||||||
GridLayout {
|
|
||||||
property bool vertical: parent.vertical ?? false // Propagate from parent
|
|
||||||
property bool homogenous: false
|
|
||||||
property int spacing: Appearance.spacing.small
|
|
||||||
|
|
||||||
flow: vertical ? GridLayout.TopToBottom : GridLayout.LeftToRight
|
|
||||||
uniformCellWidths: homogenous || vertical
|
|
||||||
uniformCellHeights: homogenous || !vertical
|
|
||||||
rows: vertical ? -1 : 1
|
|
||||||
columns: vertical ? 1 : -1
|
|
||||||
rowSpacing: spacing
|
|
||||||
columnSpacing: spacing
|
|
||||||
}
|
|
||||||
|
|
@ -3,7 +3,7 @@ import "root:/services"
|
||||||
import "root:/config"
|
import "root:/config"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
Rectangle {
|
StyledRect {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property alias hovered: mouse.hovered
|
readonly property alias hovered: mouse.hovered
|
||||||
|
|
@ -40,12 +40,4 @@ Rectangle {
|
||||||
easing.bezierCurve: Appearance.anim.curves.standard
|
easing.bezierCurve: Appearance.anim.curves.standard
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Appearance.anim.durations.normal
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Appearance.anim.curves.standard
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
17
widgets/StyledClippingRect.qml
Normal file
17
widgets/StyledClippingRect.qml
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
import "root:/config"
|
||||||
|
import Quickshell.Widgets
|
||||||
|
import QtQuick
|
||||||
|
|
||||||
|
ClippingRectangle {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
color: "transparent"
|
||||||
|
|
||||||
|
Behavior on color {
|
||||||
|
ColorAnimation {
|
||||||
|
duration: Appearance.anim.durations.normal
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: Appearance.anim.curves.standard
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4,8 +4,6 @@ import QtQuick
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property bool vertical: parent?.vertical ?? false // Convenience property for propagation to children
|
|
||||||
|
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue