Add Recording indicator to bar
This commit is contained in:
parent
d345e3fbc0
commit
fc493db906
4 changed files with 34 additions and 11 deletions
|
|
@ -81,12 +81,22 @@ Variants {
|
||||||
anchors.verticalCenter: bar.verticalCenter
|
anchors.verticalCenter: bar.verticalCenter
|
||||||
spacing: Style.marginSmall * scaling
|
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
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
onClicked: {
|
||||||
|
ScreenRecorder.toggleRecording()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Notification Icon
|
Tray {
|
||||||
NotificationHistory {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
import Quickshell.Services.UPower
|
||||||
import qs.Services
|
import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
|
|
@ -10,6 +11,10 @@ NBox {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredWidth: 1
|
Layout.preferredWidth: 1
|
||||||
implicitHeight: powerRow.implicitHeight + Style.marginMedium * 2 * scaling
|
implicitHeight: powerRow.implicitHeight + Style.marginMedium * 2 * scaling
|
||||||
|
|
||||||
|
// PowerProfiles service
|
||||||
|
property var powerProfiles: PowerProfiles
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: powerRow
|
id: powerRow
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
@ -21,23 +26,33 @@ NBox {
|
||||||
// Performance
|
// Performance
|
||||||
NIconButton {
|
NIconButton {
|
||||||
icon: "speed"
|
icon: "speed"
|
||||||
|
enabled: powerProfiles.hasPerformanceProfile
|
||||||
|
opacity: enabled ? 1.0 : 0.3
|
||||||
|
showFilled: powerProfiles.profile === PowerProfile.Performance
|
||||||
|
showBorder: powerProfiles.profile !== PowerProfile.Performance
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
if (powerProfiles.hasPerformanceProfile) {
|
||||||
/* TODO: hook to power profile */ }
|
powerProfiles.profile = PowerProfile.Performance
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Balanced
|
// Balanced
|
||||||
NIconButton {
|
NIconButton {
|
||||||
icon: "balance"
|
icon: "balance"
|
||||||
|
showFilled: powerProfiles.profile === PowerProfile.Balanced
|
||||||
|
showBorder: powerProfiles.profile !== PowerProfile.Balanced
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
powerProfiles.profile = PowerProfile.Balanced
|
||||||
/* TODO: hook to power profile */ }
|
}
|
||||||
}
|
}
|
||||||
// Eco
|
// Eco
|
||||||
NIconButton {
|
NIconButton {
|
||||||
icon: "eco"
|
icon: "eco"
|
||||||
|
showFilled: powerProfiles.profile === PowerProfile.PowerSaver
|
||||||
|
showBorder: powerProfiles.profile !== PowerProfile.PowerSaver
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
powerProfiles.profile = PowerProfile.PowerSaver
|
||||||
/* TODO: hook to power profile */ }
|
}
|
||||||
}
|
}
|
||||||
Item {
|
Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,6 @@ NPanel {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|
||||||
// Prevent event bubbling
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ NLoader {
|
||||||
// Target screen to open on
|
// Target screen to open on
|
||||||
property var targetScreen: null
|
property var targetScreen: null
|
||||||
|
|
||||||
// Public API to open the panel aligned under a given x coordinate.
|
|
||||||
function openAt(x, screen) {
|
function openAt(x, screen) {
|
||||||
anchorX = x
|
anchorX = x
|
||||||
targetScreen = screen
|
targetScreen = screen
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue