import QtQuick import QtQuick.Controls.Basic import QtQuick.Layouts import Quickshell import Quickshell.I3 import Quickshell.Widgets import "../classes" as Class import "../../" RowLayout { spacing: 2 property var ws_focused: I3.focusedWorkspace?.number Repeater { model: I3.workspaces.values Button { id: ws_button property var ws_special: (modelData.number >= 10) MouseArea{ id: ws_mouse_area hoverEnabled: true anchors.fill: parent cursorShape: Qt.PointingHandCursor onClicked: I3.dispatch(`workspace number `+ modelData.number); } display: ws_special ? AbstractButton.IconOnly : AbstractButton.TextOnly icon.source: ({ "10": "../../icons/phosphor/regular/text-align-left.svg", "11": "../../icons/phosphor/regular/download.svg", "12": "../../icons/phosphor/regular/sliders.svg", "13": "../../icons/phosphor/regular/music.svg", }) [modelData.number] ?? modelData.number icon.color: (modelData.name == ws_focused) ? Resources.palette.bg : Resources.palette.fg icon.width: Resources.fontsize.topbar_text-1 icon.height: Resources.fontsize.topbar_text-1 padding: 0 background: Rectangle { id: rect height: Resources.barsize.topbar width: Resources.barsize.topbar implicitHeight: Resources.barsize.topbar implicitWidth: Resources.barsize.topbar anchors.verticalCenter: parent.verticalCenter color: (modelData.name == ws_focused) ? Resources.palette.orange : ws_mouse_area.containsMouse ? Resources.palette.altbg : Resources.palette.bg } Class.TopbarText { horizontalAlignment: rect.AlignHCenter // verticalAlignment: rect.AlignVCenter anchors.centerIn:parent text: ws_special ? "" : modelData.number color: (modelData.name == ws_focused) ? Resources.palette.bg : Resources.palette.fg } } } }