mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-14 10:10:16 +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
|
||||
|
||||
@@ -50,7 +50,6 @@ NPanel {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
|
||||
// Prevent event bubbling
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ NLoader {
|
||||
// Target screen to open on
|
||||
property var targetScreen: null
|
||||
|
||||
// Public API to open the panel aligned under a given x coordinate.
|
||||
function openAt(x, screen) {
|
||||
anchorX = x
|
||||
targetScreen = screen
|
||||
|
||||
Reference in New Issue
Block a user