import QtQuick import Quickshell import qs.Commons import qs.Ui // Bar button for Quick Fix. Click opens the chat under it; the icon turns // into an hourglass while a job runs and takes the alert colour when one // failed while the chat was closed. BarWidget { id: root moduleName: "mx-quickfix" readonly property var service: bar && bar.shell ? bar.shell.serviceFor(moduleName) : null readonly property bool opened: panel.opened readonly property bool popoutSwitchClosing: panel.popoutSwitchClosing implicitWidth: button.implicitWidth implicitHeight: button.implicitHeight function open() { panel.open() } function close() { panel.close() } function toggle() { panel.opened ? panel.close() : panel.open() } function closeForPopoutSwitch() { panel.closeForPopoutSwitch() } BarIconButton { id: button anchors.fill: parent bar: root.bar text: root.service && root.service.running ? "󰔟" : "󰚩" tooltipText: root.service && root.service.running ? "Quick fix: working…" : "Quick fix" active: !!root.service && root.service.unseenFailure onPressed: function(mouseButton) { if (mouseButton === Qt.LeftButton) root.toggle() } } ChatPanel { id: panel bar: root.bar moduleName: root.moduleName settings: root.settings anchorItem: button service: root.service } }