UI fixes (play page, dialog placement, text input)

This commit is contained in:
Thomas Perl 2014-11-23 00:00:26 +01:00
parent 2ff14cfaa9
commit e146239305
6 changed files with 20 additions and 10 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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) {