refactor done?

This commit is contained in:
Zacharias-Brohn
2026-03-10 15:39:29 +01:00
parent 26bc5cd7c3
commit 098db5e903
34 changed files with 161 additions and 877 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ import qs.Config
RadioButton { RadioButton {
id: root id: root
font.pointSize: 12 font.pointSize: Appearance.font.size.normal
implicitHeight: Math.max(implicitIndicatorHeight, implicitContentHeight) implicitHeight: Math.max(implicitIndicatorHeight, implicitContentHeight)
implicitWidth: implicitIndicatorWidth + implicitContentWidth + contentItem.anchors.leftMargin implicitWidth: implicitIndicatorWidth + implicitContentWidth + contentItem.anchors.leftMargin
+1 -1
View File
@@ -5,7 +5,7 @@ CustomText {
property int grade: DynamicColors.light ? 0 : -25 property int grade: DynamicColors.light ? 0 : -25
font.family: "Material Symbols Rounded" font.family: "Material Symbols Rounded"
font.pointSize: 15 font.pointSize: Appearance.font.size.larger
font.variableAxes: ({ font.variableAxes: ({
FILL: fill.toFixed(1), FILL: fill.toFixed(1),
GRAD: grade, GRAD: grade,
+1
View File
@@ -71,6 +71,7 @@ JsonObject {
property real scale: 1 property real scale: 1
property int small: 5 * scale property int small: 5 * scale
property int smaller: 7 * scale property int smaller: 7 * scale
property int smallest: 2 * scale
} }
component Rounding: JsonObject { component Rounding: JsonObject {
property int full: 1000 * scale property int full: 1000 * scale
+1 -6
View File
@@ -23,14 +23,9 @@ Shape {
anchors.fill: parent anchors.fill: parent
anchors.margins: Config.barConfig.border anchors.margins: Config.barConfig.border
anchors.topMargin: Config.barConfig.autoHide && !visibilities.bar ? 0 : bar.implicitHeight anchors.topMargin: bar.implicitHeight
preferredRendererType: Shape.CurveRenderer preferredRendererType: Shape.CurveRenderer
Behavior on anchors.topMargin {
Anim {
}
}
Drawing.Background { Drawing.Background {
startX: 0 startX: 0
startY: wrapper.y - rounding startY: wrapper.y - rounding
+6 -6
View File
@@ -66,8 +66,8 @@ CustomMouseArea {
popouts.hasCurrent = false; popouts.hasCurrent = false;
} }
if (Config.barConfig.autoHide && !root.visibilities.sidebar && !root.visibilities.dashboard) if (Config.barConfig.autoHide)
root.visibilities.bar = false; bar.isHovered = false;
} }
} }
onPositionChanged: event => { onPositionChanged: event => {
@@ -84,8 +84,8 @@ CustomMouseArea {
root.panels.drawing.expanded = false; root.panels.drawing.expanded = false;
} }
if (!visibilities.bar && Config.barConfig.autoHide && y < bar.implicitHeight + bar.anchors.topMargin) if (!visibilities.bar && Config.barConfig.autoHide && y < bar.implicitHeight)
visibilities.bar = true; bar.isHovered = true;
if (panels.sidebar.width === 0) { if (panels.sidebar.width === 0) {
const showOsd = inRightPanel(panels.osd, x, y); const showOsd = inRightPanel(panels.osd, x, y);
@@ -107,8 +107,8 @@ CustomMouseArea {
} }
} }
if (y < bar.implicitHeight) { if (y < root.bar.implicitHeight) {
bar.checkPopout(x); root.bar.checkPopout(x);
} }
} }
+1 -6
View File
@@ -35,12 +35,7 @@ Item {
anchors.fill: parent anchors.fill: parent
anchors.margins: Config.barConfig.border anchors.margins: Config.barConfig.border
anchors.topMargin: Config.barConfig.autoHide && !visibilities.bar ? 0 : bar.implicitHeight anchors.topMargin: bar.implicitHeight
Behavior on anchors.topMargin {
Anim {
}
}
Resources.Wrapper { Resources.Wrapper {
id: resources id: resources
+33 -51
View File
@@ -21,18 +21,23 @@ Variants {
required property var modelData required property var modelData
PanelWindow { Exclusions {
id: bar bar: bar
screen: scope.modelData
}
CustomWindow {
id: win
readonly property bool hasFullscreen: Hypr.monitorFor(screen)?.activeWorkspace?.toplevels.values.some(t => t.lastIpcObject.fullscreen === 2)
property var root: Quickshell.shellDir property var root: Quickshell.shellDir
property bool trayMenuVisible: false
WlrLayershell.exclusionMode: ExclusionMode.Ignore WlrLayershell.exclusionMode: ExclusionMode.Ignore
WlrLayershell.keyboardFocus: visibilities.launcher || visibilities.sidebar || visibilities.dashboard || visibilities.settings || visibilities.resources ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None WlrLayershell.keyboardFocus: visibilities.launcher || visibilities.sidebar || visibilities.dashboard || visibilities.settings || visibilities.resources ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
WlrLayershell.namespace: "ZShell-Bar"
color: "transparent" color: "transparent"
contentItem.focus: true contentItem.focus: true
mask: visibilities.isDrawing ? null : region mask: visibilities.isDrawing ? null : region
name: "Bar"
screen: scope.modelData screen: scope.modelData
contentItem.Keys.onEscapePressed: { contentItem.Keys.onEscapePressed: {
@@ -44,21 +49,23 @@ Variants {
visibilities.settings = false; visibilities.settings = false;
visibilities.resources = false; visibilities.resources = false;
} }
onHasFullscreenChanged: {
visibilities.launcher = false;
visibilities.dashboard = false;
visibilities.osd = false;
visibilities.settings = false;
visibilities.resources = false;
}
Region { Region {
id: region id: region
height: bar.screen.height - backgroundRect.implicitHeight height: win.height - bar.implicitHeight - Config.barConfig.border
intersection: Intersection.Xor intersection: Intersection.Xor
regions: popoutRegions.instances regions: popoutRegions.instances
width: bar.width width: win.width - Config.barConfig.border * 2
x: 0 x: Config.barConfig.border
y: Config.barConfig.autoHide && !visibilities.bar ? 4 : backgroundRect.height y: bar.implicitHeight
}
Exclusions {
bar: barLoader
screen: scope.modelData
} }
anchors { anchors {
@@ -79,8 +86,8 @@ Variants {
height: modelData.height height: modelData.height
intersection: Intersection.Subtract intersection: Intersection.Subtract
width: modelData.width width: modelData.width
x: modelData.x x: modelData.x + Config.barConfig.border
y: modelData.y + backgroundRect.implicitHeight y: modelData.y + bar.implicitHeight
} }
} }
@@ -88,7 +95,7 @@ Variants {
id: focusGrab id: focusGrab
active: visibilities.resources || visibilities.launcher || visibilities.sidebar || visibilities.dashboard || visibilities.settings || (panels.popouts.hasCurrent && panels.popouts.currentName.startsWith("traymenu")) active: visibilities.resources || visibilities.launcher || visibilities.sidebar || visibilities.dashboard || visibilities.settings || (panels.popouts.hasCurrent && panels.popouts.currentName.startsWith("traymenu"))
windows: [bar] windows: [win]
onCleared: { onCleared: {
visibilities.launcher = false; visibilities.launcher = false;
@@ -136,12 +143,12 @@ Variants {
} }
Border { Border {
bar: backgroundRect bar: bar
visibilities: visibilities visibilities: visibilities
} }
Backgrounds { Backgrounds {
bar: backgroundRect bar: bar
panels: panels panels: panels
visibilities: visibilities visibilities: visibilities
} }
@@ -157,7 +164,7 @@ Variants {
DrawingInput { DrawingInput {
id: input id: input
bar: backgroundRect bar: bar
drawing: drawing drawing: drawing
panels: panels panels: panels
popout: panels.drawing popout: panels.drawing
@@ -169,7 +176,7 @@ Variants {
id: mouseArea id: mouseArea
anchors.fill: parent anchors.fill: parent
bar: barLoader bar: bar
drawing: drawing drawing: drawing
input: input input: input
panels: panels panels: panels
@@ -181,45 +188,20 @@ Variants {
Panels { Panels {
id: panels id: panels
bar: backgroundRect bar: bar
drawingItem: drawing drawingItem: drawing
screen: scope.modelData screen: scope.modelData
visibilities: visibilities visibilities: visibilities
} }
CustomRect { BarLoader {
id: backgroundRect id: bar
property Wrapper popouts: panels.popouts
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top popouts: panels.popouts
anchors.topMargin: Config.barConfig.autoHide && !visibilities.bar ? -30 : 0 screen: scope.modelData
color: "transparent" visibilities: visibilities
implicitHeight: barLoader.implicitHeight
radius: 0
Behavior on anchors.topMargin {
Anim {
}
}
Behavior on color {
CAnim {
}
}
BarLoader {
id: barLoader
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
bar: bar
popouts: panels.popouts
screen: scope.modelData
visibilities: visibilities
}
} }
} }
} }
+9 -15
View File
@@ -7,15 +7,16 @@ import qs.Modules
import qs.Config import qs.Config
import qs.Components import qs.Components
Item { CustomRect {
id: root id: root
property color barColor: DynamicColors.palette.m3primary property color barColor: DynamicColors.palette.m3primary
property color textColor: DynamicColors.palette.m3onSurface property color textColor: DynamicColors.palette.m3onSurface
anchors.bottom: parent.bottom color: DynamicColors.tPalette.m3surfaceContainer
anchors.top: parent.top implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2
implicitWidth: 150 implicitWidth: 150
radius: Appearance.rounding.full
Behavior on implicitWidth { Behavior on implicitWidth {
NumberAnimation { NumberAnimation {
@@ -24,28 +25,21 @@ Item {
} }
} }
CustomRect { Component.onCompleted: console.log(root.height, root.implicitHeight)
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
color: DynamicColors.tPalette.m3surfaceContainer
implicitHeight: root.parent.height - ((Appearance.padding.small - 1) * 2)
radius: height / 2
}
RowLayout { RowLayout {
id: layout id: layout
anchors.fill: parent anchors.left: parent.left
anchors.leftMargin: Appearance.padding.small anchors.leftMargin: Appearance.padding.small
anchors.rightMargin: Appearance.padding.small * 2
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: root.implicitWidth - Appearance.padding.small * 3
MaterialIcon { MaterialIcon {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
animate: true animate: true
color: Audio.muted ? DynamicColors.palette.m3error : root.textColor color: Audio.muted ? DynamicColors.palette.m3error : root.textColor
font.pointSize: 14 font.pointSize: Appearance.font.size.normal
text: Audio.muted ? "volume_off" : "volume_up" text: Audio.muted ? "volume_off" : "volume_up"
} }
@@ -74,7 +68,7 @@ Item {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
animate: true animate: true
color: (Audio.sourceMuted ?? false) ? DynamicColors.palette.m3error : root.textColor color: (Audio.sourceMuted ?? false) ? DynamicColors.palette.m3error : root.textColor
font.pointSize: 14 font.pointSize: Appearance.font.size.normal
text: Audio.sourceMuted ? "mic_off" : "mic" text: Audio.sourceMuted ? "mic_off" : "mic"
} }
+1 -2
View File
@@ -19,7 +19,7 @@ RowLayout {
required property PersistentProperties visibilities required property PersistentProperties visibilities
function checkPopout(x: real): void { function checkPopout(x: real): void {
const ch = childAt(x, 2) as WrappedLoader; const ch = childAt(x, height / 2) as WrappedLoader;
if (!ch || ch?.id === "spacer") { if (!ch || ch?.id === "spacer") {
if (!popouts.currentName.startsWith("traymenu")) if (!popouts.currentName.startsWith("traymenu"))
@@ -205,7 +205,6 @@ RowLayout {
} }
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
Layout.fillHeight: true
Layout.leftMargin: findFirstEnabled() === this ? root.vPadding : 0 Layout.leftMargin: findFirstEnabled() === this ? root.vPadding : 0
Layout.rightMargin: findLastEnabled() === this ? root.vPadding : 0 Layout.rightMargin: findLastEnabled() === this ? root.vPadding : 0
active: enabled active: enabled
+7 -7
View File
@@ -14,14 +14,13 @@ import qs.Modules.Network
Item { Item {
id: root id: root
required property PanelWindow bar
readonly property int contentHeight: Config.barConfig.height + padding * 2 readonly property int contentHeight: Config.barConfig.height + padding * 2
readonly property int exclusiveZone: Config.barConfig.autoHide ? Config.barConfig.border : contentHeight readonly property int exclusiveZone: Config.barConfig.autoHide ? Config.barConfig.border : contentHeight
property bool isHovered property bool isHovered
readonly property int padding: Math.max(Appearance.padding.smaller, Config.barConfig.border) readonly property int padding: Math.max(Appearance.padding.smaller, Config.barConfig.border)
required property Wrapper popouts required property Wrapper popouts
required property ShellScreen screen required property ShellScreen screen
readonly property bool shouldBeVisible: (!Config.barConfig.autoHide || visibilities.bar) readonly property bool shouldBeVisible: (!Config.barConfig.autoHide || visibilities.bar || isHovered)
readonly property int vPadding: 6 readonly property int vPadding: 6
required property PersistentProperties visibilities required property PersistentProperties visibilities
@@ -30,7 +29,7 @@ Item {
} }
implicitHeight: Config.barConfig.border implicitHeight: Config.barConfig.border
visible: width > Config.barConfig.border visible: height > Config.barConfig.border
states: State { states: State {
name: "visible" name: "visible"
@@ -46,8 +45,8 @@ Item {
to: "visible" to: "visible"
Anim { Anim {
duration: Appearance.anim.durations.expressiveDefaultSpatial duration: MaterialEasing.expressiveEffectsTime
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial easing.bezierCurve: MaterialEasing.expressiveEffects
property: "implicitHeight" property: "implicitHeight"
target: root target: root
} }
@@ -57,7 +56,8 @@ Item {
to: "" to: ""
Anim { Anim {
easing.bezierCurve: Appearance.anim.curves.emphasized duration: MaterialEasing.expressiveEffectsTime
easing.bezierCurve: MaterialEasing.expressiveEffects
property: "implicitHeight" property: "implicitHeight"
target: root target: root
} }
@@ -68,9 +68,9 @@ Item {
id: content id: content
active: root.shouldBeVisible || root.visible active: root.shouldBeVisible || root.visible
anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top
sourceComponent: Bar { sourceComponent: Bar {
height: root.contentHeight height: root.contentHeight
+2 -7
View File
@@ -17,7 +17,7 @@ Item {
CustomRect { CustomRect {
anchors.fill: parent anchors.fill: parent
color: Config.barConfig.autoHide && !root.visibilities.bar ? "transparent" : DynamicColors.palette.m3surface color: Config.barConfig.border === 1 ? "transparent" : DynamicColors.palette.m3surface
layer.enabled: true layer.enabled: true
layer.effect: MultiEffect { layer.effect: MultiEffect {
@@ -39,15 +39,10 @@ Item {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
anchors.margins: Config.barConfig.border anchors.margins: Config.barConfig.border
anchors.topMargin: Config.barConfig.autoHide && !root.visibilities.bar ? 4 : root.bar.implicitHeight anchors.topMargin: root.bar.implicitHeight
radius: Config.barConfig.border > 0 ? Config.barConfig.rounding : 0 radius: Config.barConfig.border > 0 ? Config.barConfig.rounding : 0
topLeftRadius: Config.barConfig.rounding topLeftRadius: Config.barConfig.rounding
topRightRadius: Config.barConfig.rounding topRightRadius: Config.barConfig.rounding
Behavior on anchors.topMargin {
Anim {
}
}
} }
} }
} }
-73
View File
@@ -1,73 +0,0 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import qs.Components
import qs.Config
import qs.Helpers
RowLayout {
spacing: 12
Rectangle {
Layout.preferredHeight: 40
Layout.preferredWidth: 40
color: "transparent"
radius: 1000
MaterialIcon {
anchors.centerIn: parent
color: DynamicColors.palette.m3onSurface
fill: 1
font.pointSize: 24
text: "arrow_back_2"
}
StateLayer {
onClicked: {
if (Calendar.displayMonth === 0) {
Calendar.displayMonth = 11;
Calendar.displayYear -= 1;
} else {
Calendar.displayMonth -= 1;
}
}
}
}
CustomText {
Layout.fillWidth: true
color: DynamicColors.palette.m3onSurface
font.pointSize: 14
font.weight: 600
horizontalAlignment: Text.AlignHCenter
text: new Date(Calendar.displayYear, Calendar.displayMonth, 1).toLocaleDateString(Qt.locale(), "MMMM yyyy")
}
Rectangle {
Layout.preferredHeight: 40
Layout.preferredWidth: 40
color: "transparent"
radius: 1000
MaterialIcon {
anchors.centerIn: parent
color: DynamicColors.palette.m3onSurface
fill: 1
font.pointSize: 24
rotation: 180
text: "arrow_back_2"
}
StateLayer {
onClicked: {
if (Calendar.displayMonth === 11) {
Calendar.displayMonth = 0;
Calendar.displayYear += 1;
} else {
Calendar.displayMonth += 1;
}
}
}
}
}
-77
View File
@@ -1,77 +0,0 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import qs.Components
import qs.Config
import qs.Helpers
Item {
id: root
required property Item wrapper
implicitHeight: layout.childrenRect.height + layout.anchors.margins * 2
implicitWidth: layout.childrenRect.width + layout.anchors.margins * 2
ColumnLayout {
id: layout
anchors.centerIn: parent
anchors.margins: 16
spacing: 16
// Header with month/year and navigation
CalendarHeader {
Layout.fillWidth: true
Layout.preferredHeight: childrenRect.height
}
// Calendar grid
RowLayout {
Layout.fillWidth: true
Layout.preferredHeight: childrenRect.height
spacing: 12
ColumnLayout {
Layout.alignment: Qt.AlignTop
Layout.preferredHeight: childrenRect.height
Layout.preferredWidth: weekNumberColumn.width
spacing: 8
Item {
Layout.preferredHeight: dayOfWeekRow.height
}
WeekNumberColumn {
id: weekNumberColumn
Layout.alignment: Qt.AlignTop
Layout.preferredHeight: weekNumbers.values.length * 44
}
}
ColumnLayout {
Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
Layout.preferredHeight: childrenRect.height
spacing: 8
DayOfWeekRow {
id: dayOfWeekRow
Layout.fillWidth: true
Layout.preferredHeight: 30
locale: Qt.locale()
}
MonthGrid {
Layout.preferredHeight: childrenRect.height
Layout.preferredWidth: childrenRect.width
locale: Qt.locale()
wrapper: root.wrapper
}
}
}
}
}
-42
View File
@@ -1,42 +0,0 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import qs.Components
import qs.Config
import qs.Helpers
RowLayout {
id: root
required property var locale
spacing: 4
Repeater {
model: 7
Item {
readonly property string dayName: {
// Get the day name for this column
const dayIndex = (index + Calendar.weekStartDay) % 7;
return root.locale.dayName(dayIndex, Locale.ShortFormat);
}
required property int index
Layout.fillWidth: true
Layout.preferredHeight: 30
CustomText {
anchors.centerIn: parent
color: DynamicColors.palette.m3onSurfaceVariant
font.pointSize: 11
font.weight: 500
horizontalAlignment: Text.AlignHCenter
opacity: 0.8
text: parent.dayName
verticalAlignment: Text.AlignVCenter
}
}
}
}
-118
View File
@@ -1,118 +0,0 @@
pragma ComponentBehavior: Bound
import Quickshell
import QtQuick
import QtQuick.Layouts
import qs.Components
import qs.Config
import qs.Helpers
GridLayout {
id: root
required property var locale
required property Item wrapper
columnSpacing: 4
columns: 7
rowSpacing: 4
uniformCellHeights: true
uniformCellWidths: true
Repeater {
id: repeater
model: ScriptModel {
values: Calendar.getWeeksForMonth(Calendar.displayMonth, Calendar.displayYear)
Behavior on values {
SequentialAnimation {
id: switchAnim
ParallelAnimation {
Anim {
from: 1.0
property: "opacity"
to: 0.0
}
Anim {
from: 1.0
property: "scale"
to: 0.8
}
}
PropertyAction {
}
ParallelAnimation {
Anim {
from: 0.0
property: "opacity"
to: 1.0
}
Anim {
from: 0.8
property: "scale"
to: 1.0
}
}
}
}
}
Rectangle {
required property int index
required property var modelData
Layout.preferredHeight: width
Layout.preferredWidth: 40
color: {
if (modelData.isToday) {
return DynamicColors.palette.m3primaryContainer;
}
return "transparent";
}
radius: 1000
Behavior on color {
ColorAnimation {
duration: 200
}
}
CustomText {
anchors.centerIn: parent
color: {
if (parent.modelData.isToday) {
return DynamicColors.palette.m3onPrimaryContainer;
}
return DynamicColors.palette.m3onSurface;
}
horizontalAlignment: Text.AlignHCenter
opacity: parent.modelData.isCurrentMonth ? 1.0 : 0.4
text: parent.modelData.day.toString()
verticalAlignment: Text.AlignVCenter
Behavior on color {
ColorAnimation {
duration: 200
}
}
Behavior on opacity {
NumberAnimation {
duration: 200
}
}
}
}
}
component Anim: NumberAnimation {
duration: MaterialEasing.expressiveEffectsTime
easing.bezierCurve: MaterialEasing.expressiveEffects
target: root
}
}
-45
View File
@@ -1,45 +0,0 @@
pragma ComponentBehavior: Bound
import Quickshell
import QtQuick
import QtQuick.Layouts
import qs.Components
import qs.Config
import qs.Helpers
ColumnLayout {
id: root
readonly property var weekNumbers: Calendar.getWeekNumbers(Calendar.displayMonth, Calendar.displayYear)
spacing: 4
Repeater {
model: ScriptModel {
values: root.weekNumbers
}
Item {
id: weekItem
required property int index
required property var modelData
Layout.alignment: Qt.AlignHCenter
Layout.preferredHeight: 40
Layout.preferredWidth: 20
CustomText {
id: weekText
anchors.centerIn: parent
color: DynamicColors.palette.m3onSurfaceVariant
font.pointSize: 10
horizontalAlignment: Text.AlignHCenter
opacity: 0.5
text: weekItem.modelData
verticalAlignment: Text.AlignVCenter
}
}
}
}
+20 -27
View File
@@ -6,43 +6,36 @@ import qs.Modules
import qs.Helpers as Helpers import qs.Helpers as Helpers
import qs.Components import qs.Components
Item { CustomRect {
id: root id: root
required property RowLayout loader required property RowLayout loader
required property Wrapper popouts required property Wrapper popouts
required property PersistentProperties visibilities required property PersistentProperties visibilities
anchors.bottom: parent.bottom color: DynamicColors.tPalette.m3surfaceContainer
anchors.top: parent.top implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2
implicitWidth: timeText.contentWidth + 5 * 2 implicitWidth: timeText.contentWidth + Appearance.padding.normal * 2
radius: Appearance.rounding.full
CustomRect { CustomText {
anchors.bottomMargin: 3 id: timeText
anchors.fill: parent
anchors.topMargin: 3
color: "transparent"
radius: 4
CustomText { anchors.centerIn: parent
id: timeText color: DynamicColors.palette.m3onSurface
text: Time.dateStr
anchors.centerIn: parent Behavior on color {
color: DynamicColors.palette.m3onSurface CAnim {
text: Time.dateStr
Behavior on color {
CAnim {
}
}
}
StateLayer {
acceptedButtons: Qt.LeftButton
onClicked: {
root.visibilities.dashboard = !root.visibilities.dashboard;
} }
} }
} }
StateLayer {
acceptedButtons: Qt.LeftButton
onClicked: {
root.visibilities.dashboard = !root.visibilities.dashboard;
}
}
} }
-9
View File
@@ -5,7 +5,6 @@ import Quickshell.Services.SystemTray
import QtQuick import QtQuick
import qs.Config import qs.Config
import qs.Components import qs.Components
import qs.Modules.Calendar
import qs.Modules.WSOverview import qs.Modules.WSOverview
import qs.Modules.Network import qs.Modules.Network
import qs.Modules.UPower import qs.Modules.UPower
@@ -69,14 +68,6 @@ Item {
} }
} }
Popout {
name: "calendar"
sourceComponent: CalendarPopup {
wrapper: root.wrapper
}
}
Popout { Popout {
name: "overview" name: "overview"
+1 -1
View File
@@ -112,7 +112,7 @@ Item {
opacity: 1 opacity: 1
sourceComponent: MaterialIcon { sourceComponent: MaterialIcon {
font.pointSize: 14 font.pointSize: Appearance.font.size.larger
text: "arrow_forward_ios" text: "arrow_forward_ios"
} }
} }
+6 -18
View File
@@ -5,30 +5,22 @@ import qs.Daemons
import qs.Config import qs.Config
import qs.Helpers import qs.Helpers
Item { CustomRect {
id: root id: root
readonly property string currentMedia: (Players.active?.trackTitle ?? qsTr("No media")) || qsTr("Unknown title") readonly property string currentMedia: (Players.active?.trackTitle ?? qsTr("No media")) || qsTr("Unknown title")
readonly property int textWidth: Math.min(metrics.width, 200) readonly property int textWidth: Math.min(metrics.width, 200)
anchors.bottom: parent.bottom color: DynamicColors.tPalette.m3surfaceContainer
anchors.top: parent.top implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2
implicitWidth: layout.implicitWidth + Appearance.padding.normal * 2 implicitWidth: layout.implicitWidth + Appearance.padding.normal * 2
radius: Appearance.rounding.full
Behavior on implicitWidth { Behavior on implicitWidth {
Anim { Anim {
} }
} }
CustomRect {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
color: DynamicColors.tPalette.m3surfaceContainer
implicitHeight: root.parent.height - ((Appearance.padding.small - 1) * 2)
radius: Appearance.rounding.full
}
TextMetrics { TextMetrics {
id: metrics id: metrics
@@ -39,11 +31,7 @@ Item {
RowLayout { RowLayout {
id: layout id: layout
anchors.bottom: parent.bottom anchors.centerIn: parent
anchors.horizontalCenter: parent.horizontalCenter
anchors.left: parent.left
anchors.leftMargin: Appearance.padding.normal
anchors.top: parent.top
Behavior on implicitWidth { Behavior on implicitWidth {
Anim { Anim {
@@ -53,7 +41,7 @@ Item {
MaterialIcon { MaterialIcon {
animate: true animate: true
color: Players.active?.isPlaying ? DynamicColors.palette.m3primary : DynamicColors.palette.m3onSurface color: Players.active?.isPlaying ? DynamicColors.palette.m3primary : DynamicColors.palette.m3onSurface
font.pointSize: 14 font.pointSize: Appearance.font.size.normal
text: Players.active?.isPlaying ? "music_note" : "music_off" text: Players.active?.isPlaying ? "music_note" : "music_off"
} }
+23 -30
View File
@@ -5,46 +5,39 @@ import qs.Config
import qs.Helpers import qs.Helpers
import qs.Components import qs.Components
Item { CustomRect {
id: root id: root
required property Wrapper popouts required property Wrapper popouts
required property PersistentProperties visibilities required property PersistentProperties visibilities
anchors.bottom: parent.bottom color: DynamicColors.tPalette.m3surfaceContainer
anchors.top: parent.top implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2
implicitWidth: 30 implicitWidth: implicitHeight
radius: Appearance.rounding.full
CustomRect { MaterialIcon {
anchors.bottomMargin: 3 id: notificationCenterIcon
anchors.fill: parent
anchors.topMargin: 3
color: "transparent"
radius: 4
MaterialIcon { property color iconColor: DynamicColors.palette.m3onSurface
id: notificationCenterIcon
property color iconColor: DynamicColors.palette.m3onSurface anchors.centerIn: parent
color: iconColor
font.family: "Material Symbols Rounded"
font.pointSize: Appearance.font.size.larger
text: HasNotifications.hasNotifications ? "\uf4fe" : "\ue7f4"
anchors.centerIn: parent Behavior on color {
color: iconColor CAnim {
font.family: "Material Symbols Rounded"
font.pointSize: 16
text: HasNotifications.hasNotifications ? "\uf4fe" : "\ue7f4"
Behavior on color {
CAnim {
}
}
}
StateLayer {
cursorShape: Qt.PointingHandCursor
onClicked: {
root.visibilities.sidebar = !root.visibilities.sidebar;
} }
} }
} }
StateLayer {
cursorShape: Qt.PointingHandCursor
onClicked: {
root.visibilities.sidebar = !root.visibilities.sidebar;
}
}
} }
+1 -1
View File
@@ -15,7 +15,7 @@ ShapePath {
readonly property real utilsWidthDiff: panels.utilities.width - wrapper.width readonly property real utilsWidthDiff: panels.utilities.width - wrapper.width
required property Wrapper wrapper required property Wrapper wrapper
fillColor: flatten ? "transparent" : DynamicColors.palette.m3surface fillColor: DynamicColors.palette.m3surface
strokeWidth: -1 strokeWidth: -1
Behavior on fillColor { Behavior on fillColor {
-116
View File
@@ -1,116 +0,0 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Shapes
import qs.Components
import qs.Config
Item {
id: root
property color borderColor: warning ? DynamicColors.palette.m3onError : mainColor
required property color mainColor
required property double percentage
property bool shown: true
property color usageColor: warning ? DynamicColors.palette.m3error : mainColor
property bool warning: percentage * 100 >= warningThreshold
property int warningThreshold: 100
clip: true
implicitHeight: 22
implicitWidth: resourceRowLayout.x < 0 ? 0 : resourceRowLayout.implicitWidth
visible: width > 0 && height > 0
Behavior on percentage {
NumberAnimation {
duration: 300
easing.type: Easing.InOutQuad
}
}
RowLayout {
id: resourceRowLayout
spacing: 2
x: shown ? 0 : -resourceRowLayout.width
anchors {
verticalCenter: parent.verticalCenter
}
Item {
Layout.alignment: Qt.AlignVCenter
implicitHeight: root.implicitHeight
implicitWidth: 14
Rectangle {
id: backgroundCircle
anchors.centerIn: parent
border.color: "#404040"
border.width: 1
color: "#40000000"
height: 14
radius: height / 2
width: 14
}
Shape {
anchors.fill: backgroundCircle
preferredRendererType: Shape.CurveRenderer
smooth: true
ShapePath {
fillColor: root.usageColor
startX: backgroundCircle.width / 2
startY: backgroundCircle.height / 2
strokeWidth: 0
Behavior on fillColor {
CAnim {
}
}
PathLine {
x: backgroundCircle.width / 2
y: 0 + (1 / 2)
}
PathAngleArc {
centerX: backgroundCircle.width / 2
centerY: backgroundCircle.height / 2
radiusX: backgroundCircle.width / 2 - (1 / 2)
radiusY: backgroundCircle.height / 2 - (1 / 2)
startAngle: -90
sweepAngle: 360 * root.percentage
}
PathLine {
x: backgroundCircle.width / 2
y: backgroundCircle.height / 2
}
}
ShapePath {
capStyle: ShapePath.FlatCap
fillColor: "transparent"
strokeColor: root.borderColor
strokeWidth: 1
Behavior on strokeColor {
CAnim {
}
}
PathAngleArc {
centerX: backgroundCircle.width / 2
centerY: backgroundCircle.height / 2
radiusX: backgroundCircle.width / 2 - (1 / 2)
radiusY: backgroundCircle.height / 2 - (1 / 2)
startAngle: -90
sweepAngle: 360 * root.percentage
}
}
}
}
}
}
-77
View File
@@ -1,77 +0,0 @@
import Quickshell
import QtQuick
import QtQuick.Layouts
import qs.Config
import qs.Components
Item {
id: root
property color barColor: DynamicColors.palette.m3primary
required property string details
required property string iconString
required property double percentage
required property string resourceName
property color textColor: DynamicColors.palette.m3onSurface
property color warningBarColor: DynamicColors.palette.m3error
required property int warningThreshold
Layout.preferredHeight: columnLayout.implicitHeight
Layout.preferredWidth: 158
ColumnLayout {
id: columnLayout
anchors.fill: parent
spacing: 4
Row {
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
spacing: 6
MaterialIcon {
color: root.textColor
font.family: "Material Symbols Rounded"
font.pointSize: 28
text: root.iconString
}
CustomText {
anchors.verticalCenter: parent.verticalCenter
color: root.textColor
font.pointSize: 12
text: root.resourceName
}
}
Rectangle {
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
Layout.preferredHeight: 6
color: "#40000000"
radius: height / 2
Rectangle {
color: root.percentage * 100 >= root.warningThreshold ? root.warningBarColor : root.barColor
height: parent.height
radius: height / 2
width: parent.width * Math.min(root.percentage, 1)
Behavior on width {
Anim {
duration: MaterialEasing.expressiveEffectsTime
easing.bezierCurve: MaterialEasing.expressiveEffects
}
}
}
}
CustomText {
Layout.alignment: Qt.AlignLeft
color: root.textColor
font.pointSize: 10
text: root.details
}
}
}
-59
View File
@@ -1,59 +0,0 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import qs.Config
Item {
id: popoutWindow
required property var wrapper
implicitHeight: contentColumn.implicitHeight + 10
implicitWidth: contentColumn.implicitWidth + 10 * 2
// ShadowRect {
// anchors.fill: contentRect
// radius: 8
// }
ColumnLayout {
id: contentColumn
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
spacing: 10
ResourceDetail {
details: qsTr("%1 of %2 MB used").arg(Math.round(ResourceUsage.memoryUsed * 0.001)).arg(Math.round(ResourceUsage.memoryTotal * 0.001))
iconString: "\uf7a3"
percentage: ResourceUsage.memoryUsedPercentage
resourceName: qsTr("Memory Usage")
warningThreshold: 95
}
ResourceDetail {
details: qsTr("%1% used").arg(Math.round(ResourceUsage.cpuUsage * 100))
iconString: "\ue322"
percentage: ResourceUsage.cpuUsage
resourceName: qsTr("CPU Usage")
warningThreshold: 95
}
ResourceDetail {
details: qsTr("%1% used").arg(Math.round(ResourceUsage.gpuUsage * 100))
iconString: "\ue30f"
percentage: ResourceUsage.gpuUsage
resourceName: qsTr("GPU Usage")
warningThreshold: 95
}
ResourceDetail {
details: qsTr("%1% used").arg(Math.round(ResourceUsage.gpuMemUsage * 100))
iconString: "\ue30d"
percentage: ResourceUsage.gpuMemUsage
resourceName: qsTr("VRAM Usage")
warningThreshold: 95
}
}
}
+6 -19
View File
@@ -8,32 +8,19 @@ import qs.Modules
import qs.Config import qs.Config
import qs.Components import qs.Components
Item { CustomRect {
id: root id: root
required property PersistentProperties visibilities required property PersistentProperties visibilities
anchors.bottom: parent.bottom
anchors.top: parent.top
clip: true clip: true
color: DynamicColors.tPalette.m3surfaceContainer
implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2
implicitWidth: rowLayout.implicitWidth + Appearance.padding.small * 2 implicitWidth: rowLayout.implicitWidth + Appearance.padding.small * 2
radius: height / 2
CustomRect { StateLayer {
id: backgroundRect onClicked: root.visibilities.resources = !root.visibilities.resources
color: DynamicColors.tPalette.m3surfaceContainer
implicitHeight: root.parent.height - ((Appearance.padding.small - 1) * 2)
radius: height / 2
anchors {
left: parent.left
right: parent.right
verticalCenter: parent.verticalCenter
}
StateLayer {
onClicked: root.visibilities.resources = !root.visibilities.resources
}
} }
RowLayout { RowLayout {
+2
View File
@@ -194,6 +194,8 @@ StackView {
} }
Loader { Loader {
id: loader
active: menu.isSubMenu active: menu.isSubMenu
asynchronous: true asynchronous: true
+21 -30
View File
@@ -7,50 +7,41 @@ import Quickshell.Services.SystemTray
import qs.Components import qs.Components
import qs.Config import qs.Config
Item { CustomClippingRect {
id: root id: root
readonly property alias items: repeater readonly property alias items: repeater
required property RowLayout loader required property RowLayout loader
required property Wrapper popouts required property Wrapper popouts
anchors.bottom: parent.bottom color: DynamicColors.tPalette.m3surfaceContainer
anchors.top: parent.top implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2
implicitHeight: 34
implicitWidth: row.width + Appearance.padding.small * 2 implicitWidth: row.width + Appearance.padding.small * 2
radius: height / 2
CustomClippingRect { Row {
anchors.left: parent.left id: row
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
color: DynamicColors.tPalette.m3surfaceContainer
implicitHeight: root.parent.height - ((Appearance.padding.small - 1) * 2)
radius: height / 2
Row { anchors.centerIn: parent
id: row spacing: 0
anchors.centerIn: parent Repeater {
spacing: 0 id: repeater
Repeater { model: SystemTray.items
id: repeater
model: SystemTray.items TrayItem {
id: trayItem
TrayItem { required property int index
id: trayItem required property SystemTrayItem modelData
required property int index implicitHeight: 34
required property SystemTrayItem modelData implicitWidth: 34
ind: index
implicitHeight: 34 item: modelData
implicitWidth: 34 loader: root.loader
ind: index popouts: root.popouts
item: modelData
loader: root.loader
popouts: root.popouts
}
} }
} }
} }
+1 -1
View File
@@ -167,7 +167,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
color: profiles.current === text ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface color: profiles.current === text ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
fill: profiles.current === text ? 1 : 0 fill: profiles.current === text ? 1 : 0
font.pointSize: 36 font.pointSize: Appearance.font.size.large * 2
text: parent.icon text: parent.icon
Behavior on fill { Behavior on fill {
+5 -12
View File
@@ -5,20 +5,13 @@ import qs.Components
import qs.Config import qs.Config
import qs.Helpers as Helpers import qs.Helpers as Helpers
Item { CustomRect {
id: root id: root
anchors.bottom: parent.bottom color: DynamicColors.tPalette.m3surfaceContainer
anchors.top: parent.top implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2
implicitWidth: layout.childrenRect.width + 10 * 2 implicitWidth: layout.implicitWidth + Appearance.padding.normal * 2
radius: Appearance.rounding.full
CustomRect {
anchors.bottomMargin: 4
anchors.fill: parent
anchors.topMargin: 4
color: DynamicColors.tPalette.m3surfaceContainer
radius: 1000
}
RowLayout { RowLayout {
id: layout id: layout
+7 -15
View File
@@ -4,24 +4,16 @@ import qs.Components
import qs.Modules import qs.Modules
import qs.Config import qs.Config
Item { CustomRect {
id: root id: root
property int countUpdates: Updates.availableUpdates property int countUpdates: Updates.availableUpdates
property color textColor: DynamicColors.palette.m3onSurface property color textColor: DynamicColors.palette.m3onSurface
anchors.bottom: parent.bottom color: DynamicColors.tPalette.m3surfaceContainer
anchors.top: parent.top implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2
implicitWidth: contentRow.childrenRect.width + Appearance.spacing.smaller implicitWidth: contentRow.implicitWidth + Appearance.spacing.smaller
radius: height / 2
CustomRect {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
color: DynamicColors.tPalette.m3surfaceContainer
implicitHeight: root.parent.height - ((Appearance.padding.small - 1) * 2)
radius: height / 2
}
RowLayout { RowLayout {
id: contentRow id: contentRow
@@ -30,13 +22,13 @@ Item {
spacing: Appearance.spacing.small spacing: Appearance.spacing.small
MaterialIcon { MaterialIcon {
font.pointSize: 14 font.pointSize: Appearance.font.size.normal
text: "package_2" text: "package_2"
} }
CustomText { CustomText {
color: root.textColor color: root.textColor
font.pointSize: 12 font.pointSize: Appearance.font.size.normal
text: root.countUpdates text: root.countUpdates
} }
} }
+1 -1
View File
@@ -47,7 +47,7 @@ Item {
elide: Qt.ElideRight elide: Qt.ElideRight
elideWidth: root.maxWidth elideWidth: root.maxWidth
font.family: "Rubik" font.family: "Rubik"
font.pointSize: 12 font.pointSize: Appearance.font.size.normal
text: Hypr.activeToplevel?.title ?? qsTr("Desktop") text: Hypr.activeToplevel?.title ?? qsTr("Desktop")
onElideWidthChanged: root.current.text = elidedText onElideWidthChanged: root.current.text = elidedText
+3 -3
View File
@@ -20,8 +20,8 @@ Item {
readonly property list<var> workspaces: Hyprland.workspaces.values.filter(w => w.monitor === root.monitor) readonly property list<var> workspaces: Hyprland.workspaces.values.filter(w => w.monitor === root.monitor)
readonly property int workspacesShown: workspaces.length readonly property int workspacesShown: workspaces.length
anchors.bottom: parent.bottom height: implicitHeight
anchors.top: parent.top implicitHeight: Config.barConfig.height + Math.max(Appearance.padding.smaller, Config.barConfig.border) * 2
implicitWidth: (root.workspaceButtonWidth * root.workspacesShown) + root.activeWorkspaceMargin * 2 implicitWidth: (root.workspaceButtonWidth * root.workspacesShown) + root.activeWorkspaceMargin * 2
Behavior on implicitWidth { Behavior on implicitWidth {
@@ -36,7 +36,7 @@ Item {
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: DynamicColors.tPalette.m3surfaceContainer color: DynamicColors.tPalette.m3surfaceContainer
implicitHeight: root.parent.height - ((Appearance.padding.small - 1) * 2) implicitHeight: root.implicitHeight - ((Appearance.padding.small - 1) * 2)
radius: height / 2 radius: height / 2
CustomRect { CustomRect {
+1 -1
View File
@@ -11,7 +11,7 @@ import qs.Helpers
import qs.Modules.Polkit import qs.Modules.Polkit
ShellRoot { ShellRoot {
Bar { Windows {
} }
Wallpaper { Wallpaper {