reworked Workspace.qml to support specialworkspace, fixed launcher opening on two monitors, added slider animation back as an option
This commit is contained in:
@@ -156,48 +156,21 @@ ModuleChip {
|
||||
}
|
||||
}
|
||||
|
||||
PopupPanel {
|
||||
StandardPopup {
|
||||
id: volumePopup
|
||||
ns: "volume"
|
||||
chipRoot: root
|
||||
cardWidth: Cfg.Config.volumePopupWidth
|
||||
cardColor: root.t.volPopupBg
|
||||
cardBorderColor: root.t.volPopupBorder
|
||||
cardHeight: popupCol.implicitHeight + 30
|
||||
|
||||
Rectangle {
|
||||
id: volCard
|
||||
width: parent.width
|
||||
height: popupCol.implicitHeight + 30
|
||||
|
||||
anchors.top: root.isTop ? parent.top : undefined
|
||||
anchors.bottom: root.isTop ? undefined : parent.bottom
|
||||
|
||||
transform: Scale {
|
||||
yScale: volumePopup.popupOpen ? 1 : 0
|
||||
origin.y: root.isTop ? 0 : volCard.height
|
||||
Behavior on yScale {
|
||||
NumberAnimation {
|
||||
duration: Cfg.Config.popupAnimDuration
|
||||
easing.type: Easing.OutBack
|
||||
}
|
||||
enabled: volumePopup.visible
|
||||
}
|
||||
}
|
||||
|
||||
opacity: volumePopup.popupOpen ? 1.0 : 0.0
|
||||
Behavior on opacity { NumberAnimation { duration: 200 } }
|
||||
|
||||
radius: Cfg.Config.popupRadius
|
||||
color: root.t.volPopupBg
|
||||
border.color: root.t.volPopupBorder
|
||||
border.width: Cfg.Config.popupBorderWidth
|
||||
|
||||
MouseArea { anchors.fill: parent; propagateComposedEvents: false }
|
||||
|
||||
ColumnLayout {
|
||||
id: popupCol
|
||||
anchors { left: parent.left; right: parent.right; top: parent.top }
|
||||
anchors.margins: 16
|
||||
anchors.topMargin: 16
|
||||
spacing: 16
|
||||
ColumnLayout {
|
||||
id: popupCol
|
||||
anchors { left: parent.left; right: parent.right; top: parent.top }
|
||||
anchors.margins: 16
|
||||
anchors.topMargin: 16
|
||||
spacing: 16
|
||||
|
||||
VolumeSection {
|
||||
id: outputSection
|
||||
@@ -294,7 +267,6 @@ ModuleChip {
|
||||
}
|
||||
Item { height: 0 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
component VolumeSection: ColumnLayout {
|
||||
|
||||
@@ -13,6 +13,22 @@ ModuleChip {
|
||||
chipColor: t.wsPanelBg
|
||||
chipBorderColor: t.wsPanelBorder
|
||||
|
||||
property string activeSpecial: ""
|
||||
property string lastActiveName: ""
|
||||
|
||||
Connections {
|
||||
target: Hyprland
|
||||
function onRawEvent(event) {
|
||||
if (event.name === "activespecial") {
|
||||
var name = event.data.split(",")[0]
|
||||
root.activeSpecial = name
|
||||
}
|
||||
if (event.name === "workspace") {
|
||||
root.lastActiveName = event.data
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: workspaceLayout
|
||||
anchors.centerIn: parent
|
||||
@@ -22,13 +38,25 @@ ModuleChip {
|
||||
model: Hyprland.workspaces
|
||||
|
||||
Rectangle {
|
||||
Layout.preferredWidth: modelData.active ? 34 : 28
|
||||
id: wsPill
|
||||
|
||||
visible: modelData.name !== "special:magic"
|
||||
|
||||
property bool isSelected: modelData.active || (root.activeSpecial !== "" && modelData.name === root.lastActiveName)
|
||||
|
||||
Layout.preferredWidth: isSelected ? 34 : 28
|
||||
Layout.preferredHeight: 22
|
||||
radius: 11
|
||||
|
||||
color: modelData.active
|
||||
? root.t.wsActiveBg
|
||||
: (wsHover.hovered ? root.t.wsHoverBg : root.t.wsInactiveBg)
|
||||
color: {
|
||||
if (isSelected && root.activeSpecial !== "") {
|
||||
return root.t.wsMagicActiveBg
|
||||
}
|
||||
if (modelData.active) {
|
||||
return root.t.wsActiveBg
|
||||
}
|
||||
return wsHover.hovered ? root.t.wsHoverBg : root.t.wsInactiveBg
|
||||
}
|
||||
|
||||
Behavior on color { ColorAnimation { duration: 200 } }
|
||||
Behavior on Layout.preferredWidth { NumberAnimation { duration: 200 } }
|
||||
@@ -38,9 +66,15 @@ ModuleChip {
|
||||
text: modelData.name
|
||||
font.pixelSize: 11
|
||||
font.bold: true
|
||||
color: modelData.active
|
||||
? root.t.wsActiveText
|
||||
: (wsHover.hovered ? root.t.wsHoverText : root.t.wsInactiveText)
|
||||
color: {
|
||||
if (isSelected && root.activeSpecial !== "") {
|
||||
return root.t.wsMagicActiveText
|
||||
}
|
||||
if (modelData.active) {
|
||||
return root.t.wsActiveText
|
||||
}
|
||||
return wsHover.hovered ? root.t.wsHoverText : root.t.wsInactiveText
|
||||
}
|
||||
}
|
||||
|
||||
HoverHandler { id: wsHover; cursorShape: Qt.PointingHandCursor }
|
||||
|
||||
Reference in New Issue
Block a user