This commit is contained in:
Lysec
2026-02-10 00:23:31 +01:00
4 changed files with 31 additions and 22 deletions
+1 -1
View File
@@ -199,7 +199,7 @@ Singleton {
property bool hideOnOverview: false
// Auto-hide settings
property string displayMode: "always_visible" // "always_visible", "auto_hide"
property string displayMode: "always_visible"
property int autoHideDelay: 500 // ms before hiding after mouse leaves
property int autoShowDelay: 150 // ms before showing when mouse enters
+20 -17
View File
@@ -14,6 +14,26 @@ import qs.Widgets
Item {
id: root
property ShellScreen screen
property string widgetId: ""
property string section: ""
property int sectionWidgetIndex: -1
property int sectionWidgetsCount: 0
// Settings
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
// Explicit screenName property ensures reactive binding when screen changes
readonly property string screenName: screen ? screen.name : ""
property var widgetSettings: {
if (section && sectionWidgetIndex >= 0 && screenName) {
var widgets = Settings.getBarWidgetsForScreen(screenName)[section];
if (widgets && sectionWidgetIndex < widgets.length) {
return widgets[sectionWidgetIndex];
}
}
return {};
}
readonly property string barPosition: Settings.getBarPositionForScreen(screenName)
readonly property string capsIcon: widgetSettings.capsLockIcon !== undefined ? widgetSettings.capsLockIcon : widgetMetadata.capsLockIcon
readonly property real capsuleHeight: Style.getCapsuleHeightForScreen(screenName)
@@ -24,27 +44,10 @@ Item {
readonly property bool hideWhenOff: (widgetSettings.hideWhenOff !== undefined) ? widgetSettings.hideWhenOff : (widgetMetadata.hideWhenOff !== undefined ? widgetMetadata.hideWhenOff : false)
readonly property bool isVertical: barPosition === "left" || barPosition === "right"
readonly property string numIcon: widgetSettings.numLockIcon !== undefined ? widgetSettings.numLockIcon : widgetMetadata.numLockIcon
property ShellScreen screen
// Explicit screenName property ensures reactive binding when screen changes
readonly property string screenName: screen ? screen.name : ""
readonly property string scrollIcon: widgetSettings.scrollLockIcon !== undefined ? widgetSettings.scrollLockIcon : widgetMetadata.scrollLockIcon
property string section: ""
property int sectionWidgetIndex: -1
property int sectionWidgetsCount: 0
readonly property bool showCaps: (widgetSettings.showCapsLock !== undefined) ? widgetSettings.showCapsLock : widgetMetadata.showCapsLock
readonly property bool showNum: (widgetSettings.showNumLock !== undefined) ? widgetSettings.showNumLock : widgetMetadata.showNumLock
readonly property bool showScroll: (widgetSettings.showScrollLock !== undefined) ? widgetSettings.showScrollLock : widgetMetadata.showScrollLock
property string widgetId: ""
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
property var widgetSettings: {
if (section && sectionWidgetIndex >= 0 && screenName) {
var widgets = Settings.getBarWidgetsForScreen(screenName)[section];
if (widgets && sectionWidgetIndex < widgets.length) {
return widgets[sectionWidgetIndex];
}
}
return {};
}
implicitHeight: contentHeight
implicitWidth: contentWidth
+5 -4
View File
@@ -11,10 +11,6 @@ import qs.Widgets.AudioSpectrum
Item {
id: root
Layout.preferredHeight: isVertical ? -1 : Style.getBarHeightForScreen(screenName)
Layout.preferredWidth: isVertical ? Style.getBarHeightForScreen(screenName) : -1
Layout.fillHeight: false
Layout.fillWidth: false
property ShellScreen screen
property string widgetId: ""
@@ -81,6 +77,11 @@ Item {
readonly property string cavaComponentId: "bar:mediamini:" + root.screen?.name + ":" + root.section + ":" + root.sectionWidgetIndex
readonly property bool needsCava: root.showVisualizer && root.visualizerType !== "" && root.visualizerType !== "none"
Layout.preferredHeight: isVertical ? -1 : Style.getBarHeightForScreen(screenName)
Layout.preferredWidth: isVertical ? Style.getBarHeightForScreen(screenName) : -1
Layout.fillHeight: false
Layout.fillWidth: false
onNeedsCavaChanged: {
if (root.needsCava) {
CavaService.registerComponent(root.cavaComponentId);
+5
View File
@@ -33,6 +33,11 @@ Item {
function showBar() {
BarService.isVisible = true;
}
function setDisplayMode(mode: string) {
if (mode === "always_visible" || mode === "non_exclusive" || mode === "auto_hide") {
Settings.data.bar.displayMode = mode;
}
}
}
// Settings IPC helpers (outside IpcHandler to avoid QVariant IPC warnings)