Bar Widgets FrontEnd: Simplified access to editable widget settings
This commit is contained in:
parent
45af873a6f
commit
517c7c97d4
17 changed files with 135 additions and 105 deletions
|
|
@ -76,6 +76,7 @@ Variants {
|
||||||
widgetProps: {
|
widgetProps: {
|
||||||
"screen": root.modelData || null,
|
"screen": root.modelData || null,
|
||||||
"scaling": ScalingService.getScreenScale(screen),
|
"scaling": ScalingService.getScreenScale(screen),
|
||||||
|
"widgetId": modelData.id,
|
||||||
"barSection": parent.objectName,
|
"barSection": parent.objectName,
|
||||||
"sectionWidgetIndex": index,
|
"sectionWidgetIndex": index,
|
||||||
"sectionWidgetsCount": Settings.data.bar.widgets.left.length
|
"sectionWidgetsCount": Settings.data.bar.widgets.left.length
|
||||||
|
|
@ -103,6 +104,7 @@ Variants {
|
||||||
widgetProps: {
|
widgetProps: {
|
||||||
"screen": root.modelData || null,
|
"screen": root.modelData || null,
|
||||||
"scaling": ScalingService.getScreenScale(screen),
|
"scaling": ScalingService.getScreenScale(screen),
|
||||||
|
"widgetId": modelData.id,
|
||||||
"barSection": parent.objectName,
|
"barSection": parent.objectName,
|
||||||
"sectionWidgetIndex": index,
|
"sectionWidgetIndex": index,
|
||||||
"sectionWidgetsCount": Settings.data.bar.widgets.center.length
|
"sectionWidgetsCount": Settings.data.bar.widgets.center.length
|
||||||
|
|
@ -131,6 +133,7 @@ Variants {
|
||||||
widgetProps: {
|
widgetProps: {
|
||||||
"screen": root.modelData || null,
|
"screen": root.modelData || null,
|
||||||
"scaling": ScalingService.getScreenScale(screen),
|
"scaling": ScalingService.getScreenScale(screen),
|
||||||
|
"widgetId": modelData.id,
|
||||||
"barSection": parent.objectName,
|
"barSection": parent.objectName,
|
||||||
"sectionWidgetIndex": index,
|
"sectionWidgetIndex": index,
|
||||||
"sectionWidgetsCount": Settings.data.bar.widgets.right.length
|
"sectionWidgetsCount": Settings.data.bar.widgets.right.length
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,13 @@ RowLayout {
|
||||||
spacing: Style.marginS * scaling
|
spacing: Style.marginS * scaling
|
||||||
visible: getTitle() !== ""
|
visible: getTitle() !== ""
|
||||||
|
|
||||||
|
// Widget properties passed from Bar.qml for per-instance settings
|
||||||
|
property string widgetId: ""
|
||||||
property string barSection: ""
|
property string barSection: ""
|
||||||
property int sectionWidgetIndex: -1
|
property int sectionWidgetIndex: -1
|
||||||
property int sectionWidgetsCount: 0
|
property int sectionWidgetsCount: 0
|
||||||
|
|
||||||
|
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||||
property var widgetSettings: {
|
property var widgetSettings: {
|
||||||
var section = barSection.replace("Section", "").toLowerCase()
|
var section = barSection.replace("Section", "").toLowerCase()
|
||||||
if (section && sectionWidgetIndex >= 0) {
|
if (section && sectionWidgetIndex >= 0) {
|
||||||
|
|
@ -33,7 +36,7 @@ RowLayout {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property bool userShowIcon: (widgetSettings.showIcon !== undefined) ? widgetSettings.showIcon : ((Settings.data.bar.showActiveWindowIcon !== undefined) ? Settings.data.bar.showActiveWindowIcon : BarWidgetRegistry.widgetMetadata["ActiveWindow"].showIcon)
|
readonly property bool showIcon: (widgetSettings.showIcon !== undefined) ? widgetSettings.showIcon : widgetMetadata.showIcon
|
||||||
|
|
||||||
function getTitle() {
|
function getTitle() {
|
||||||
return CompositorService.focusedWindowTitle !== "(No active window)" ? CompositorService.focusedWindowTitle : ""
|
return CompositorService.focusedWindowTitle !== "(No active window)" ? CompositorService.focusedWindowTitle : ""
|
||||||
|
|
@ -91,7 +94,7 @@ RowLayout {
|
||||||
Layout.preferredWidth: Style.fontSizeL * scaling * 1.2
|
Layout.preferredWidth: Style.fontSizeL * scaling * 1.2
|
||||||
Layout.preferredHeight: Style.fontSizeL * scaling * 1.2
|
Layout.preferredHeight: Style.fontSizeL * scaling * 1.2
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
visible: getTitle() !== "" && userShowIcon
|
visible: getTitle() !== "" && showIcon
|
||||||
|
|
||||||
IconImage {
|
IconImage {
|
||||||
id: windowIcon
|
id: windowIcon
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,12 @@ Item {
|
||||||
property real scaling: 1.0
|
property real scaling: 1.0
|
||||||
|
|
||||||
// Widget properties passed from Bar.qml for per-instance settings
|
// Widget properties passed from Bar.qml for per-instance settings
|
||||||
|
property string widgetId: ""
|
||||||
property string barSection: ""
|
property string barSection: ""
|
||||||
property int sectionWidgetIndex: -1
|
property int sectionWidgetIndex: -1
|
||||||
property int sectionWidgetsCount: 0
|
property int sectionWidgetsCount: 0
|
||||||
|
|
||||||
// Resolve per-instance widget settings from Settings.data
|
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||||
property var widgetSettings: {
|
property var widgetSettings: {
|
||||||
var section = barSection.replace("Section", "").toLowerCase()
|
var section = barSection.replace("Section", "").toLowerCase()
|
||||||
if (section && sectionWidgetIndex >= 0) {
|
if (section && sectionWidgetIndex >= 0) {
|
||||||
|
|
@ -31,9 +32,9 @@ Item {
|
||||||
|
|
||||||
// Resolve settings: try user settings or defaults from BarWidgetRegistry
|
// Resolve settings: try user settings or defaults from BarWidgetRegistry
|
||||||
readonly property bool alwaysShowPercentage: widgetSettings.alwaysShowPercentage
|
readonly property bool alwaysShowPercentage: widgetSettings.alwaysShowPercentage
|
||||||
!== undefined ? widgetSettings.alwaysShowPercentage : BarWidgetRegistry.widgetMetadata["Battery"].alwaysShowPercentage
|
!== undefined ? widgetSettings.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage
|
||||||
readonly property real warningThreshold: widgetSettings.warningThreshold
|
readonly property real warningThreshold: widgetSettings.warningThreshold
|
||||||
!== undefined ? widgetSettings.warningThreshold : BarWidgetRegistry.widgetMetadata["Battery"].warningThreshold
|
!== undefined ? widgetSettings.warningThreshold : widgetMetadata.warningThreshold
|
||||||
|
|
||||||
// Test mode
|
// Test mode
|
||||||
readonly property bool testMode: true
|
readonly property bool testMode: true
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,14 @@ Item {
|
||||||
|
|
||||||
property ShellScreen screen
|
property ShellScreen screen
|
||||||
property real scaling: 1.0
|
property real scaling: 1.0
|
||||||
|
|
||||||
|
// Widget properties passed from Bar.qml for per-instance settings
|
||||||
|
property string widgetId: ""
|
||||||
property string barSection: ""
|
property string barSection: ""
|
||||||
property int sectionWidgetIndex: 0
|
property int sectionWidgetIndex: -1
|
||||||
property int sectionWidgetsCount: 0
|
property int sectionWidgetsCount: 0
|
||||||
|
|
||||||
|
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||||
property var widgetSettings: {
|
property var widgetSettings: {
|
||||||
var section = barSection.replace("Section", "").toLowerCase()
|
var section = barSection.replace("Section", "").toLowerCase()
|
||||||
if (section && sectionWidgetIndex >= 0) {
|
if (section && sectionWidgetIndex >= 0) {
|
||||||
|
|
@ -26,7 +30,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property bool userAlwaysShowPercentage: (widgetSettings.alwaysShowPercentage
|
readonly property bool userAlwaysShowPercentage: (widgetSettings.alwaysShowPercentage
|
||||||
!== undefined) ? widgetSettings.alwaysShowPercentage : BarWidgetRegistry.widgetMetadata["Brightness"].alwaysShowPercentage
|
!== undefined) ? widgetSettings.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage
|
||||||
|
|
||||||
// Used to avoid opening the pill on Quickshell startup
|
// Used to avoid opening the pill on Quickshell startup
|
||||||
property bool firstBrightnessReceived: false
|
property bool firstBrightnessReceived: false
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,12 @@ Rectangle {
|
||||||
property real scaling: 1.0
|
property real scaling: 1.0
|
||||||
|
|
||||||
// Widget properties passed from Bar.qml for per-instance settings
|
// Widget properties passed from Bar.qml for per-instance settings
|
||||||
|
property string widgetId: ""
|
||||||
property string barSection: ""
|
property string barSection: ""
|
||||||
property int sectionWidgetIndex: -1
|
property int sectionWidgetIndex: -1
|
||||||
property int sectionWidgetsCount: 0
|
property int sectionWidgetsCount: 0
|
||||||
|
|
||||||
// Resolve per-instance widget settings from Settings.data
|
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||||
property var widgetSettings: {
|
property var widgetSettings: {
|
||||||
var section = barSection.replace("Section", "").toLowerCase()
|
var section = barSection.replace("Section", "").toLowerCase()
|
||||||
if (section && sectionWidgetIndex >= 0) {
|
if (section && sectionWidgetIndex >= 0) {
|
||||||
|
|
@ -28,13 +29,11 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resolve settings: try user settings or defaults from BarWidgetRegistry
|
// Resolve settings: try user settings or defaults from BarWidgetRegistry
|
||||||
readonly property bool showDate: widgetSettings.showDate
|
readonly property bool showDate: widgetSettings.showDate !== undefined ? widgetSettings.showDate : widgetMetadata.showDate
|
||||||
!== undefined ? widgetSettings.showDate : BarWidgetRegistry.widgetMetadata["Clock"].showDate
|
readonly property bool use12h: widgetSettings.use12HourClock !== undefined ? widgetSettings.use12HourClock : widgetMetadata.use12HourClock
|
||||||
readonly property bool use12h: widgetSettings.use12HourClock
|
readonly property bool showSeconds: widgetSettings.showSeconds !== undefined ? widgetSettings.showSeconds : widgetMetadata.showSeconds
|
||||||
!== undefined ? widgetSettings.use12HourClock : BarWidgetRegistry.widgetMetadata["Clock"].use12HourClock
|
readonly property bool reverseDayMonth: widgetSettings.reverseDayMonth
|
||||||
readonly property bool showSeconds: widgetSettings.showSeconds
|
!== undefined ? widgetSettings.reverseDayMonth : widgetMetadata.reverseDayMonth
|
||||||
!== undefined ? widgetSettings.showSeconds : BarWidgetRegistry.widgetMetadata["Clock"].showSeconds
|
|
||||||
readonly property bool reverseDayMonth: widgetSettings.reverseDayMonth !== undefined ? widgetSettings.reverseDayMonth : BarWidgetRegistry.widgetMetadata["Clock"].reverseDayMonth
|
|
||||||
|
|
||||||
implicitWidth: clock.width + Style.marginM * 2 * scaling
|
implicitWidth: clock.width + Style.marginM * 2 * scaling
|
||||||
implicitHeight: Math.round(Style.capsuleHeight * scaling)
|
implicitHeight: Math.round(Style.capsuleHeight * scaling)
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,13 @@ NIconButton {
|
||||||
property var screen
|
property var screen
|
||||||
property real scaling: 1.0
|
property real scaling: 1.0
|
||||||
|
|
||||||
|
// Widget properties passed from Bar.qml for per-instance settings
|
||||||
|
property string widgetId: ""
|
||||||
property string barSection: ""
|
property string barSection: ""
|
||||||
property int sectionWidgetIndex: -1
|
property int sectionWidgetIndex: -1
|
||||||
property int sectionWidgetsCount: 0
|
property int sectionWidgetsCount: 0
|
||||||
|
|
||||||
// Get user settings from Settings data
|
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||||
property var widgetSettings: {
|
property var widgetSettings: {
|
||||||
var section = barSection.replace("Section", "").toLowerCase()
|
var section = barSection.replace("Section", "").toLowerCase()
|
||||||
if (section && sectionWidgetIndex >= 0) {
|
if (section && sectionWidgetIndex >= 0) {
|
||||||
|
|
@ -30,30 +32,27 @@ NIconButton {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use settings or defaults from BarWidgetRegistry
|
// Use settings or defaults from BarWidgetRegistry
|
||||||
readonly property string userIcon: widgetSettings.icon || BarWidgetRegistry.widgetMetadata["CustomButton"].icon
|
readonly property string customIcon: widgetSettings.icon || widgetMetadata.icon
|
||||||
readonly property string userLeftClickExec: widgetSettings.leftClickExec
|
readonly property string leftClickExec: widgetSettings.leftClickExec || widgetMetadata.leftClickExec
|
||||||
|| BarWidgetRegistry.widgetMetadata["CustomButton"].leftClickExec
|
readonly property string rightClickExec: widgetSettings.rightClickExec || widgetMetadata.rightClickExec
|
||||||
readonly property string userRightClickExec: widgetSettings.rightClickExec
|
readonly property string middleClickExec: widgetSettings.middleClickExec || widgetMetadata.middleClickExec
|
||||||
|| BarWidgetRegistry.widgetMetadata["CustomButton"].rightClickExec
|
readonly property bool hasExec: (leftClickExec || rightClickExec || middleClickExec)
|
||||||
readonly property string userMiddleClickExec: widgetSettings.middleClickExec
|
|
||||||
|| BarWidgetRegistry.widgetMetadata["CustomButton"].middleClickExec
|
|
||||||
readonly property bool hasExec: (userLeftClickExec || userRightClickExec || userMiddleClickExec)
|
|
||||||
|
|
||||||
sizeRatio: 0.8
|
sizeRatio: 0.8
|
||||||
icon: userIcon
|
icon: customIcon
|
||||||
tooltipText: {
|
tooltipText: {
|
||||||
if (!hasExec) {
|
if (!hasExec) {
|
||||||
return "Custom Button - Configure in settings"
|
return "Custom Button - Configure in settings"
|
||||||
} else {
|
} else {
|
||||||
var lines = []
|
var lines = []
|
||||||
if (userLeftClickExec !== "") {
|
if (leftClickExec !== "") {
|
||||||
lines.push(`Left click: <i>${userLeftClickExec}</i>.`)
|
lines.push(`Left click: <i>${leftClickExec}</i>.`)
|
||||||
}
|
}
|
||||||
if (userRightClickExec !== "") {
|
if (rightClickExec !== "") {
|
||||||
lines.push(`Right click: <i>${userRightClickExec}</i>.`)
|
lines.push(`Right click: <i>${rightClickExec}</i>.`)
|
||||||
}
|
}
|
||||||
if (userMiddleClickExec !== "") {
|
if (middleClickExec !== "") {
|
||||||
lines.push(`Middle click: <i>${userMiddleClickExec}</i>.`)
|
lines.push(`Middle click: <i>${middleClickExec}</i>.`)
|
||||||
}
|
}
|
||||||
return lines.join("<br/>")
|
return lines.join("<br/>")
|
||||||
}
|
}
|
||||||
|
|
@ -61,9 +60,9 @@ NIconButton {
|
||||||
opacity: hasExec ? Style.opacityFull : Style.opacityMedium
|
opacity: hasExec ? Style.opacityFull : Style.opacityMedium
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (userLeftClickExec) {
|
if (leftClickExec) {
|
||||||
Quickshell.execDetached(["sh", "-c", userLeftClickExec])
|
Quickshell.execDetached(["sh", "-c", leftClickExec])
|
||||||
Logger.log("CustomButton", `Executing command: ${userLeftClickExec}`)
|
Logger.log("CustomButton", `Executing command: ${leftClickExec}`)
|
||||||
} else if (!hasExec) {
|
} else if (!hasExec) {
|
||||||
// No script was defined, open settings
|
// No script was defined, open settings
|
||||||
var settingsPanel = PanelService.getPanel("settingsPanel")
|
var settingsPanel = PanelService.getPanel("settingsPanel")
|
||||||
|
|
@ -73,16 +72,16 @@ NIconButton {
|
||||||
}
|
}
|
||||||
|
|
||||||
onRightClicked: {
|
onRightClicked: {
|
||||||
if (userRightClickExec) {
|
if (rightClickExec) {
|
||||||
Quickshell.execDetached(["sh", "-c", userRightClickExec])
|
Quickshell.execDetached(["sh", "-c", rightClickExec])
|
||||||
Logger.log("CustomButton", `Executing command: ${userRightClickExec}`)
|
Logger.log("CustomButton", `Executing command: ${rightClickExec}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMiddleClicked: {
|
onMiddleClicked: {
|
||||||
if (userMiddleClickExec) {
|
if (middleClickExec) {
|
||||||
Quickshell.execDetached(["sh", "-c", userMiddleClickExec])
|
Quickshell.execDetached(["sh", "-c", middleClickExec])
|
||||||
Logger.log("CustomButton", `Executing command: ${userMiddleClickExec}`)
|
Logger.log("CustomButton", `Executing command: ${middleClickExec}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,6 @@ Item {
|
||||||
|
|
||||||
property ShellScreen screen
|
property ShellScreen screen
|
||||||
property real scaling: 1.0
|
property real scaling: 1.0
|
||||||
property string barSection: ""
|
|
||||||
property int sectionWidgetIndex: 0
|
|
||||||
property int sectionWidgetsCount: 0
|
|
||||||
|
|
||||||
// Use the shared service for keyboard layout
|
// Use the shared service for keyboard layout
|
||||||
property string currentLayout: KeyboardLayoutService.currentLayout
|
property string currentLayout: KeyboardLayoutService.currentLayout
|
||||||
|
|
|
||||||
|
|
@ -12,18 +12,14 @@ RowLayout {
|
||||||
|
|
||||||
property ShellScreen screen
|
property ShellScreen screen
|
||||||
property real scaling: 1.0
|
property real scaling: 1.0
|
||||||
readonly property real minWidth: 160
|
|
||||||
readonly property real maxWidth: 400
|
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
spacing: Style.marginS * scaling
|
|
||||||
visible: MediaService.currentPlayer !== null && MediaService.canPlay
|
|
||||||
Layout.preferredWidth: MediaService.currentPlayer !== null && MediaService.canPlay ? implicitWidth : 0
|
|
||||||
|
|
||||||
|
// Widget properties passed from Bar.qml for per-instance settings
|
||||||
|
property string widgetId: ""
|
||||||
property string barSection: ""
|
property string barSection: ""
|
||||||
property int sectionWidgetIndex: -1
|
property int sectionWidgetIndex: -1
|
||||||
property int sectionWidgetsCount: 0
|
property int sectionWidgetsCount: 0
|
||||||
|
|
||||||
|
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||||
property var widgetSettings: {
|
property var widgetSettings: {
|
||||||
var section = barSection.replace("Section", "").toLowerCase()
|
var section = barSection.replace("Section", "").toLowerCase()
|
||||||
if (section && sectionWidgetIndex >= 0) {
|
if (section && sectionWidgetIndex >= 0) {
|
||||||
|
|
@ -35,17 +31,25 @@ RowLayout {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property bool userShowAlbumArt: (widgetSettings.showAlbumArt !== undefined) ? widgetSettings.showAlbumArt : ((Settings.data.audio.showMiniplayerAlbumArt !== undefined) ? Settings.data.audio.showMiniplayerAlbumArt : BarWidgetRegistry.widgetMetadata["MediaMini"].showAlbumArt)
|
readonly property bool showAlbumArt: (widgetSettings.showAlbumArt
|
||||||
readonly property bool userShowVisualizer: (widgetSettings.showVisualizer !== undefined) ? widgetSettings.showVisualizer : ((Settings.data.audio.showMiniplayerCava !== undefined) ? Settings.data.audio.showMiniplayerCava : BarWidgetRegistry.widgetMetadata["MediaMini"].showVisualizer)
|
!== undefined) ? widgetSettings.showAlbumArt : widgetMetadata.showAlbumArt
|
||||||
readonly property string userVisualizerType: (widgetSettings.visualizerType !== undefined
|
readonly property bool showVisualizer: (widgetSettings.showVisualizer
|
||||||
&& widgetSettings.visualizerType
|
!== undefined) ? widgetSettings.showVisualizer : widgetMetadata.showVisualizer
|
||||||
!== "") ? widgetSettings.visualizerType : ((Settings.data.audio.visualizerType !== undefined
|
readonly property string visualizerType: (widgetSettings.visualizerType !== undefined && widgetSettings.visualizerType
|
||||||
&& Settings.data.audio.visualizerType !== "") ? Settings.data.audio.visualizerType : BarWidgetRegistry.widgetMetadata["MediaMini"].visualizerType)
|
!== "") ? widgetSettings.visualizerType : widgetMetadata.visualizerType
|
||||||
|
|
||||||
|
readonly property real minWidth: 160
|
||||||
|
readonly property real maxWidth: 400
|
||||||
|
|
||||||
function getTitle() {
|
function getTitle() {
|
||||||
return MediaService.trackTitle + (MediaService.trackArtist !== "" ? ` - ${MediaService.trackArtist}` : "")
|
return MediaService.trackTitle + (MediaService.trackArtist !== "" ? ` - ${MediaService.trackArtist}` : "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
spacing: Style.marginS * scaling
|
||||||
|
visible: MediaService.currentPlayer !== null && MediaService.canPlay
|
||||||
|
Layout.preferredWidth: MediaService.currentPlayer !== null && MediaService.canPlay ? implicitWidth : 0
|
||||||
|
|
||||||
// A hidden text element to safely measure the full title width
|
// A hidden text element to safely measure the full title width
|
||||||
NText {
|
NText {
|
||||||
id: fullTitleMetrics
|
id: fullTitleMetrics
|
||||||
|
|
@ -80,7 +84,7 @@ RowLayout {
|
||||||
Loader {
|
Loader {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
active: userShowVisualizer && userVisualizerType == "linear" && MediaService.isPlaying
|
active: showVisualizer && visualizerType == "linear" && MediaService.isPlaying
|
||||||
z: 0
|
z: 0
|
||||||
|
|
||||||
sourceComponent: LinearSpectrum {
|
sourceComponent: LinearSpectrum {
|
||||||
|
|
@ -95,7 +99,7 @@ RowLayout {
|
||||||
Loader {
|
Loader {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
active: userShowVisualizer && userVisualizerType == "mirrored" && MediaService.isPlaying
|
active: showVisualizer && visualizerType == "mirrored" && MediaService.isPlaying
|
||||||
z: 0
|
z: 0
|
||||||
|
|
||||||
sourceComponent: MirroredSpectrum {
|
sourceComponent: MirroredSpectrum {
|
||||||
|
|
@ -110,7 +114,7 @@ RowLayout {
|
||||||
Loader {
|
Loader {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
active: userShowVisualizer && userVisualizerType == "wave" && MediaService.isPlaying
|
active: showVisualizer && visualizerType == "wave" && MediaService.isPlaying
|
||||||
z: 0
|
z: 0
|
||||||
|
|
||||||
sourceComponent: WaveSpectrum {
|
sourceComponent: WaveSpectrum {
|
||||||
|
|
@ -134,12 +138,12 @@ RowLayout {
|
||||||
font.pointSize: Style.fontSizeL * scaling
|
font.pointSize: Style.fontSizeL * scaling
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
visible: !userShowAlbumArt && getTitle() !== "" && !trackArt.visible
|
visible: !showAlbumArt && getTitle() !== "" && !trackArt.visible
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
visible: userShowAlbumArt
|
visible: showAlbumArt
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,14 @@ Item {
|
||||||
|
|
||||||
property ShellScreen screen
|
property ShellScreen screen
|
||||||
property real scaling: 1.0
|
property real scaling: 1.0
|
||||||
|
|
||||||
|
// Widget properties passed from Bar.qml for per-instance settings
|
||||||
|
property string widgetId: ""
|
||||||
property string barSection: ""
|
property string barSection: ""
|
||||||
property int sectionWidgetIndex: 0
|
property int sectionWidgetIndex: -1
|
||||||
property int sectionWidgetsCount: 0
|
property int sectionWidgetsCount: 0
|
||||||
|
|
||||||
|
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||||
property var widgetSettings: {
|
property var widgetSettings: {
|
||||||
var section = barSection.replace("Section", "").toLowerCase()
|
var section = barSection.replace("Section", "").toLowerCase()
|
||||||
if (section && sectionWidgetIndex >= 0) {
|
if (section && sectionWidgetIndex >= 0) {
|
||||||
|
|
@ -27,7 +31,8 @@ Item {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property bool userAlwaysShowPercentage: widgetSettings?.alwaysShowPercentage
|
readonly property bool alwaysShowPercentage: (widgetSettings.alwaysShowPercentage
|
||||||
|
!== undefined) ? widgetSettings.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage
|
||||||
|
|
||||||
// Used to avoid opening the pill on Quickshell startup
|
// Used to avoid opening the pill on Quickshell startup
|
||||||
property bool firstInputVolumeReceived: false
|
property bool firstInputVolumeReceived: false
|
||||||
|
|
@ -91,7 +96,7 @@ Item {
|
||||||
collapsedIconColor: Color.mOnSurface
|
collapsedIconColor: Color.mOnSurface
|
||||||
autoHide: false // Important to be false so we can hover as long as we want
|
autoHide: false // Important to be false so we can hover as long as we want
|
||||||
text: Math.floor(AudioService.inputVolume * 100) + "%"
|
text: Math.floor(AudioService.inputVolume * 100) + "%"
|
||||||
forceOpen: userAlwaysShowPercentage
|
forceOpen: alwaysShowPercentage
|
||||||
tooltipText: "Microphone: " + Math.round(AudioService.inputVolume * 100)
|
tooltipText: "Microphone: " + Math.round(AudioService.inputVolume * 100)
|
||||||
+ "%\nLeft click for advanced settings.\nScroll up/down to change volume.\nRight click to toggle mute."
|
+ "%\nLeft click for advanced settings.\nScroll up/down to change volume.\nRight click to toggle mute."
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ NIconButton {
|
||||||
property real scaling: 1.0
|
property real scaling: 1.0
|
||||||
|
|
||||||
sizeRatio: 0.8
|
sizeRatio: 0.8
|
||||||
|
|
||||||
colorBg: Color.mSurfaceVariant
|
colorBg: Color.mSurfaceVariant
|
||||||
colorFg: Color.mOnSurface
|
colorFg: Color.mOnSurface
|
||||||
colorBorder: Color.transparent
|
colorBorder: Color.transparent
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,13 @@ NIconButton {
|
||||||
property ShellScreen screen
|
property ShellScreen screen
|
||||||
property real scaling: 1.0
|
property real scaling: 1.0
|
||||||
|
|
||||||
|
// Widget properties passed from Bar.qml for per-instance settings
|
||||||
|
property string widgetId: ""
|
||||||
property string barSection: ""
|
property string barSection: ""
|
||||||
property int sectionWidgetIndex: -1
|
property int sectionWidgetIndex: -1
|
||||||
property int sectionWidgetsCount: 0
|
property int sectionWidgetsCount: 0
|
||||||
|
|
||||||
|
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||||
property var widgetSettings: {
|
property var widgetSettings: {
|
||||||
var section = barSection.replace("Section", "").toLowerCase()
|
var section = barSection.replace("Section", "").toLowerCase()
|
||||||
if (section && sectionWidgetIndex >= 0) {
|
if (section && sectionWidgetIndex >= 0) {
|
||||||
|
|
@ -27,9 +30,10 @@ NIconButton {
|
||||||
}
|
}
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
readonly property bool showUnreadBadge: (widgetSettings.showUnreadBadge
|
||||||
readonly property bool userShowUnreadBadge: (widgetSettings.showUnreadBadge !== undefined) ? widgetSettings.showUnreadBadge : BarWidgetRegistry.widgetMetadata["NotificationHistory"].showUnreadBadge
|
!== undefined) ? widgetSettings.showUnreadBadge : widgetMetadata.showUnreadBadge
|
||||||
readonly property bool userHideWhenZero: (widgetSettings.hideWhenZero !== undefined) ? widgetSettings.hideWhenZero : BarWidgetRegistry.widgetMetadata["NotificationHistory"].hideWhenZero
|
readonly property bool hideWhenZero: (widgetSettings.hideWhenZero
|
||||||
|
!== undefined) ? widgetSettings.hideWhenZero : widgetMetadata.hideWhenZero
|
||||||
|
|
||||||
function lastSeenTs() {
|
function lastSeenTs() {
|
||||||
return Settings.data.notifications?.lastSeenTs || 0
|
return Settings.data.notifications?.lastSeenTs || 0
|
||||||
|
|
@ -70,7 +74,7 @@ NIconButton {
|
||||||
anchors.rightMargin: -4 * scaling
|
anchors.rightMargin: -4 * scaling
|
||||||
anchors.topMargin: -4 * scaling
|
anchors.topMargin: -4 * scaling
|
||||||
z: 2
|
z: 2
|
||||||
active: userShowUnreadBadge && (!userHideWhenZero || computeUnreadCount() > 0)
|
active: showUnreadBadge && (!hideWhenZero || computeUnreadCount() > 0)
|
||||||
sourceComponent: Rectangle {
|
sourceComponent: Rectangle {
|
||||||
id: badge
|
id: badge
|
||||||
readonly property int count: computeUnreadCount()
|
readonly property int count: computeUnreadCount()
|
||||||
|
|
@ -82,7 +86,7 @@ NIconButton {
|
||||||
color: Color.mError
|
color: Color.mError
|
||||||
border.color: Color.mSurface
|
border.color: Color.mSurface
|
||||||
border.width: 1
|
border.width: 1
|
||||||
visible: count > 0 || !userHideWhenZero
|
visible: count > 0 || !hideWhenZero
|
||||||
NText {
|
NText {
|
||||||
id: textNode
|
id: textNode
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,14 @@ NIconButton {
|
||||||
|
|
||||||
property ShellScreen screen
|
property ShellScreen screen
|
||||||
property real scaling: 1.0
|
property real scaling: 1.0
|
||||||
|
|
||||||
|
// Widget properties passed from Bar.qml for per-instance settings
|
||||||
|
property string widgetId: ""
|
||||||
property string barSection: ""
|
property string barSection: ""
|
||||||
property int sectionWidgetIndex: -1
|
property int sectionWidgetIndex: -1
|
||||||
property int sectionWidgetsCount: 0
|
property int sectionWidgetsCount: 0
|
||||||
|
|
||||||
|
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||||
property var widgetSettings: {
|
property var widgetSettings: {
|
||||||
var section = barSection.replace("Section", "").toLowerCase()
|
var section = barSection.replace("Section", "").toLowerCase()
|
||||||
if (section && sectionWidgetIndex >= 0) {
|
if (section && sectionWidgetIndex >= 0) {
|
||||||
|
|
@ -26,9 +30,10 @@ NIconButton {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property bool userUseDistroLogo: (widgetSettings.useDistroLogo !== undefined) ? widgetSettings.useDistroLogo : ((Settings.data.bar.useDistroLogo !== undefined) ? Settings.data.bar.useDistroLogo : BarWidgetRegistry.widgetMetadata["SidePanelToggle"].useDistroLogo)
|
readonly property bool useDistroLogo: (widgetSettings.useDistroLogo
|
||||||
|
!== undefined) ? widgetSettings.useDistroLogo : widgetMetadata.useDistroLogo
|
||||||
|
|
||||||
icon: userUseDistroLogo ? "" : "widgets"
|
icon: useDistroLogo ? "" : "widgets"
|
||||||
tooltipText: "Open side panel."
|
tooltipText: "Open side panel."
|
||||||
sizeRatio: 0.8
|
sizeRatio: 0.8
|
||||||
|
|
||||||
|
|
@ -46,8 +51,8 @@ NIconButton {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: root.width * 0.6
|
width: root.width * 0.6
|
||||||
height: width
|
height: width
|
||||||
source: userUseDistroLogo ? DistroLogoService.osLogo : ""
|
source: useDistroLogo ? DistroLogoService.osLogo : ""
|
||||||
visible: userUseDistroLogo && source !== ""
|
visible: useDistroLogo && source !== ""
|
||||||
smooth: true
|
smooth: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,13 @@ Item {
|
||||||
property var screen
|
property var screen
|
||||||
property real scaling: 1.0
|
property real scaling: 1.0
|
||||||
|
|
||||||
|
// Widget properties passed from Bar.qml for per-instance settings
|
||||||
|
property string widgetId: ""
|
||||||
property string barSection: ""
|
property string barSection: ""
|
||||||
property int sectionWidgetIndex: -1
|
property int sectionWidgetIndex: -1
|
||||||
property int sectionWidgetsCount: 0
|
property int sectionWidgetsCount: 0
|
||||||
|
|
||||||
// Get user settings from Settings data - make it reactive
|
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||||
property var widgetSettings: {
|
property var widgetSettings: {
|
||||||
var section = barSection.replace("Section", "").toLowerCase()
|
var section = barSection.replace("Section", "").toLowerCase()
|
||||||
if (section && sectionWidgetIndex >= 0) {
|
if (section && sectionWidgetIndex >= 0) {
|
||||||
|
|
@ -29,19 +31,10 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use settings or defaults from BarWidgetRegistry
|
// Use settings or defaults from BarWidgetRegistry
|
||||||
readonly property int userWidth: {
|
readonly property int spacerWidth: widgetSettings.width !== undefined ? widgetSettings.width : widgetMetadata.width
|
||||||
var section = barSection.replace("Section", "").toLowerCase()
|
|
||||||
if (section && sectionWidgetIndex >= 0) {
|
|
||||||
var widgets = Settings.data.bar.widgets[section]
|
|
||||||
if (widgets && sectionWidgetIndex < widgets.length) {
|
|
||||||
return widgets[sectionWidgetIndex].width || BarWidgetRegistry.widgetMetadata["Spacer"].width
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return BarWidgetRegistry.widgetMetadata["Spacer"].width
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the width based on user settings
|
// Set the width based on user settings
|
||||||
implicitWidth: userWidth * scaling
|
implicitWidth: spacerWidth * scaling
|
||||||
implicitHeight: Style.barHeight * scaling
|
implicitHeight: Style.barHeight * scaling
|
||||||
width: implicitWidth
|
width: implicitWidth
|
||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
|
|
@ -51,6 +44,6 @@ Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: Qt.rgba(1, 0, 0, 0.1) // Very subtle red tint
|
color: Qt.rgba(1, 0, 0, 0.1) // Very subtle red tint
|
||||||
visible: Settings.data.general.debugMode || false
|
visible: Settings.data.general.debugMode || false
|
||||||
radius: 2 * scaling
|
radius: Style.radiusXXS * scaling
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,13 @@ RowLayout {
|
||||||
property ShellScreen screen
|
property ShellScreen screen
|
||||||
property real scaling: 1.0
|
property real scaling: 1.0
|
||||||
|
|
||||||
|
// Widget properties passed from Bar.qml for per-instance settings
|
||||||
|
property string widgetId: ""
|
||||||
property string barSection: ""
|
property string barSection: ""
|
||||||
property int sectionWidgetIndex: -1
|
property int sectionWidgetIndex: -1
|
||||||
property int sectionWidgetsCount: 0
|
property int sectionWidgetsCount: 0
|
||||||
|
|
||||||
|
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||||
property var widgetSettings: {
|
property var widgetSettings: {
|
||||||
var section = barSection.replace("Section", "").toLowerCase()
|
var section = barSection.replace("Section", "").toLowerCase()
|
||||||
if (section && sectionWidgetIndex >= 0) {
|
if (section && sectionWidgetIndex >= 0) {
|
||||||
|
|
@ -26,11 +29,13 @@ RowLayout {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property bool userShowCpuUsage: (widgetSettings.showCpuUsage !== undefined) ? widgetSettings.showCpuUsage : BarWidgetRegistry.widgetMetadata["SystemMonitor"].showCpuUsage
|
readonly property bool showCpuUsage: (widgetSettings.showCpuUsage
|
||||||
readonly property bool userShowCpuTemp: (widgetSettings.showCpuTemp !== undefined) ? widgetSettings.showCpuTemp : BarWidgetRegistry.widgetMetadata["SystemMonitor"].showCpuTemp
|
!== undefined) ? widgetSettings.showCpuUsage : widgetMetadata.showCpuUsage
|
||||||
readonly property bool userShowMemoryUsage: (widgetSettings.showMemoryUsage !== undefined) ? widgetSettings.showMemoryUsage : BarWidgetRegistry.widgetMetadata["SystemMonitor"].showMemoryUsage
|
readonly property bool showCpuTemp: (widgetSettings.showCpuTemp !== undefined) ? widgetSettings.showCpuTemp : widgetMetadata.showCpuTemp
|
||||||
readonly property bool userShowNetworkStats: (widgetSettings.showNetworkStats
|
readonly property bool showMemoryUsage: (widgetSettings.showMemoryUsage
|
||||||
!== undefined) ? widgetSettings.showNetworkStats : ((Settings.data.bar.showNetworkStats !== undefined) ? Settings.data.bar.showNetworkStats : BarWidgetRegistry.widgetMetadata["SystemMonitor"].showNetworkStats)
|
!== undefined) ? widgetSettings.showMemoryUsage : widgetMetadata.showMemoryUsage
|
||||||
|
readonly property bool showNetworkStats: (widgetSettings.showNetworkStats
|
||||||
|
!== undefined) ? widgetSettings.showNetworkStats : widgetMetadata.showNetworkStats
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
spacing: Style.marginS * scaling
|
spacing: Style.marginS * scaling
|
||||||
|
|
@ -55,7 +60,7 @@ RowLayout {
|
||||||
id: cpuUsageLayout
|
id: cpuUsageLayout
|
||||||
spacing: Style.marginXS * scaling
|
spacing: Style.marginXS * scaling
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
visible: userShowCpuUsage
|
visible: showCpuUsage
|
||||||
|
|
||||||
NIcon {
|
NIcon {
|
||||||
id: cpuUsageIcon
|
id: cpuUsageIcon
|
||||||
|
|
@ -81,7 +86,7 @@ RowLayout {
|
||||||
// spacing is thin here to compensate for the vertical thermometer icon
|
// spacing is thin here to compensate for the vertical thermometer icon
|
||||||
spacing: Style.marginXXS * scaling
|
spacing: Style.marginXXS * scaling
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
visible: userShowCpuTemp
|
visible: showCpuTemp
|
||||||
|
|
||||||
NIcon {
|
NIcon {
|
||||||
text: "thermometer"
|
text: "thermometer"
|
||||||
|
|
@ -104,7 +109,7 @@ RowLayout {
|
||||||
id: memoryUsageLayout
|
id: memoryUsageLayout
|
||||||
spacing: Style.marginXS * scaling
|
spacing: Style.marginXS * scaling
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
visible: userShowMemoryUsage
|
visible: showMemoryUsage
|
||||||
|
|
||||||
NIcon {
|
NIcon {
|
||||||
text: "memory"
|
text: "memory"
|
||||||
|
|
@ -127,7 +132,7 @@ RowLayout {
|
||||||
id: networkDownloadLayout
|
id: networkDownloadLayout
|
||||||
spacing: Style.marginXS * scaling
|
spacing: Style.marginXS * scaling
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
visible: userShowNetworkStats
|
visible: showNetworkStats
|
||||||
|
|
||||||
NIcon {
|
NIcon {
|
||||||
text: "download"
|
text: "download"
|
||||||
|
|
@ -150,7 +155,7 @@ RowLayout {
|
||||||
id: networkUploadLayout
|
id: networkUploadLayout
|
||||||
spacing: Style.marginXS * scaling
|
spacing: Style.marginXS * scaling
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
visible: userShowNetworkStats
|
visible: showNetworkStats
|
||||||
|
|
||||||
NIcon {
|
NIcon {
|
||||||
text: "upload"
|
text: "upload"
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ Rectangle {
|
||||||
|
|
||||||
property ShellScreen screen
|
property ShellScreen screen
|
||||||
property real scaling: 1.0
|
property real scaling: 1.0
|
||||||
|
|
||||||
readonly property real itemSize: 24 * scaling
|
readonly property real itemSize: 24 * scaling
|
||||||
|
|
||||||
function onLoaded() {
|
function onLoaded() {
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,14 @@ Item {
|
||||||
|
|
||||||
property ShellScreen screen
|
property ShellScreen screen
|
||||||
property real scaling: 1.0
|
property real scaling: 1.0
|
||||||
|
|
||||||
|
// Widget properties passed from Bar.qml for per-instance settings
|
||||||
|
property string widgetId: ""
|
||||||
property string barSection: ""
|
property string barSection: ""
|
||||||
property int sectionWidgetIndex: 0
|
property int sectionWidgetIndex: -1
|
||||||
property int sectionWidgetsCount: 0
|
property int sectionWidgetsCount: 0
|
||||||
|
|
||||||
|
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||||
property var widgetSettings: {
|
property var widgetSettings: {
|
||||||
var section = barSection.replace("Section", "").toLowerCase()
|
var section = barSection.replace("Section", "").toLowerCase()
|
||||||
if (section && sectionWidgetIndex >= 0) {
|
if (section && sectionWidgetIndex >= 0) {
|
||||||
|
|
@ -26,8 +30,9 @@ Item {
|
||||||
}
|
}
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
readonly property bool userAlwaysShowPercentage: (widgetSettings.alwaysShowPercentage
|
|
||||||
!== undefined) ? widgetSettings.alwaysShowPercentage : ((Settings.data.bar.alwaysShowBatteryPercentage !== undefined) ? Settings.data.bar.alwaysShowBatteryPercentage : BarWidgetRegistry.widgetMetadata["Volume"].alwaysShowPercentage)
|
readonly property bool alwaysShowPercentage: (widgetSettings.alwaysShowPercentage
|
||||||
|
!== undefined) ? widgetSettings.alwaysShowPercentage : widgetMetadata.alwaysShowPercentage
|
||||||
|
|
||||||
// Used to avoid opening the pill on Quickshell startup
|
// Used to avoid opening the pill on Quickshell startup
|
||||||
property bool firstVolumeReceived: false
|
property bool firstVolumeReceived: false
|
||||||
|
|
@ -76,7 +81,7 @@ Item {
|
||||||
collapsedIconColor: Color.mOnSurface
|
collapsedIconColor: Color.mOnSurface
|
||||||
autoHide: false // Important to be false so we can hover as long as we want
|
autoHide: false // Important to be false so we can hover as long as we want
|
||||||
text: Math.floor(AudioService.volume * 100) + "%"
|
text: Math.floor(AudioService.volume * 100) + "%"
|
||||||
forceOpen: userAlwaysShowPercentage
|
forceOpen: alwaysShowPercentage
|
||||||
tooltipText: "Volume: " + Math.round(AudioService.volume * 100)
|
tooltipText: "Volume: " + Math.round(AudioService.volume * 100)
|
||||||
+ "%\nLeft click for advanced settings.\nScroll up/down to change volume.\nRight click to toggle mute."
|
+ "%\nLeft click for advanced settings.\nScroll up/down to change volume.\nRight click to toggle mute."
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,13 @@ Item {
|
||||||
property ShellScreen screen
|
property ShellScreen screen
|
||||||
property real scaling: 1.0
|
property real scaling: 1.0
|
||||||
|
|
||||||
|
// Widget properties passed from Bar.qml for per-instance settings
|
||||||
|
property string widgetId: ""
|
||||||
property string barSection: ""
|
property string barSection: ""
|
||||||
property int sectionWidgetIndex: -1
|
property int sectionWidgetIndex: -1
|
||||||
property int sectionWidgetsCount: 0
|
property int sectionWidgetsCount: 0
|
||||||
|
|
||||||
|
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||||
property var widgetSettings: {
|
property var widgetSettings: {
|
||||||
var section = barSection.replace("Section", "").toLowerCase()
|
var section = barSection.replace("Section", "").toLowerCase()
|
||||||
if (section && sectionWidgetIndex >= 0) {
|
if (section && sectionWidgetIndex >= 0) {
|
||||||
|
|
@ -29,7 +32,7 @@ Item {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property string userLabelMode: (widgetSettings.labelMode !== undefined) ? widgetSettings.labelMode : ((Settings.data.bar.showWorkspaceLabel !== undefined) ? Settings.data.bar.showWorkspaceLabel : BarWidgetRegistry.widgetMetadata["Workspace"].labelMode)
|
readonly property string labelMode: (widgetSettings.labelMode !== undefined) ? widgetSettings.labelMode : widgetMetadata.labelMode
|
||||||
|
|
||||||
property bool isDestroying: false
|
property bool isDestroying: false
|
||||||
property bool hovered: false
|
property bool hovered: false
|
||||||
|
|
@ -162,7 +165,7 @@ Item {
|
||||||
model: localWorkspaces
|
model: localWorkspaces
|
||||||
Item {
|
Item {
|
||||||
id: workspacePillContainer
|
id: workspacePillContainer
|
||||||
height: (userLabelMode !== "none") ? Math.round(18 * scaling) : Math.round(14 * scaling)
|
height: (labelMode !== "none") ? Math.round(18 * scaling) : Math.round(14 * scaling)
|
||||||
width: root.calculatedWsWidth(model)
|
width: root.calculatedWsWidth(model)
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
@ -170,13 +173,13 @@ Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
active: (userLabelMode !== "none")
|
active: (labelMode !== "none")
|
||||||
sourceComponent: Component {
|
sourceComponent: Component {
|
||||||
Text {
|
Text {
|
||||||
x: (pill.width - width) / 2
|
x: (pill.width - width) / 2
|
||||||
y: (pill.height - height) / 2 + (height - contentHeight) / 2
|
y: (pill.height - height) / 2 + (height - contentHeight) / 2
|
||||||
text: {
|
text: {
|
||||||
if (userLabelMode === "name" && model.name && model.name.length > 0) {
|
if (labelMode === "name" && model.name && model.name.length > 0) {
|
||||||
return model.name.substring(0, 2)
|
return model.name.substring(0, 2)
|
||||||
} else {
|
} else {
|
||||||
return model.idx.toString()
|
return model.idx.toString()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue