From e146239305109f31c41d57be613a62690d9184df Mon Sep 17 00:00:00 2001 From: Thomas Perl Date: Sun, 23 Nov 2014 00:00:26 +0100 Subject: [PATCH] UI fixes (play page, dialog placement, text input) --- touch/Dialog.qml | 11 ++++++----- touch/Main.qml | 5 +++-- touch/PTextField.qml | 3 +++ touch/PToolbarButton.qml | 5 +++-- touch/PlayerPage.qml | 3 +++ touch/TextInputDialog.qml | 3 ++- 6 files changed, 20 insertions(+), 10 deletions(-) diff --git a/touch/Dialog.qml b/touch/Dialog.qml index ff25352..3dcaa39 100644 --- a/touch/Dialog.qml +++ b/touch/Dialog.qml @@ -26,6 +26,7 @@ Rectangle { id: page z: 200 property bool activatedFromMenu: false + property bool moveToTop: false property bool attachToToolbar: platform.toolbarOnTop && activatedFromMenu color: Constants.colors.dialogBackground @@ -71,15 +72,15 @@ Rectangle { height: ((page.contentHeight > 0 && page.contentHeight < maxHeight) ? page.contentHeight : maxHeight) * parent.opacity anchors { horizontalCenter: activatedFromMenu ? undefined : parent.horizontalCenter - verticalCenter: activatedFromMenu ? undefined : parent.verticalCenter + verticalCenter: (moveToTop || activatedFromMenu) ? undefined : parent.verticalCenter right: activatedFromMenu ? parent.right : undefined - top: (activatedFromMenu && platform.toolbarOnTop) ? parent.top : undefined - topMargin: (activatedFromMenu && platform.toolbarOnTop) ? pgst.bottomSpacing : 0 + top: (moveToTop || (activatedFromMenu && platform.toolbarOnTop)) ? parent.top : undefined + topMargin: (moveToTop || (activatedFromMenu && platform.toolbarOnTop)) ? pgst.bottomSpacing : 0 - bottom: (activatedFromMenu && !platform.toolbarOnTop) ? parent.bottom : undefined - bottomMargin: (activatedFromMenu && !platform.toolbarOnTop) ? pgst.bottomSpacing : 0 + bottom: (!moveToTop && activatedFromMenu && !platform.toolbarOnTop) ? parent.bottom : undefined + bottomMargin: (!moveToTop && activatedFromMenu && !platform.toolbarOnTop) ? pgst.bottomSpacing : 0 } color: Constants.colors.dialog clip: true diff --git a/touch/Main.qml b/touch/Main.qml index 675d5ef..7a7f665 100644 --- a/touch/Main.qml +++ b/touch/Main.qml @@ -92,6 +92,7 @@ Item { //children[index-1].pushPhase = x / width; } + property bool havePlayer: false property bool loadPageInProgress: false property bool hasBackButton: false property int bottomSpacing: toolbar.showing ? toolbar.height+toolbar.anchors.bottomMargin : 0 @@ -246,7 +247,7 @@ Item { text: 'Now Playing' icon: Icons.play - visible: !platform.floatingPlayButton + visible: !platform.floatingPlayButton && !pgst.havePlayer enabled: player.episode != 0 onClicked: loadPage('PlayerPage.qml'); @@ -298,7 +299,7 @@ Item { Rectangle { z: 190 color: Constants.colors.playback - visible: platform.floatingPlayButton + visible: platform.floatingPlayButton && !pgst.havePlayer Behavior on opacity { NumberAnimation { } } opacity: (player.episode != 0) ? (player.isPlaying ? 1 : .5) : 0 diff --git a/touch/PTextField.qml b/touch/PTextField.qml index a046d39..660d630 100644 --- a/touch/PTextField.qml +++ b/touch/PTextField.qml @@ -50,6 +50,9 @@ Item { right: clipboardIcon.left margins: 5 * pgst.scalef } + + inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText + color: Constants.colors.text selectionColor: Constants.colors.background font.pixelSize: parent.height * 0.7 diff --git a/touch/PToolbarButton.qml b/touch/PToolbarButton.qml index 10f5fe0..1355432 100644 --- a/touch/PToolbarButton.qml +++ b/touch/PToolbarButton.qml @@ -36,11 +36,12 @@ Rectangle { width: iconMenuItem.width height: iconMenuItem.height - color: iconMenuItem.pressed ? (platform.invertedToolbar ? Constants.colors.toolbarArea : Constants.colors.inverted.toolbarArea) : 'transparent' + color: iconMenuItem.pressed ? (platform.invertedToolbar ? Constants.colors.inverted.toolbarArea : Constants.colors.toolbarArea) : 'transparent' Rectangle { + visible: iconMenuItem.pressed && !platform.invertedToolbar height: 5 * pgst.scalef - color: iconMenuItem.pressed ? Constants.colors.secondaryHighlight : 'transparent' + color: Constants.colors.secondaryHighlight anchors { left: parent.left diff --git a/touch/PlayerPage.qml b/touch/PlayerPage.qml index 0dbdcd3..0212e90 100644 --- a/touch/PlayerPage.qml +++ b/touch/PlayerPage.qml @@ -27,6 +27,9 @@ import 'icons/icons.js' as Icons SlidePage { id: page + Component.onCompleted: pgst.havePlayer = true; + Component.onDestruction: pgst.havePlayer = false; + Flickable { id: flickable anchors.fill: parent diff --git a/touch/TextInputDialog.qml b/touch/TextInputDialog.qml index b5eb2b6..737d622 100644 --- a/touch/TextInputDialog.qml +++ b/touch/TextInputDialog.qml @@ -24,6 +24,7 @@ import 'common/constants.js' as Constants Dialog { id: textInputDialog + moveToTop: true property string buttonText property string placeholderText @@ -31,7 +32,7 @@ Dialog { property bool pasteOnLoad: false property var callback - contentHeight: contentColumn.height + contentHeight: contentColumn.height + 20 * pgst.scalef Component.onCompleted: { if (pasteOnLoad) {