hardcoded icons on scaled, find better solution later
This commit is contained in:
+29
-4
@@ -1,3 +1,5 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
@@ -8,9 +10,22 @@ import qs.Config
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
implicitWidth: workspacesRow.implicitWidth + 10
|
||||
required property PanelWindow bar
|
||||
property HyprlandMonitor monitor: Hyprland.monitorFor( root.bar?.screen )
|
||||
|
||||
implicitWidth: workspacesRow.implicitWidth + 6
|
||||
implicitHeight: workspacesRow.implicitHeight + 7
|
||||
|
||||
function shouldShow(monitor) {
|
||||
Hyprland.refreshWorkspaces();
|
||||
Hyprland.refreshMonitors();
|
||||
if ( monitor === root.monitor ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
color: "#40000000"
|
||||
radius: height / 2
|
||||
|
||||
@@ -25,7 +40,7 @@ Rectangle {
|
||||
id: workspacesRow
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.leftMargin: 5
|
||||
anchors.leftMargin: 3
|
||||
spacing: 8
|
||||
|
||||
Repeater {
|
||||
@@ -34,8 +49,8 @@ Rectangle {
|
||||
Rectangle {
|
||||
required property var modelData
|
||||
|
||||
width: 14
|
||||
height: 14
|
||||
width: 16
|
||||
height: 16
|
||||
radius: height / 2
|
||||
|
||||
color: modelData.id === Hyprland.focusedWorkspace.id ? Config.accentColor.accents.primary : "#606060"
|
||||
@@ -43,6 +58,8 @@ Rectangle {
|
||||
border.color: modelData.id === Hyprland.focusedWorkspace.id ? Config.accentColor.accents.primaryAlt : "#808080"
|
||||
border.width: 1
|
||||
|
||||
visible: root.shouldShow( modelData.monitor )
|
||||
|
||||
scale: 1.0
|
||||
opacity: 1.0
|
||||
|
||||
@@ -73,6 +90,14 @@ Rectangle {
|
||||
duration: 200
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: modelData.id
|
||||
font.pixelSize: 10
|
||||
font.family: "Rubik"
|
||||
color: modelData.id === Hyprland.focusedWorkspace.id ? Config.workspaceWidget.textColor : Config.workspaceWidget.inactiveTextColor
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
|
||||
Reference in New Issue
Block a user