unfinished workspace redesign
This commit is contained in:
+1
-1
@@ -35,7 +35,7 @@ PanelWindow {
|
|||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: 0
|
anchors.leftMargin: Config.big_spacing_fun(height)
|
||||||
spacing: Config.big_spacing_fun(height)
|
spacing: Config.big_spacing_fun(height)
|
||||||
|
|
||||||
MenuButton {}
|
MenuButton {}
|
||||||
|
|||||||
@@ -16,9 +16,8 @@ MouseArea {
|
|||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: menuButton.containsMouse ? Colors.secondaryContainer_fg : Qt.alpha(Colors.secondary, 0.75)
|
color: "transparent"
|
||||||
radius: Config.radius_fun(menuButton.height)
|
radius: Config.radius_fun(menuButton.height)
|
||||||
border.width: 0
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: menuText
|
id: menuText
|
||||||
@@ -26,7 +25,7 @@ MouseArea {
|
|||||||
text: ""
|
text: ""
|
||||||
font.pixelSize: Config.bigIconSize(menuButton.height)
|
font.pixelSize: Config.bigIconSize(menuButton.height)
|
||||||
font.family: Config.font
|
font.family: Config.font
|
||||||
color: menuButton.containsMouse ? Colors.secondaryContainer : Colors.secondary_fg
|
color: Colors.secondaryContainer_fg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,36 +4,61 @@ import Quickshell.Hyprland
|
|||||||
import "../../../config"
|
import "../../../config"
|
||||||
import "../states/Apps"
|
import "../states/Apps"
|
||||||
|
|
||||||
Row {
|
Rectangle {
|
||||||
id: workspacesRow
|
id: workspacesContainer
|
||||||
|
|
||||||
required property HyprlandMonitor thisMonitor
|
required property HyprlandMonitor thisMonitor
|
||||||
spacing: Config.spacing_fun(bar.height)
|
|
||||||
|
height: bar.height - (Config.spacing_fun(bar.height) * 1.5)
|
||||||
|
width: workspacesRow.width + (Config.spacing_fun(bar.height) * 2)
|
||||||
|
|
||||||
|
radius: height / 2
|
||||||
|
|
||||||
|
color: Colors.surfaceVariant
|
||||||
|
border.color: Colors.surfaceVariant_fg
|
||||||
|
border.width: Config.border_width
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: workspacesRow
|
||||||
|
anchors.centerIn: parent
|
||||||
|
spacing: Config.spacing_fun(bar.height) / 2
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: Hyprland.workspaces
|
model: Hyprland.workspaces
|
||||||
Loader {
|
Loader {
|
||||||
active: modelData.monitor === thisMonitor
|
active: modelData.monitor === thisMonitor
|
||||||
sourceComponent: Rectangle {
|
sourceComponent: Item {
|
||||||
id: wsRect
|
id: wsItem
|
||||||
property var workspaceData: modelData
|
property var workspaceData: modelData
|
||||||
|
|
||||||
|
|
||||||
width: {
|
width: {
|
||||||
var cw = wsNum.width
|
var cw = wsNum.width
|
||||||
if (wsIconsRow.children.length > 0)
|
if (wsIconsRow.children.length > 0)
|
||||||
cw += Config.spacing_fun(bar.height) + wsIconsRow.width
|
cw += Config.spacing_fun(bar.height) + wsIconsRow.width
|
||||||
Math.max(cw + Config.spacing_fun(bar.height)*2, wsNum.height + Config.spacing_fun(bar.height)*2)
|
Math.max(cw + Config.spacing_fun(bar.height)*2, wsNum.height + Config.spacing_fun(bar.height)*2)
|
||||||
}
|
}
|
||||||
height: wsNum.height + Config.spacing_fun(wsNum.height)
|
height: workspacesContainer.height
|
||||||
radius: Config.radius_fun(height)
|
|
||||||
|
// highlight
|
||||||
|
Rectangle {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height - (Config.spacing_fun(bar.height) * 1.5)
|
||||||
|
|
||||||
|
radius: height / 2
|
||||||
|
|
||||||
color: wsArea.containsMouse ? Colors.tertiaryContainer
|
color: wsArea.containsMouse ? Colors.tertiaryContainer
|
||||||
: workspaceData.active ? Colors.primaryContainer
|
: workspaceData.active ? Colors.primaryContainer
|
||||||
: Colors.secondaryContainer
|
: "transparent"
|
||||||
|
|
||||||
border.color: wsArea.containsMouse ? Colors.tertiaryContainer_fg
|
border.color: wsArea.containsMouse ? Colors.tertiaryContainer_fg
|
||||||
: workspaceData.active ? Colors.primaryContainer_fg
|
: workspaceData.active ? Colors.primaryContainer_fg
|
||||||
: Colors.secondaryContainer_fg
|
: "transparent"
|
||||||
border.width: Config.border_width
|
|
||||||
|
|
||||||
|
border.width: (wsArea.containsMouse || workspaceData.active) ? Config.border_width : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// hyprland workspace api + color
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: wsArea
|
id: wsArea
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
@@ -63,7 +88,7 @@ Row {
|
|||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: wsIconsRow
|
id: wsIconsRow
|
||||||
spacing: Config.spacing_fun(workspacesRow.height)
|
spacing: Config.spacing_fun(workspacesContainer.height)
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
@@ -82,11 +107,13 @@ Row {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
visible: Hyprland.workspaces.length === 0
|
visible: Hyprland.workspaces.length === 0
|
||||||
text: "No Workspaces"
|
text: "No Workspaces"
|
||||||
color: Colors.error
|
color: Colors.error
|
||||||
font.pixelSize: Config.iconSize(bar.height)
|
font.pixelSize: Config.iconSize(bar.height)
|
||||||
|
anchors.centerIn: parent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user