mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
workspace-pill: support for full bar dimension
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user