dashboard on right, change trigger to clock
This commit is contained in:
@@ -30,7 +30,7 @@ RowLayout {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( visibilities.sidebar )
|
||||
if ( visibilities.sidebar || visibilities.dashboard )
|
||||
return;
|
||||
|
||||
const id = ch.id;
|
||||
@@ -145,6 +145,7 @@ RowLayout {
|
||||
delegate: WrappedLoader {
|
||||
sourceComponent: NotifBell {
|
||||
visibilities: root.visibilities
|
||||
popouts: root.popouts
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -153,6 +154,7 @@ RowLayout {
|
||||
delegate: WrappedLoader {
|
||||
sourceComponent: Clock {
|
||||
popouts: root.popouts
|
||||
visibilities: root.visibilities
|
||||
loader: root
|
||||
}
|
||||
}
|
||||
@@ -178,14 +180,14 @@ RowLayout {
|
||||
sourceComponent: NetworkWidget {}
|
||||
}
|
||||
}
|
||||
DelegateChoice {
|
||||
roleValue: "dash"
|
||||
delegate: WrappedLoader {
|
||||
sourceComponent: DashWidget {
|
||||
visibilities: root.visibilities
|
||||
}
|
||||
}
|
||||
}
|
||||
// DelegateChoice {
|
||||
// roleValue: "dash"
|
||||
// delegate: WrappedLoader {
|
||||
// sourceComponent: DashWidget {
|
||||
// visibilities: root.visibilities
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-6
@@ -1,3 +1,4 @@
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Config
|
||||
@@ -6,6 +7,7 @@ import qs.Helpers as Helpers
|
||||
import qs.Components
|
||||
|
||||
Item {
|
||||
required property PersistentProperties visibilities
|
||||
required property Wrapper popouts
|
||||
required property RowLayout loader
|
||||
|
||||
@@ -35,12 +37,15 @@ Item {
|
||||
StateLayer {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onClicked: {
|
||||
if ( mouse.button === Qt.LeftButton && !visibilities.sidebar ) {
|
||||
Helpers.Calendar.displayYear = new Date().getFullYear();
|
||||
Helpers.Calendar.displayMonth = new Date().getMonth();
|
||||
root.popouts.currentName = "calendar";
|
||||
root.popouts.currentCenter = Qt.binding( () => item.mapToItem( root.loader, root.implicitWidth / 2, 0 ).x );
|
||||
root.popouts.hasCurrent = true;
|
||||
root.visibilities.dashboard = !root.visibilities.dashboard;
|
||||
if ( root.visibilities.sidebar || root.popouts.hasCurrent ) {
|
||||
// Helpers.Calendar.displayYear = new Date().getFullYear();
|
||||
// Helpers.Calendar.displayMonth = new Date().getMonth();
|
||||
// root.popouts.currentName = "calendar";
|
||||
// root.popouts.currentCenter = Qt.binding( () => item.mapToItem( root.loader, root.implicitWidth / 2, 0 ).x );
|
||||
// root.popouts.hasCurrent = true;
|
||||
root.popouts.hasCurrent = false;
|
||||
root.visibilities.sidebar = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,12 +25,12 @@ Item {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.margins: Appearance.padding.large
|
||||
anchors.margins: Appearance.padding.smaller
|
||||
|
||||
radius: 8
|
||||
radius: 6
|
||||
color: "transparent"
|
||||
|
||||
Flickable {
|
||||
Item {
|
||||
id: view
|
||||
|
||||
readonly property int currentIndex: root.state.currentTab
|
||||
@@ -38,36 +38,9 @@ Item {
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
flickableDirection: Flickable.HorizontalFlick
|
||||
|
||||
implicitWidth: currentItem.implicitWidth
|
||||
implicitHeight: currentItem.implicitHeight
|
||||
|
||||
contentX: currentItem.x
|
||||
contentWidth: row.implicitWidth
|
||||
contentHeight: row.implicitHeight
|
||||
|
||||
onContentXChanged: {
|
||||
if (!moving)
|
||||
return;
|
||||
|
||||
const x = contentX - currentItem.x;
|
||||
if (x > currentItem.implicitWidth / 2)
|
||||
root.state.currentTab = Math.min(root.state.currentTab + 1, tabs.count - 1);
|
||||
else if (x < -currentItem.implicitWidth / 2)
|
||||
root.state.currentTab = Math.max(root.state.currentTab - 1, 0);
|
||||
}
|
||||
|
||||
onDragEnded: {
|
||||
const x = contentX - currentItem.x;
|
||||
if (x > currentItem.implicitWidth / 10)
|
||||
root.state.currentTab = Math.min(root.state.currentTab + 1, tabs.count - 1);
|
||||
else if (x < -currentItem.implicitWidth / 10)
|
||||
root.state.currentTab = Math.max(root.state.currentTab - 1, 0);
|
||||
else
|
||||
contentX = Qt.binding(() => currentItem.x);
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: row
|
||||
|
||||
@@ -79,10 +52,6 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on contentX {
|
||||
Anim {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+23
-20
@@ -15,8 +15,10 @@ GridLayout {
|
||||
required property PersistentProperties state
|
||||
readonly property bool dashboardVisible: visibilities.dashboard
|
||||
|
||||
rowSpacing: Appearance.spacing.normal
|
||||
columnSpacing: Appearance.spacing.normal
|
||||
property int radius: 6
|
||||
|
||||
rowSpacing: Appearance.spacing.smaller
|
||||
columnSpacing: Appearance.spacing.smaller
|
||||
|
||||
opacity: 0
|
||||
scale: 0.9
|
||||
@@ -63,7 +65,7 @@ GridLayout {
|
||||
Layout.preferredWidth: user.implicitWidth
|
||||
Layout.preferredHeight: user.implicitHeight
|
||||
|
||||
radius: 6
|
||||
radius: root.radius
|
||||
|
||||
User {
|
||||
id: user
|
||||
@@ -78,31 +80,31 @@ GridLayout {
|
||||
Layout.preferredWidth: Config.dashboard.sizes.weatherWidth
|
||||
Layout.fillHeight: true
|
||||
|
||||
radius: 6
|
||||
radius: root.radius
|
||||
|
||||
Weather {}
|
||||
}
|
||||
|
||||
Rect {
|
||||
Layout.row: 1
|
||||
Layout.preferredWidth: dateTime.implicitWidth
|
||||
Layout.fillHeight: true
|
||||
|
||||
radius: 6
|
||||
|
||||
DateTime {
|
||||
id: dateTime
|
||||
}
|
||||
}
|
||||
// Rect {
|
||||
// Layout.row: 1
|
||||
// Layout.preferredWidth: dateTime.implicitWidth
|
||||
// Layout.fillHeight: true
|
||||
//
|
||||
// radius: root.radius
|
||||
//
|
||||
// DateTime {
|
||||
// id: dateTime
|
||||
// }
|
||||
// }
|
||||
|
||||
Rect {
|
||||
Layout.row: 1
|
||||
Layout.column: 1
|
||||
Layout.column: 0
|
||||
Layout.columnSpan: 3
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: calendar.implicitHeight
|
||||
|
||||
radius: 6
|
||||
radius: root.radius
|
||||
|
||||
Calendar {
|
||||
id: calendar
|
||||
@@ -113,11 +115,12 @@ GridLayout {
|
||||
|
||||
Rect {
|
||||
Layout.row: 1
|
||||
Layout.column: 4
|
||||
Layout.column: 3
|
||||
Layout.columnSpan: 2
|
||||
Layout.preferredWidth: resources.implicitWidth
|
||||
Layout.fillHeight: true
|
||||
|
||||
radius: 6
|
||||
radius: root.radius
|
||||
|
||||
Resources {
|
||||
id: resources
|
||||
@@ -131,7 +134,7 @@ GridLayout {
|
||||
Layout.preferredWidth: media.implicitWidth
|
||||
Layout.fillHeight: true
|
||||
|
||||
radius: 6
|
||||
radius: root.radius
|
||||
|
||||
Media {
|
||||
id: media
|
||||
|
||||
@@ -11,7 +11,7 @@ Row {
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
padding: Appearance.padding.large
|
||||
spacing: Appearance.spacing.normal
|
||||
spacing: Appearance.spacing.large
|
||||
|
||||
Ref {
|
||||
service: SystemUsage
|
||||
@@ -29,6 +29,18 @@ Row {
|
||||
color: DynamicColors.palette.m3secondary
|
||||
}
|
||||
|
||||
Resource {
|
||||
icon: "gamepad"
|
||||
value: SystemUsage.gpuPerc
|
||||
color: DynamicColors.palette.m3primaryFixed
|
||||
}
|
||||
|
||||
Resource {
|
||||
icon: "host"
|
||||
value: SystemUsage.gpuMemUsed
|
||||
color: DynamicColors.palette.m3secondaryFixed
|
||||
}
|
||||
|
||||
Resource {
|
||||
icon: "hard_disk"
|
||||
value: SystemUsage.storagePerc
|
||||
|
||||
@@ -9,6 +9,7 @@ Item {
|
||||
id: root
|
||||
|
||||
required property PersistentProperties visibilities
|
||||
required property Wrapper popouts
|
||||
|
||||
implicitWidth: 25
|
||||
anchors.top: parent.top
|
||||
@@ -40,8 +41,11 @@ Item {
|
||||
StateLayer {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
// Hyprland.dispatch("global zshell-nc:toggle-nc");
|
||||
root.visibilities.sidebar = !root.visibilities.sidebar;
|
||||
if ( root.visibilities.dashboard || root.popouts.hasCurrent ) {
|
||||
root.popouts.hasCurrent = false;
|
||||
root.visibilities.dashboard = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ Singleton {
|
||||
processGpu.running = true
|
||||
}
|
||||
|
||||
interval = 1000
|
||||
interval = 3000
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,12 +28,12 @@ Item {
|
||||
if ( mouse.button === Qt.LeftButton ) {
|
||||
root.item.activate();
|
||||
} else if ( mouse.button === Qt.RightButton ) {
|
||||
if ( visibilities.sidebar ) {
|
||||
return;
|
||||
} else {
|
||||
root.popouts.currentName = `traymenu${ root.ind }`;
|
||||
root.popouts.currentCenter = Qt.binding( () => root.mapToItem( root.loader, root.implicitWidth / 2, 0 ).x );
|
||||
root.popouts.hasCurrent = true;
|
||||
root.popouts.currentName = `traymenu${ root.ind }`;
|
||||
root.popouts.currentCenter = Qt.binding( () => root.mapToItem( root.loader, root.implicitWidth / 2, 0 ).x );
|
||||
root.popouts.hasCurrent = true;
|
||||
if ( visibilities.sidebar || visibilities.dashboard ) {
|
||||
visibilities.sidebar = false;
|
||||
visibilities.dashboard = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user