Add Recording indicator to bar

This commit is contained in:
Ly-sec 2025-08-13 16:15:05 +02:00
parent d345e3fbc0
commit fc493db906
4 changed files with 34 additions and 11 deletions

View file

@ -81,12 +81,22 @@ Variants {
anchors.verticalCenter: bar.verticalCenter
spacing: Style.marginSmall * scaling
Tray {
// Screen Recording Indicator
NIconButton {
id: screenRecordingIndicator
icon: "videocam"
tooltipText: "Screen Recording Active"
sizeMultiplier: 0.8
showBorder: false
showFilled: ScreenRecorder.isRecording
visible: ScreenRecorder.isRecording
anchors.verticalCenter: parent.verticalCenter
onClicked: {
ScreenRecorder.toggleRecording()
}
}
// TODO: Notification Icon
NotificationHistory {
Tray {
anchors.verticalCenter: parent.verticalCenter
}

View file

@ -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

View file

@ -50,7 +50,6 @@ NPanel {
anchors.fill: parent
onClicked: {
// Prevent event bubbling
}
}

View file

@ -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