import QtQuick import QtQuick.Controls.Basic import QtQuick.Layouts import Quickshell import Quickshell.I3 import Quickshell.Widgets import "../classes" as Class import "../../" RowLayout { spacing: 0 Layout.maximumHeight:24 id: workspaces property var ws_focused: I3.focusedWorkspace?.number Repeater { model: I3.workspaces.values Button { padding: 2 MouseArea{ id: ws_button hoverEnabled: true anchors.fill: parent cursorShape: Qt.PointingHandCursor onClicked: I3.dispatch(`workspace number `+modelData.number); } background: Rectangle { width:16 height: 24 anchors.centerIn: parent color: (modelData.name == ws_focused) ? Resources.palette.orange : ws_button.containsMouse ? Resources.palette.altbg : Resources.palette.bg } contentItem: Text { id: wsLabel property var ws_special: (modelData.number > 10) horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter text: ({ "11": Icons.workspaces.download, "12": Icons.workspaces.volume_mixer }) [modelData.name] ?? modelData.name padding: 0 color: (modelData.name == ws_focused) ? Resources.palette.bg : Resources.palette.fg font.family: (ws_special) ? font_icon.name : font_proggy.name font.pixelSize: (ws_special) ? Resources.fontsize.workspace_icon : Resources.fontsize.topbar_text renderType: Text.NativeRendering } } } }