mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-24 05:27:21 +02:00
[ui] Homepage: Add QML elide to projects' labels and align them correctly
This commit is contained in:
parent
52c6bb7c46
commit
e8eeccded1
1 changed files with 4 additions and 10 deletions
|
@ -356,18 +356,12 @@ Page {
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
id: project
|
id: project
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: projectDelegate.horizontalCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
width: projectDelegate.width
|
width: projectDelegate.width
|
||||||
wrapMode: Text.WrapAnywhere
|
elide: Text.ElideMiddle
|
||||||
text: {
|
text: Filepath.basename(modelData["path"])
|
||||||
if (Filepath.removeExtension(Filepath.basename(modelData["path"])).length > 40) {
|
maximumLineCount: 1
|
||||||
var length = Filepath.basename(modelData["path"]).length
|
|
||||||
return Filepath.basename(modelData["path"]).substring(0, 30) + "…" + Filepath.basename(modelData["path"]).substring(length - 10, length)
|
|
||||||
} else {
|
|
||||||
return Filepath.basename(modelData["path"])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
font.pointSize: 10
|
font.pointSize: 10
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue