mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-04 02:34:45 +00:00
different heuristics for cutting names
This commit is contained in:
parent
fbbb604318
commit
3a72512e79
1 changed files with 23 additions and 1 deletions
|
|
@ -99,6 +99,12 @@ ContainmentLayoutManager.ItemContainer {
|
||||||
|
|
||||||
plasmoid.nativeInterface.applicationListModel.runApplication(modelData.ApplicationStorageIdRole);
|
plasmoid.nativeInterface.applicationListModel.runApplication(modelData.ApplicationStorageIdRole);
|
||||||
}
|
}
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill:parent
|
||||||
|
z: -1
|
||||||
|
radius: 10
|
||||||
|
opacity: 0.1
|
||||||
|
}
|
||||||
//preventStealing: true
|
//preventStealing: true
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
@ -126,12 +132,28 @@ ContainmentLayoutManager.ItemContainer {
|
||||||
visible: text.length > 0
|
visible: text.length > 0
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
Layout.leftMargin: -delegate.leftPadding
|
||||||
|
Layout.rightMargin: -delegate.rightPadding
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignTop
|
verticalAlignment: Text.AlignTop
|
||||||
maximumLineCount: 2
|
maximumLineCount: 2
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
|
|
||||||
text: model.ApplicationNameRole //.split(" ")[0]
|
text: {
|
||||||
|
var pieces = model.ApplicationNameRole.split(" ");
|
||||||
|
var word = "";
|
||||||
|
var nextWord = "";
|
||||||
|
var i = 0;
|
||||||
|
while (nextWord.length < 15) {
|
||||||
|
word += " " + pieces[i++];
|
||||||
|
if (i < pieces.length) {
|
||||||
|
nextWord = word + " " + pieces[i];
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return word;
|
||||||
|
}
|
||||||
//FIXME: export smallestReadableFont
|
//FIXME: export smallestReadableFont
|
||||||
font.pixelSize: theme.defaultFont.pixelSize * 0.9
|
font.pixelSize: theme.defaultFont.pixelSize * 0.9
|
||||||
color: model.ApplicationLocationRole == ApplicationListModel.Desktop ? "white" : theme.textColor
|
color: model.ApplicationLocationRole == ApplicationListModel.Desktop ? "white" : theme.textColor
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue