on xenial help sign in
Fix up Drawer based on code review

* Give signals more descriptive names * Don't return uselessly in onRightMarginChanged * Remove semicolons where they aren't needed

commit6b1cf97ab248c9bcf46449d914fc13c1a146e0e4 authorDalton Durst <dalton@ubports.com> dateTue 28 May 2019, 15:00 (7 years ago) parent45718b8
2 files changed+7−8
qml/Launcher/Drawer.qml+5−6 qml/Launcher/Launcher.qml+2−2
qml/Launcher/Drawer.qml+5−6
@@ -39,11 +39,11 @@ FocusScope {
3939
4040 // Request that the Drawer is opened fully, if it was partially closed then
4141 // brought back
42− signal open();
42+ signal openRequested()
4343
4444 // Request that the Drawer (and maybe its parent) is hidden, normally if
4545 // the Drawer has been dragged away.
46− signal hide();
46+ signal hideRequested()
4747
4848 property bool allowSlidingAnimation: false
4949 property bool draggingHorizontally: false
@@ -59,7 +59,6 @@ FocusScope {
5959 // See onDraggingHorizontallyChanged below
6060 searchField.focus = hadFocus;
6161 searchField.select(oldSelectionStart, oldSelectionEnd);
62− return;
6362 } else if (fullyClosed || fullyOpen) {
6463 searchField.text = "";
6564 resetOldFocus();
@@ -86,15 +85,15 @@ FocusScope {
8685 searchField.focus = false;
8786 } else {
8887 if (x < -units.gu(10)) {
89− hide();
88+ hideRequested();
9089 } else {
91− requestOpen();
90+ openRequested();
9291 }
9392 }
9493 }
9594
9695 Keys.onEscapePressed: {
97− root.hide()
96+ root.hideRequested()
9897 }
9998
10099 onDragDistanceChanged: {
qml/Launcher/Launcher.qml+2−2
@@ -363,11 +363,11 @@ FocusScope {
363363 root.focus = false;
364364 }
365365
366− onHide: {
366+ onHideRequested: {
367367 root.hide();
368368 }
369369
370− onOpen: {
370+ onOpenRequested: {
371371 root.toggleDrawer(false, true);
372372 }
373373 }