Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 38 additions & 16 deletions modules/island/ControlCenter.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import QtQuick
import QtQuick.Effects
import QtQuick.Layouts
import Quickshell.Widgets
import qs.components
import qs.services
Expand Down Expand Up @@ -53,34 +54,55 @@ Item {
}
}
Item {
id:footer;z:11
id:footer;objectName:"controlFooter";z:11
opacity:!root.modal&&ControlLayout.footerShown&&root.apertureHeight>=root.overviewHeight+Preferences.innerPadding*2-2?1:0
visible:opacity>0;enabled:!root.modal&&opacity>.7
Behavior on opacity {NumberAnimation {duration:Tokens.animFast;easing.type:Easing.OutCubic}}
readonly property bool showTray:Preferences.footerVisible&&Preferences.footerTray&&Tray.items.length>0
readonly property real dividerWidth:showTray&&footerButtons.width>0?21:0
width:footerButtons.width+dividerWidth+(showTray?footerTray.width:0);height:38
anchors.horizontalCenter:parent.horizontalCenter;y:root.overviewHeight-height
Row {
id:footerButtons;spacing:10;anchors.verticalCenter:parent.verticalCenter
IconButton {visible:ControlLayout.notesEntryShown;icon:"edit_note";label:"Quick Notes";size:19;implicitWidth:38;implicitHeight:38;color:Theme.accent;onClicked:{Tray.close();IslandState.openMenu("notes");}}
readonly property bool showActions:Preferences.footerVisible&&(Preferences.footerSettings||Preferences.footerPerformance)
readonly property real dividerWidth:showTray&&showActions?13:0
width:parent.width;height:38
y:root.overviewHeight-height
Rectangle {width:parent.width;height:1;y:-5;color:Theme.withAlpha(Theme.text,.06)}
RowLayout {
id:footerButtons;spacing:6;anchors.verticalCenter:parent.verticalCenter
width:footer.width-footer.dividerWidth-(footer.showTray?footerTray.width:0)
visible:footer.showActions
Repeater {
model:[{key:"footerPerformance",icon:"monitoring",label:"Performance",panel:"performance"},{key:"footerThemes",icon:"palette",label:"Themes",panel:"themes"},{key:"footerWallpapers",icon:"wallpaper",label:"Wallpapers",panel:"wallpapers"},{key:"footerPower",icon:"power_settings_new",label:"Power",panel:"power"},{key:"footerSettings",icon:"settings",label:"Settings",panel:"settings"}]
IconButton {
model:[{key:"footerSettings",icon:"settings",label:"Settings",panel:"settings"},{key:"footerPerformance",icon:"monitoring",label:"Performance",panel:"performance"}]
ActionButton {
id:action
required property var modelData
visible:Preferences.footerVisible&&Preferences[modelData.key];icon:modelData.icon;label:modelData.label;size:19
implicitWidth:38;implicitHeight:38;color:Theme.subtext
background:"transparent"
objectName:modelData.key
visible:Preferences.footerVisible&&Preferences[modelData.key]
Layout.fillWidth:true;Layout.preferredWidth:1;Layout.minimumWidth:0
implicitHeight:38;text:modelData.label
focusPolicy:Qt.StrongFocus
Accessible.name:text
Keys.onReturnPressed:clicked()
Keys.onEnterPressed:clicked()
contentItem:Item {
Row {
anchors.centerIn:parent;spacing:6
Icon {icon:action.modelData.icon;size:17;color:Theme.subtext}
PanelText {objectName:action.modelData.key+"Label";text:action.text;width:Math.min(implicitWidth,Math.max(0,action.availableWidth-23));font.pixelSize:11;color:Theme.subtext;anchors.verticalCenter:parent.verticalCenter}
}
}
background:Rectangle {
radius:10
color:Theme.withAlpha(Theme.text,action.pressed?.1:action.hovered?.055:0)
border.width:action.activeFocus?1:0;border.color:Theme.accent
}
onClicked:{Tray.close();IslandState.openMenu(modelData.panel);}
}
}
}
Rectangle {x:footerButtons.width+10;anchors.verticalCenter:parent.verticalCenter;width:1;height:16;visible:footer.dividerWidth>0;color:Theme.withAlpha(Theme.text,.1)}
Rectangle {x:footerButtons.width+6;anchors.verticalCenter:parent.verticalCenter;width:1;height:16;visible:footer.dividerWidth>0;color:Theme.withAlpha(Theme.text,.1)}
TrayIcons {
id:footerTray;inFooter:true
maximumWidth:Math.max(0,root.width-footerButtons.width-footer.dividerWidth)
id:footerTray;objectName:"footerTray";inFooter:true
maximumWidth:footer.showActions?Math.max(0,footer.width*.28):footer.width
visible:footer.showTray
x:footerButtons.width+footer.dividerWidth;anchors.verticalCenter:parent.verticalCenter
anchors.right:parent.right;anchors.verticalCenter:parent.verticalCenter
}
}
MouseArea {anchors.fill:parent;z:9;visible:Tray.open&&Tray.inFooter;onClicked:Tray.close();hoverEnabled:true;onWheel:event=>event.accepted=true}
Expand Down
147 changes: 85 additions & 62 deletions modules/island/PerformanceMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ ColumnLayout {
history=next;
}
Process {
objectName:"performanceCollector"
running: IslandState.menu === "performance" && !Preferences.preview && !Session.locked
command: ["python3", Qt.resolvedUrl("../../scripts/performance.py").toString().replace("file://", "")]
stdout: SplitParser { onRead: line => {
Expand All @@ -41,101 +42,123 @@ ColumnLayout {
}
PanelHeader {
title:"Performance"
Rectangle {width:5;height:5;radius:2.5;color:Theme.accent;visible:!!root.sample.memoryTotal&&!root.error}
Rectangle {objectName:"performanceLive";width:5;height:5;radius:2.5;color:Theme.accent;visible:!!root.sample.memoryTotal&&!root.error}
}
Flickable {
id:scroll;objectName:"performanceScroll"
Layout.fillWidth:true;Layout.fillHeight:true;Layout.minimumHeight:0;implicitHeight:metrics.implicitHeight;clip:true
contentHeight:metrics.implicitHeight;boundsBehavior:Flickable.StopAtBounds
activeFocusOnTab:true
Keys.onPressed:event=>{
if(event.key===Qt.Key_Down||event.key===Qt.Key_PageDown) contentY=Math.min(Math.max(0,contentHeight-height),contentY+(event.key===Qt.Key_Down?40:height));
else if(event.key===Qt.Key_Up||event.key===Qt.Key_PageUp) contentY=Math.max(0,contentY-(event.key===Qt.Key_Up?40:height));
else if(event.key===Qt.Key_Home) contentY=0;
else if(event.key===Qt.Key_End) contentY=Math.max(0,contentHeight-height);
else return;
event.accepted=true;
}
ScrollBar.vertical:ScrollBar {}
ColumnLayout {
id:metrics;width:parent.width;spacing:12
id:metrics;width:scroll.width;spacing:10
RowLayout {
Layout.fillWidth:true;spacing:10
Layout.fillWidth:true;spacing:18
Repeater {
model:["CPU","Memory"]
Rectangle {
ColumnLayout {
id:summary
required property string modelData
readonly property var value:modelData==="CPU"?root.sample.cpu:root.sample.memoryUsed/root.sample.memoryTotal
Layout.fillWidth:true;Layout.preferredWidth:1;implicitHeight:116
radius:18;color:Theme.withAlpha(Theme.text,.035)
border.width:1;border.color:Theme.withAlpha(Theme.text,.045)
Column {
anchors.left:parent.left;anchors.right:parent.right;anchors.top:parent.top;anchors.margins:14;spacing:5
PanelText {text:summary.modelData==="Memory"?"RAM used":summary.modelData;font.pixelSize:12;color:Theme.subtext}
Row {spacing:3
PanelText {text:Number.isFinite(summary.value)?Math.round(summary.value*100):"—";font.pixelSize:30;font.weight:Font.Medium;font.letterSpacing:-1;font.features:({tnum:1})}
PanelText {text:"%";font.pixelSize:13;color:Theme.subtext;anchors.baseline:parent.children[0].baseline}
}
PanelText {text:summary.modelData==="Memory"?root.bytes(root.sample.memoryUsed)+" / "+root.bytes(root.sample.memoryTotal):"All cores";font.pixelSize:10;color:Theme.subtext}
Layout.fillWidth:true;Layout.preferredWidth:1;spacing:3
PanelText {text:summary.modelData==="Memory"?"RAM used":summary.modelData;font.pixelSize:11;color:Theme.subtext}
Row {spacing:3
PanelText {objectName:summary.modelData+"Percent";text:Number.isFinite(summary.value)?Math.round(summary.value*100):"—";font.pixelSize:28;font.weight:Font.Medium;font.letterSpacing:-1;font.features:({tnum:1})}
PanelText {text:"%";font.pixelSize:13;color:Theme.subtext;anchors.baseline:parent.children[0].baseline}
}
MetricTrace {anchors.left:parent.left;anchors.right:parent.right;anchors.bottom:parent.bottom;anchors.margins:10;height:23;values:root.history[summary.modelData==="CPU"?"cpu":"memory"]||[]}
PanelText {objectName:summary.modelData+"Detail";Layout.fillWidth:true;text:summary.modelData==="Memory"?root.bytes(root.sample.memoryUsed)+" / "+root.bytes(root.sample.memoryTotal):"All cores";font.pixelSize:10;color:Theme.subtext}
MetricTrace {objectName:summary.modelData+"History";Layout.fillWidth:true;implicitHeight:18;values:root.history[summary.modelData==="CPU"?"cpu":"memory"]||[]}
}
}
}
Repeater {
model:root.deviceNames
Rectangle {
id:drive
required property string modelData
readonly property var reading:(root.sample.diskIo||[]).find(d=>d.name===modelData)||({})
Layout.fillWidth:true;implicitHeight:100;radius:18
color:Theme.withAlpha(Theme.text,.035);border.width:1;border.color:Theme.withAlpha(Theme.text,.045)
ColumnLayout {
Layout.fillWidth:true;spacing:6;visible:root.deviceNames.length>0
Rectangle {Layout.fillWidth:true;implicitHeight:1;color:Theme.withAlpha(Theme.text,.07)}
PanelText {text:"Disk activity";font.pixelSize:11;color:Theme.subtext}
Repeater {
model:root.deviceNames
ColumnLayout {
anchors.fill:parent;anchors.margins:12;spacing:6
RowLayout {Layout.fillWidth:true
PanelText {text:"Disk";font.pixelSize:13;font.weight:Font.Medium}
PanelText {Layout.fillWidth:true;text:drive.modelData;font.pixelSize:10;color:Theme.subtext}
PanelText {text:drive.reading.busy==null?"—":Math.round(drive.reading.busy*100)+"% active";font.pixelSize:11;color:Theme.subtext;font.features:({tnum:1})}
id:drive
required property string modelData
objectName:"drive-"+modelData
readonly property var reading:(root.sample.diskIo||[]).find(d=>d.name===modelData)||({})
Layout.fillWidth:true;spacing:3
RowLayout {Layout.fillWidth:true;spacing:8
PanelText {
objectName:"driveName-"+drive.modelData;Layout.fillWidth:true;text:drive.modelData;font.pixelSize:12;font.weight:Font.Medium
HoverHandler {id:driveHover}
ToolTip.visible:driveHover.hovered;ToolTip.text:text
}
PanelText {objectName:"driveBusy-"+drive.modelData;text:drive.reading.busy==null?"—":Math.round(drive.reading.busy*100)+"% active";font.pixelSize:11;color:Theme.subtext;font.features:({tnum:1})}
}
RowLayout {Layout.fillWidth:true;spacing:14
RowLayout {Layout.fillWidth:true;spacing:10
Repeater {model:["read","write"]
Column {required property string modelData;Layout.fillWidth:true;Layout.preferredWidth:1;spacing:4
RowLayout {
required property string modelData
Layout.fillWidth:true;Layout.preferredWidth:1;spacing:5
PanelText {text:modelData==="read"?"Read":"Write";font.pixelSize:10;color:Theme.subtext}
PanelText {width:parent.width;text:root.bytes(drive.reading[modelData])+"/s";font.pixelSize:14;font.weight:Font.Medium;font.features:({tnum:1})}
PanelText {objectName:drive.modelData+"-"+modelData;Layout.fillWidth:true;text:root.bytes(drive.reading[modelData])+"/s";font.pixelSize:11;font.features:({tnum:1})}
}
}
}
MetricTrace {Layout.fillWidth:true;Layout.fillHeight:true;Layout.minimumHeight:12;values:root.history[drive.modelData]||[]}
MetricTrace {objectName:"driveHistory-"+drive.modelData;Layout.fillWidth:true;implicitHeight:12;values:root.history[drive.modelData]||[]}
}
}
}
Rectangle {
Layout.fillWidth:true;implicitHeight:116;radius:18
color:Theme.withAlpha(Theme.text,.035);border.width:1;border.color:Theme.withAlpha(Theme.text,.045)
ColumnLayout {anchors.fill:parent;anchors.margins:14;spacing:10
PanelText {text:"Network";font.pixelSize:13;font.weight:Font.Medium}
RowLayout {Layout.fillWidth:true;spacing:14
Repeater {model:["download","upload"]
Column {required property string modelData;Layout.fillWidth:true;Layout.preferredWidth:1;spacing:4
PanelText {text:modelData==="download"?"↓ Download":"↑ Upload";font.pixelSize:10;color:Theme.subtext}
PanelText {width:parent.width;text:root.bytes(root.sample[modelData])+"/s";font.pixelSize:14;font.weight:Font.Medium;font.features:({tnum:1})}
}
ColumnLayout {
id:network
readonly property real peak:Math.max(1024,...root.history.download,...root.history.upload)
Layout.fillWidth:true;spacing:6
Rectangle {Layout.fillWidth:true;implicitHeight:1;color:Theme.withAlpha(Theme.text,.07)}
PanelText {text:"Network";font.pixelSize:11;color:Theme.subtext}
RowLayout {Layout.fillWidth:true;spacing:18
Repeater {model:["download","upload"]
ColumnLayout {
required property string modelData
Layout.fillWidth:true;Layout.preferredWidth:1;spacing:4
PanelText {text:modelData==="download"?"↓ Download":"↑ Upload";font.pixelSize:10;color:Theme.subtext}
PanelText {objectName:modelData+"Rate";Layout.fillWidth:true;text:root.bytes(root.sample[modelData])+"/s";font.pixelSize:14;font.weight:Font.Medium;font.features:({tnum:1})}
MetricTrace {objectName:modelData+"History";Layout.fillWidth:true;implicitHeight:18;values:root.history[modelData];ceiling:network.peak;stroke:modelData==="download"?Theme.accent:Theme.subtext}
}
}
Item {Layout.fillWidth:true;Layout.fillHeight:true;Layout.minimumHeight:20
readonly property real peak:Math.max(1024,...root.history.download,...root.history.upload)
MetricTrace {anchors.fill:parent;values:root.history.download;ceiling:parent.peak}
MetricTrace {anchors.fill:parent;values:root.history.upload;ceiling:parent.peak;stroke:Theme.subtext}
}
}
}
Repeater {
model:root.diskPaths
ColumnLayout {
required property string modelData
readonly property var disk:(root.sample.disks||[]).find(d=>d.path===modelData)||({used:0,total:1})
Layout.fillWidth:true;Layout.leftMargin:3;Layout.rightMargin:3;spacing:7
RowLayout {Layout.fillWidth:true
PanelText {Layout.fillWidth:true;text:modelData==="/"?"System storage":"Home storage";font.pixelSize:11;color:Theme.subtext}
PanelText {text:root.bytes(disk.used)+" / "+root.bytes(disk.total);font.pixelSize:10;color:Theme.subtext}
}
Rectangle {Layout.fillWidth:true;height:3;radius:1.5;color:Theme.withAlpha(Theme.text,.08)
Rectangle {height:3;radius:1.5;width:parent.width*Math.min(1,disk.used/disk.total);color:Theme.withAlpha(Theme.accent,.65)}
ColumnLayout {
Layout.fillWidth:true;spacing:6;visible:root.diskPaths.length>0
Rectangle {Layout.fillWidth:true;implicitHeight:1;color:Theme.withAlpha(Theme.text,.07)}
PanelText {text:"Storage";font.pixelSize:11;color:Theme.subtext}
Repeater {
model:root.diskPaths
ColumnLayout {
id:storage
required property string modelData
objectName:"storage-"+modelData
readonly property var disk:(root.sample.disks||[]).find(d=>d.path===modelData)||({})
Layout.fillWidth:true;spacing:3
RowLayout {Layout.fillWidth:true;spacing:8
PanelText {Layout.fillWidth:true;text:storage.modelData==="/"?"System storage":"Home storage";font.pixelSize:11}
PanelText {objectName:"storageUsage-"+storage.modelData;text:root.bytes(storage.disk.used)+" / "+root.bytes(storage.disk.total);font.pixelSize:10;color:Theme.subtext;font.features:({tnum:1})}
}
PanelText {
objectName:"storagePath-"+storage.modelData;Layout.fillWidth:true;text:storage.modelData;font.pixelSize:10;color:Theme.subtext
HoverHandler {id:pathHover}
ToolTip.visible:pathHover.hovered;ToolTip.text:text
}
Rectangle {Layout.fillWidth:true;implicitHeight:3;radius:1.5;color:Theme.withAlpha(Theme.text,.08)
Rectangle {objectName:"storageFill-"+storage.modelData;height:3;radius:1.5;width:parent.width*(storage.disk.total>0&&storage.disk.used!=null?Math.max(0,Math.min(1,storage.disk.used/storage.disk.total)):0);color:Theme.withAlpha(Theme.accent,.65)}
}
}
}
}
PanelText {Layout.fillWidth:true;visible:!!root.error;text:root.error;wrapMode:Text.Wrap;color:Theme.subtext;font.pixelSize:12}
PanelText {objectName:"performanceStatus";Layout.fillWidth:true;visible:!!root.error||!root.sample.memoryTotal;text:root.error||"Waiting for metrics…";wrapMode:Text.Wrap;color:Theme.subtext;font.pixelSize:12}
}
}
}
Loading