bar: elide active window title
This commit is contained in:
parent
efd09ae86e
commit
bdad4c47c4
4 changed files with 18 additions and 6 deletions
|
|
@ -20,6 +20,8 @@ Singleton {
|
||||||
readonly property int innerHeight: 30
|
readonly property int innerHeight: 30
|
||||||
readonly property int floatingGap: 10
|
readonly property int floatingGap: 10
|
||||||
readonly property int floatingGapLarge: 15
|
readonly property int floatingGapLarge: 15
|
||||||
|
readonly property int maxLabelWidth: 600
|
||||||
|
readonly property int maxLabelHeight: 400
|
||||||
}
|
}
|
||||||
|
|
||||||
component Workspaces: QtObject {
|
component Workspaces: QtObject {
|
||||||
|
|
|
||||||
|
|
@ -15,18 +15,28 @@ StyledRect {
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
id: icon
|
id: icon
|
||||||
|
|
||||||
|
animate: true
|
||||||
text: Icons.getAppCategoryIcon(Hyprland.activeClient?.wmClass, "desktop_windows")
|
text: Icons.getAppCategoryIcon(Hyprland.activeClient?.wmClass, "desktop_windows")
|
||||||
color: root.colour
|
color: root.colour
|
||||||
}
|
}
|
||||||
|
|
||||||
AnchorText {
|
AnchorText {
|
||||||
prevAnchor: icon
|
prevAnchor: icon
|
||||||
vertical: root.vertical
|
|
||||||
|
text: metrics.elidedText
|
||||||
|
font.pointSize: metrics.font.pointSize
|
||||||
|
font.family: metrics.font.family
|
||||||
|
color: root.colour
|
||||||
|
rotation: vertical ? 90 : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
TextMetrics {
|
||||||
|
id: metrics
|
||||||
|
|
||||||
text: Hyprland.activeClient?.title ?? "Desktop"
|
text: Hyprland.activeClient?.title ?? "Desktop"
|
||||||
font.pointSize: Appearance.font.size.smaller
|
font.pointSize: Appearance.font.size.smaller
|
||||||
font.family: Appearance.font.family.mono
|
font.family: Appearance.font.family.mono
|
||||||
color: root.colour
|
elide: Qt.ElideRight
|
||||||
rotation: root.vertical ? 90 : 0
|
elideWidth: root.vertical ? BarConfig.sizes.maxLabelHeight : BarConfig.sizes.maxLabelWidth
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ Item {
|
||||||
readonly property string activeLabel: BarConfig.workspaces.activeLabel || (root.isOccupied ? occupiedLabel : label)
|
readonly property string activeLabel: BarConfig.workspaces.activeLabel || (root.isOccupied ? occupiedLabel : label)
|
||||||
|
|
||||||
animate: true
|
animate: true
|
||||||
animateProp: "scale"
|
|
||||||
text: Hyprland.activeWsId === root.ws ? activeLabel : root.isOccupied ? occupiedLabel : label
|
text: Hyprland.activeWsId === root.ws ? activeLabel : root.isOccupied ? occupiedLabel : label
|
||||||
color: BarConfig.workspaces.occupiedBg || root.isOccupied ? Appearance.colours.text : Appearance.colours.subtext0
|
color: BarConfig.workspaces.occupiedBg || root.isOccupied ? Appearance.colours.text : Appearance.colours.subtext0
|
||||||
horizontalAlignment: StyledText.AlignHCenter
|
horizontalAlignment: StyledText.AlignHCenter
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,8 @@ Text {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property bool animate: false
|
property bool animate: false
|
||||||
property string animateProp: "opacity"
|
property string animateProp: "scale"
|
||||||
|
property int animateDuration: Appearance.anim.durations.normal
|
||||||
|
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
color: Appearance.colours.text
|
color: Appearance.colours.text
|
||||||
|
|
@ -41,7 +42,7 @@ Text {
|
||||||
component Anim: NumberAnimation {
|
component Anim: NumberAnimation {
|
||||||
target: root
|
target: root
|
||||||
property: root.animateProp
|
property: root.animateProp
|
||||||
duration: Appearance.anim.durations.small
|
duration: root.animateDuration / 2
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue