workspace-pill: support for full bar dimension

This commit is contained in:
Lemmy
2026-01-27 23:01:36 -05:00
parent ed0ce655ad
commit 747cd8c0d6
2 changed files with 14 additions and 7 deletions
+10 -5
View File
@@ -12,6 +12,7 @@ Item {
// These must be provided by the parent Workspace widget
required property real baseDimensionRatio
required property real capsuleHeight
required property real barHeight
required property string labelMode
required property int characterCount
required property real textRatio
@@ -33,9 +34,9 @@ Item {
property real pillWidth: isVertical ? fixedDimension : getWorkspaceWidth(workspace, false)
property real pillHeight: isVertical ? getWorkspaceHeight(workspace, false) : fixedDimension
// Container uses full capsuleHeight on cross-axis for larger click area
width: isVertical ? capsuleHeight : getWorkspaceWidth(workspace, false)
height: isVertical ? getWorkspaceHeight(workspace, false) : capsuleHeight
// Container uses full barHeight on cross-axis for larger click area
width: isVertical ? barHeight : getWorkspaceWidth(workspace, false)
height: isVertical ? getWorkspaceHeight(workspace, false) : barHeight
states: [
State {
@@ -43,8 +44,8 @@ Item {
when: workspace.isActive
PropertyChanges {
target: pillContainer
width: isVertical ? capsuleHeight : getWorkspaceWidth(workspace, true)
height: isVertical ? getWorkspaceHeight(workspace, true) : capsuleHeight
width: isVertical ? barHeight : getWorkspaceWidth(workspace, true)
height: isVertical ? getWorkspaceHeight(workspace, true) : barHeight
pillWidth: isVertical ? fixedDimension : getWorkspaceWidth(workspace, true)
pillHeight: isVertical ? getWorkspaceHeight(workspace, true) : fixedDimension
}
@@ -82,6 +83,8 @@ Item {
z: 0
color: {
if (pillMouseArea.containsMouse)
return Color.mHover;
if (workspace.isFocused)
return colorMap[focusedColor][0];
if (workspace.isUrgent)
@@ -120,6 +123,8 @@ Item {
font.weight: Style.fontWeightBold
wrapMode: Text.Wrap
color: {
if (pillMouseArea.containsMouse)
return Color.mOnHover;
if (workspace.isFocused)
return colorMap[focusedColor][1];
if (workspace.isUrgent)
+4 -2
View File
@@ -540,7 +540,7 @@ Item {
id: pillRow
spacing: spacingBetweenPills
x: horizontalPadding
y: workspaceBackground.y + Style.pixelAlignCenter(workspaceBackground.height, height)
y: 0
visible: !isVertical && !showApplications
Repeater {
@@ -552,6 +552,7 @@ Item {
isVertical: false
baseDimensionRatio: root.baseDimensionRatio
capsuleHeight: root.capsuleHeight
barHeight: root.barHeight
labelMode: root.labelMode
characterCount: root.characterCount
textRatio: root.textRatio
@@ -573,7 +574,7 @@ Item {
Column {
id: pillColumn
spacing: spacingBetweenPills
x: workspaceBackground.x + Style.pixelAlignCenter(workspaceBackground.width, width)
x: 0
y: horizontalPadding
visible: isVertical && !showApplications
@@ -586,6 +587,7 @@ Item {
isVertical: true
baseDimensionRatio: root.baseDimensionRatio
capsuleHeight: root.capsuleHeight
barHeight: root.barHeight
labelMode: root.labelMode
characterCount: root.characterCount
textRatio: root.textRatio