Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Mobile
Commits
3a72512e
Commit
3a72512e
authored
Oct 10, 2019
by
Marco Martin
Browse files
different heuristics for cutting names
parent
fbbb6043
Changes
1
Hide whitespace changes
Inline
Side-by-side
containments/homescreen/package/contents/ui/launcher/Delegate.qml
View file @
3a72512e
...
...
@@ -99,6 +99,12 @@ ContainmentLayoutManager.ItemContainer {
plasmoid
.
nativeInterface
.
applicationListModel
.
runApplication
(
modelData
.
ApplicationStorageIdRole
);
}
Rectangle
{
anchors.fill
:
parent
z
:
-
1
radius
:
10
opacity
:
0.1
}
//preventStealing: true
ColumnLayout
{
anchors.fill
:
parent
...
...
@@ -126,12 +132,28 @@ ContainmentLayoutManager.ItemContainer {
visible
:
text
.
length
>
0
Layout.fillWidth
:
true
Layout.leftMargin
:
-
delegate
.
leftPadding
Layout.rightMargin
:
-
delegate
.
rightPadding
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignTop
maximumLineCount
:
2
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
font.pixelSize
:
theme
.
defaultFont
.
pixelSize
*
0.9
color
:
model
.
ApplicationLocationRole
==
ApplicationListModel
.
Desktop
?
"
white
"
:
theme
.
textColor
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment