on xenial help sign in
Tweak app drawer a bit
0d45cd3Albert Astals Cid
qml/Launcher/Drawer.qml+38−2
@@ -272,7 +272,7 @@ FocusScope {
272
272
273 model: sortProxyModel
273 model: sortProxyModel
274
274
275− delegateWidth: units.gu(8)
275+ delegateWidth: units.gu(10)
276 delegateHeight: units.gu(10)
276 delegateHeight: units.gu(10)
277 delegate: drawerDelegateComponent
277 delegate: drawerDelegateComponent
278 }
278 }
@@ -332,7 +332,7 @@ FocusScope {
332 filterLetter: model.letter
332 filterLetter: model.letter
333 dynamicSortFilter: false
333 dynamicSortFilter: false
334 }
334 }
335− delegateWidth: units.gu(8)
335+ delegateWidth: units.gu(10)
336 delegateHeight: units.gu(10)
336 delegateHeight: units.gu(10)
337 delegate: drawerDelegateComponent
337 delegate: drawerDelegateComponent
338 }
338 }
@@ -352,6 +352,7 @@ FocusScope {
352 readonly property bool focused: index === GridView.view.currentIndex && GridView.view.activeFocus
352 readonly property bool focused: index === GridView.view.currentIndex && GridView.view.activeFocus
353
353
354 onClicked: root.applicationSelected(model.appId)
354 onClicked: root.applicationSelected(model.appId)
355+ z: loader.active ? 1 : 0
355
356
356 Column {
357 Column {
357 width: units.gu(8)
358 width: units.gu(8)
@@ -384,11 +385,46 @@ FocusScope {
384 }
385 }
385
386
386 Label {
387 Label {
388+ id: label
387 text: model.name
389 text: model.name
388 width: parent.width
390 width: parent.width
389 horizontalAlignment: Text.AlignHCenter
391 horizontalAlignment: Text.AlignHCenter
390 fontSize: "small"
392 fontSize: "small"
391 elide: Text.ElideRight
393 elide: Text.ElideRight
394+
395+ Loader {
396+ id: loader
397+ x: {
398+ var aux = 0;
399+ if (item) {
400+ aux = label.width / 2 - item.width / 2;
401+ var containerXMap = mapToItem(contentContainer, aux, 0).x
402+ if (containerXMap < 0) {
403+ aux = aux - containerXMap;
404+ containerXMap = 0;
405+ }
406+ if (containerXMap + item.width > contentContainer.width) {
407+ aux = aux - (containerXMap + item.width - contentContainer.width);
408+ }
409+ }
410+ return aux;
411+ }
412+ y: -units.gu(0.5)
413+ active: label.truncated && drawerDelegate.hovered
414+ sourceComponent: Rectangle {
415+ color: UbuntuColors.jet
416+ width: fullLabel.width + units.gu(1)
417+ height: fullLabel.height + units.gu(1)
418+ border.color: UbuntuColors.blue
419+ radius: units.dp(4)
420+ Label {
421+ id: fullLabel
422+ anchors.centerIn: parent
423+ text: model.name
424+ fontSize: "small"
425+ }
426+ }
427+ }
392 }
428 }
393 }
429 }
394 }
430 }