Qt 6.12's QtQuick exports a Color singleton, which hides the Omarchy and Noctalia kits' Commons.Color: every Color.foreground read undefined, so plugin buttons, toggles and text fell back to black. The kits now import QtQuick 6.8, which predates it, and the installer pins the same version in plugin files that use Color (reinstall plugins to pick it up). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
59 lines
1.9 KiB
QML
59 lines
1.9 KiB
QML
import QtQuick 6.8 // 6.12 added a QtQuick Color singleton that hides Commons.Color
|
|
import Quickshell.Io
|
|
import qs.compat.omarchy.Commons
|
|
// Base item for plugin popup widgets. Many first-party plugins expose a bar
|
|
// button plus a popup from one QML entry point; this base owns the shared
|
|
// IPC-backed open/close lifecycle while implementations own button behavior,
|
|
// keyboard navigation, and content.
|
|
Item {
|
|
id: root
|
|
|
|
property QtObject bar: null
|
|
property string moduleName: ""
|
|
property var settings: ({})
|
|
property string ipcTarget: ""
|
|
property bool manageIpc: true
|
|
property alias controller: panelController
|
|
property bool popoutSwitching: false
|
|
property bool popoutSwitchClosing: false
|
|
|
|
readonly property bool opened: panelController.open
|
|
readonly property color barForeground: bar ? bar.barForeground : Color.foreground
|
|
|
|
function open() { panelController.show() }
|
|
function close() { panelController.hide() }
|
|
function closeForPopoutSwitch() {
|
|
popoutSwitchClosing = true
|
|
close()
|
|
Qt.callLater(function() { popoutSwitchClosing = false })
|
|
}
|
|
function toggle() { opened ? close() : open() }
|
|
function switchPanel(direction) {
|
|
if (bar && typeof bar.switchPanelFrom === "function") return bar.switchPanelFrom(root, direction)
|
|
return false
|
|
}
|
|
|
|
// Read a single value from this panel's inline shell.json entry, with a
|
|
// fallback for missing/null values. Matches BarWidget.setting().
|
|
function setting(name, fallback) {
|
|
var value = settings ? settings[name] : undefined
|
|
return value === undefined || value === null ? fallback : value
|
|
}
|
|
|
|
PanelController {
|
|
id: panelController
|
|
}
|
|
|
|
ShellIpc {
|
|
enabled: root.manageIpc && root.ipcTarget !== ""
|
|
target: root.ipcTarget
|
|
|
|
function open(): void { root.open() }
|
|
function close(): void { root.close() }
|
|
function show(): void { root.open() }
|
|
function hide(): void { root.close() }
|
|
function toggle(): void { root.toggle() }
|
|
}
|
|
|
|
}
|