Workspace: use font metrics for vertical centering
Another attempt xD
This commit is contained in:
parent
fc71f61000
commit
fabdf67da7
1 changed files with 5 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue