Workspace: use font metrics for vertical centering

Another attempt xD
This commit is contained in:
LemmyCook 2025-08-26 14:18:38 -04:00
parent fc71f61000
commit fabdf67da7

View file

@ -156,14 +156,17 @@ Item {
width: root.calculatedWsWidth(model)
Rectangle {
id: workspacePill
id: pill
anchors.fill: parent
Loader {
anchors.centerIn: parent
active: Settings.data.bar.showWorkspacesNames
sourceComponent: Component {
Text {
// Center horizontally
x: (pill.width - width) / 2
// Center vertically accounting for font metrics
y: (pill.height - height) / 2 + (height - contentHeight) / 2
text: {
if (model.name && model.name.length > 0) {
return model.name.substring(0, 2)