on xenial help sign in
fix hiding of drawer when launcher is locked to visible

make sorting locale aware

commit09ad1caa29db34217b948dc8b47160d507d2162f authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 3 Nov 2016, 16:16 (10 years ago) parent6d1652d
3 files changed+30−5
plugins/Utils/appdrawerproxymodel.cpp+1 qml/Launcher/Drawer.qml+2−2 qml/Launcher/Launcher.qml+27−3
plugins/Utils/appdrawerproxymodel.cpp+1
@@ -6,6 +6,7 @@ AppDrawerProxyModel::AppDrawerProxyModel(QObject *parent):
66 QSortFilterProxyModel(parent)
77{
88 setSortRole(AppDrawerModelInterface::RoleName);
9+ setSortLocaleAware(true);
910
1011 connect(this, &QAbstractListModel::rowsInserted, this, &AppDrawerProxyModel::countChanged);
1112 connect(this, &QAbstractListModel::rowsRemoved, this, &AppDrawerProxyModel::countChanged);
qml/Launcher/Drawer.qml+2−2
@@ -50,10 +50,10 @@ FocusScope {
5050 width: parent.width
5151 actions: [
5252 Action {
53− text: "A-Z"
53+ text: i18n.tr("A-Z")
5454 },
5555 Action {
56− text: "Most used"
56+ text: i18n.tr("Most used")
5757 }
5858 ]
5959
qml/Launcher/Launcher.qml+27−3
@@ -291,12 +291,20 @@ FocusScope {
291291 InverseMouseArea {
292292 id: closeMouseArea
293293 anchors.fill: panel
294− enabled: (root.state == "visible" || root.state == "drawer") && (!root.lockedVisible || panel.highlightIndex >= -1)
294+ enabled: root.state == "visible" || root.state == "drawer"
295295 visible: enabled
296296 onPressed: {
297297 mouse.accepted = false;
298− panel.highlightIndex = -2;
299− root.hide();
298+ if (root.lockedVisible) {
299+ if (root.state == "drawer") {
300+ switchToNextState("visible")
301+ }
302+ } else {
303+ if (root.state == "visible" || root.state == "drawer") {
304+ panel.highlightIndex = -2;
305+ root.hide();
306+ }
307+ }
300308 }
301309 }
302310
@@ -352,6 +360,22 @@ FocusScope {
352360 cached: drawer.moving
353361 }
354362
363+ MouseArea {
364+ anchors.fill: drawer
365+ property int startX: 0
366+ preventStealing: true
367+
368+ onPressed: {
369+ print("**** mouse pressed")
370+ startX = mouseX
371+ }
372+
373+ onMouseXChanged: {
374+ drawer.x += mouseX - startX
375+ startX = mouseX
376+ }
377+ }
378+
355379 Drawer {
356380 id: drawer
357381 anchors {