Dialog and menu positioning
This commit is contained in:
parent
b0c7071c56
commit
2ff14cfaa9
6 changed files with 19 additions and 6 deletions
|
@ -30,4 +30,5 @@ Item {
|
|||
property bool invertedToolbar: toolbarOnTop
|
||||
property bool titleInToolbar: toolbarOnTop
|
||||
property bool floatingPlayButton: android
|
||||
property bool hideDisabledMenu: android
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@ import 'common/constants.js' as Constants
|
|||
Rectangle {
|
||||
id: page
|
||||
z: 200
|
||||
property bool activatedFromMenu: false
|
||||
property bool attachToToolbar: platform.toolbarOnTop && activatedFromMenu
|
||||
|
||||
color: Constants.colors.dialogBackground
|
||||
|
||||
|
@ -68,8 +70,16 @@ Rectangle {
|
|||
property int maxHeight: parent.height - toolbar.height
|
||||
height: ((page.contentHeight > 0 && page.contentHeight < maxHeight) ? page.contentHeight : maxHeight) * parent.opacity
|
||||
anchors {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
top: parent.top
|
||||
horizontalCenter: activatedFromMenu ? undefined : parent.horizontalCenter
|
||||
verticalCenter: activatedFromMenu ? undefined : parent.verticalCenter
|
||||
|
||||
right: activatedFromMenu ? parent.right : undefined
|
||||
|
||||
top: (activatedFromMenu && platform.toolbarOnTop) ? parent.top : undefined
|
||||
topMargin: (activatedFromMenu && platform.toolbarOnTop) ? pgst.bottomSpacing : 0
|
||||
|
||||
bottom: (activatedFromMenu && !platform.toolbarOnTop) ? parent.bottom : undefined
|
||||
bottomMargin: (activatedFromMenu && !platform.toolbarOnTop) ? pgst.bottomSpacing : 0
|
||||
}
|
||||
color: Constants.colors.dialog
|
||||
clip: true
|
||||
|
|
|
@ -63,7 +63,7 @@ SlidePage {
|
|||
});
|
||||
},
|
||||
},
|
||||
]);
|
||||
], undefined, undefined, true);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ Item {
|
|||
});
|
||||
}
|
||||
|
||||
function showSelection(items, title, selectedIndex) {
|
||||
function showSelection(items, title, selectedIndex, activatedFromMenu) {
|
||||
loadPage('SelectionDialog.qml', {
|
||||
title: title,
|
||||
callback: function (index, item) {
|
||||
|
@ -143,6 +143,7 @@ Item {
|
|||
return result;
|
||||
}(),
|
||||
selectedIndex: selectedIndex,
|
||||
activatedFromMenu: activatedFromMenu ? activatedFromMenu : false
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -256,6 +257,7 @@ Item {
|
|||
|
||||
text: pgst.menuButtonLabel
|
||||
icon: pgst.menuButtonIcon
|
||||
visible: enabled || !platform.hideDisabledMenu
|
||||
|
||||
enabled: pgst.hasMenuButton
|
||||
onClicked: pgst.children[pgst.children.length-1].menuButtonClicked()
|
||||
|
|
|
@ -69,7 +69,7 @@ SlidePage {
|
|||
});
|
||||
}
|
||||
},
|
||||
]);
|
||||
], undefined, undefined, true);
|
||||
}
|
||||
|
||||
PBusyIndicator {
|
||||
|
|
|
@ -88,7 +88,7 @@ SlidePage {
|
|||
});
|
||||
},
|
||||
},
|
||||
]);
|
||||
], undefined, undefined, true);
|
||||
}
|
||||
|
||||
PListView {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue