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,76 +4,102 @@ 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)
|
|
||||||
|
|
||||||
Repeater {
|
height: bar.height - (Config.spacing_fun(bar.height) * 1.5)
|
||||||
model: Hyprland.workspaces
|
width: workspacesRow.width + (Config.spacing_fun(bar.height) * 2)
|
||||||
Loader {
|
|
||||||
active: modelData.monitor === thisMonitor
|
|
||||||
sourceComponent: Rectangle {
|
|
||||||
id: wsRect
|
|
||||||
property var workspaceData: modelData
|
|
||||||
|
|
||||||
width: {
|
radius: height / 2
|
||||||
var cw = wsNum.width
|
|
||||||
if (wsIconsRow.children.length > 0)
|
|
||||||
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)
|
|
||||||
}
|
|
||||||
height: wsNum.height + Config.spacing_fun(wsNum.height)
|
|
||||||
radius: Config.radius_fun(height)
|
|
||||||
color: wsArea.containsMouse ? Colors.tertiaryContainer
|
|
||||||
: workspaceData.active ? Colors.primaryContainer
|
|
||||||
: Colors.secondaryContainer
|
|
||||||
border.color: wsArea.containsMouse ? Colors.tertiaryContainer_fg
|
|
||||||
: workspaceData.active ? Colors.primaryContainer_fg
|
|
||||||
: Colors.secondaryContainer_fg
|
|
||||||
border.width: Config.border_width
|
|
||||||
|
|
||||||
MouseArea {
|
color: Colors.surfaceVariant
|
||||||
id: wsArea
|
border.color: Colors.surfaceVariant_fg
|
||||||
hoverEnabled: true
|
border.width: Config.border_width
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
anchors.fill: parent
|
Row {
|
||||||
onClicked: {
|
id: workspacesRow
|
||||||
console.log("[Workspaces] Switch to workspace: " + workspaceData.id)
|
anchors.centerIn: parent
|
||||||
Hyprland.dispatch("workspace " + workspaceData.id)
|
spacing: Config.spacing_fun(bar.height) / 2
|
||||||
Hyprland.dispatch("hl.dsp.focus({ workspace = "+workspaceData.id+" })")
|
|
||||||
|
Repeater {
|
||||||
|
model: Hyprland.workspaces
|
||||||
|
Loader {
|
||||||
|
active: modelData.monitor === thisMonitor
|
||||||
|
sourceComponent: Item {
|
||||||
|
id: wsItem
|
||||||
|
property var workspaceData: modelData
|
||||||
|
|
||||||
|
|
||||||
|
width: {
|
||||||
|
var cw = wsNum.width
|
||||||
|
if (wsIconsRow.children.length > 0)
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
height: workspacesContainer.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
|
||||||
|
: workspaceData.active ? Colors.primaryContainer
|
||||||
|
: "transparent"
|
||||||
|
|
||||||
|
border.color: wsArea.containsMouse ? Colors.tertiaryContainer_fg
|
||||||
|
: workspaceData.active ? Colors.primaryContainer_fg
|
||||||
|
: "transparent"
|
||||||
|
|
||||||
|
border.width: (wsArea.containsMouse || workspaceData.active) ? Config.border_width : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
// hyprland workspace api + color
|
||||||
anchors.centerIn: parent
|
MouseArea {
|
||||||
spacing: Config.spacing_fun(parent.height)
|
id: wsArea
|
||||||
|
hoverEnabled: true
|
||||||
Text {
|
cursorShape: Qt.PointingHandCursor
|
||||||
id: wsNum
|
anchors.fill: parent
|
||||||
text: workspaceData.id
|
onClicked: {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
console.log("[Workspaces] Switch to workspace: " + workspaceData.id)
|
||||||
color: wsArea.containsMouse ? Colors.tertiary
|
Hyprland.dispatch("workspace " + workspaceData.id)
|
||||||
: workspaceData.active ? Colors.primary
|
Hyprland.dispatch("hl.dsp.focus({ workspace = "+workspaceData.id+" })")
|
||||||
: Colors.secondary
|
|
||||||
font.pixelSize: Config.iconSize(bar.height)
|
|
||||||
font.family: Config.font
|
|
||||||
font.bold: true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: wsIconsRow
|
anchors.centerIn: parent
|
||||||
spacing: Config.spacing_fun(workspacesRow.height)
|
spacing: Config.spacing_fun(parent.height)
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
Repeater {
|
Text {
|
||||||
model: AppsState.iconsForWorkspace(workspaceData.id)
|
id: wsNum
|
||||||
delegate: Text {
|
text: workspaceData.id
|
||||||
text: modelData
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
color: wsArea.containsMouse ? Colors.tertiary
|
color: wsArea.containsMouse ? Colors.tertiary
|
||||||
: Colors.secondary
|
: workspaceData.active ? Colors.primary
|
||||||
font.pixelSize: Config.labelSize(bar.height)
|
: Colors.secondary
|
||||||
font.family: Config.font
|
font.pixelSize: Config.iconSize(bar.height)
|
||||||
|
font.family: Config.font
|
||||||
|
font.bold: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: wsIconsRow
|
||||||
|
spacing: Config.spacing_fun(workspacesContainer.height)
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: AppsState.iconsForWorkspace(workspaceData.id)
|
||||||
|
delegate: Text {
|
||||||
|
text: modelData
|
||||||
|
color: wsArea.containsMouse ? Colors.tertiary
|
||||||
|
: Colors.secondary
|
||||||
|
font.pixelSize: Config.labelSize(bar.height)
|
||||||
|
font.family: Config.font
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,5 +114,6 @@ Row {
|
|||||||
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