mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Add Recording indicator to bar
This commit is contained in:
@@ -2,6 +2,7 @@ import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Services.UPower
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
@@ -10,6 +11,10 @@ NBox {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
implicitHeight: powerRow.implicitHeight + Style.marginMedium * 2 * scaling
|
||||
|
||||
// PowerProfiles service
|
||||
property var powerProfiles: PowerProfiles
|
||||
|
||||
RowLayout {
|
||||
id: powerRow
|
||||
anchors.fill: parent
|
||||
@@ -21,23 +26,33 @@ NBox {
|
||||
// Performance
|
||||
NIconButton {
|
||||
icon: "speed"
|
||||
enabled: powerProfiles.hasPerformanceProfile
|
||||
opacity: enabled ? 1.0 : 0.3
|
||||
showFilled: powerProfiles.profile === PowerProfile.Performance
|
||||
showBorder: powerProfiles.profile !== PowerProfile.Performance
|
||||
onClicked: {
|
||||
|
||||
/* TODO: hook to power profile */ }
|
||||
if (powerProfiles.hasPerformanceProfile) {
|
||||
powerProfiles.profile = PowerProfile.Performance
|
||||
}
|
||||
}
|
||||
}
|
||||
// Balanced
|
||||
NIconButton {
|
||||
icon: "balance"
|
||||
showFilled: powerProfiles.profile === PowerProfile.Balanced
|
||||
showBorder: powerProfiles.profile !== PowerProfile.Balanced
|
||||
onClicked: {
|
||||
|
||||
/* TODO: hook to power profile */ }
|
||||
powerProfiles.profile = PowerProfile.Balanced
|
||||
}
|
||||
}
|
||||
// Eco
|
||||
NIconButton {
|
||||
icon: "eco"
|
||||
showFilled: powerProfiles.profile === PowerProfile.PowerSaver
|
||||
showBorder: powerProfiles.profile !== PowerProfile.PowerSaver
|
||||
onClicked: {
|
||||
|
||||
/* TODO: hook to power profile */ }
|
||||
powerProfiles.profile = PowerProfile.PowerSaver
|
||||
}
|
||||
}
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
|
||||
Reference in New Issue
Block a user