aboutsummaryrefslogtreecommitdiffstats
path: root/com.pelagicore.webradio/panels
diff options
context:
space:
mode:
authorAleksei Korkov <akorkov@luxoft.com>2020-03-26 00:27:34 +0300
committerGrigorii Zimin <gzimin@luxoft.com>2020-04-03 13:32:47 +0000
commit58166466b0c916289ccdb21375cd0a04183b52d2 (patch)
treeb60774ecf17a907c32a4c961362e6400ab1e6743 /com.pelagicore.webradio/panels
parent14b5d56d13bb316e58cdcd7ebfb4231bec50791f (diff)
[webradio] Fix popup animations and positions after resizing
Task-number: AUTOSUITE-1476 Change-Id: I179f449afc399e511035ed7e6701b5d0ec912c4e Reviewed-by: Grigorii Zimin <gzimin@luxoft.com>
Diffstat (limited to 'com.pelagicore.webradio/panels')
-rw-r--r--com.pelagicore.webradio/panels/SelectionScreen.qml42
1 files changed, 28 insertions, 14 deletions
diff --git a/com.pelagicore.webradio/panels/SelectionScreen.qml b/com.pelagicore.webradio/panels/SelectionScreen.qml
index 48dcc7a..aaacd36 100644
--- a/com.pelagicore.webradio/panels/SelectionScreen.qml
+++ b/com.pelagicore.webradio/panels/SelectionScreen.qml
@@ -76,16 +76,40 @@ Item {
var pos = currentItem.mapToItem(root.rootItem
, currentItem.width/2, currentItem.height/2);
+ let posX = pos.x / root.Sizes.scale;
+ let posY = pos.y / root.Sizes.scale;
+
+ // caclulate popup height based on musicSources list items
+ // + 200 for header & margins
+ musicSourcesPopup.height = Qt.binding(() => {
+ return musicSourcesPopup.model
+ ? root.Sizes.dp(200 + (musicSourcesPopup.model.count * 96))
+ : root.Sizes.dp(296);
+ });
+ musicSourcesPopup.width = Qt.binding(() => root.Sizes.dp(910))
+
//set model each time to ensure data accuracy
musicSourcesPopup.model = root.store.musicSourcesModel
- musicSourcesPopup.originItemX = pos.x;
- musicSourcesPopup.originItemY = pos.y;
+ musicSourcesPopup.originItemX = Qt.binding(() => root.Sizes.dp(posX));
+ musicSourcesPopup.originItemY = Qt.binding(() => root.Sizes.dp(posY));
+ musicSourcesPopup.popupY = Qt.binding(() => {
+ return root.Sizes.dp(Config.centerConsoleHeight / 4);
+ });
musicSourcesPopup.visible = true;
} else if (currentText === "ABOUT...") {
pos = currentItem.mapToItem(root.rootItem
, currentItem.width/2, currentItem.height/2);
- aboutPopup.originItemX = pos.x;
- aboutPopup.originItemY = pos.y;
+
+ let posX = pos.x / root.Sizes.scale;
+ let posY = pos.y / root.Sizes.scale;
+
+ aboutPopup.width = Qt.binding(() => root.Sizes.dp(910))
+ aboutPopup.height = Qt.binding(() => root.Sizes.dp(450))
+ aboutPopup.originItemX = Qt.binding(() => root.Sizes.dp(posX));
+ aboutPopup.originItemY = Qt.binding(() => root.Sizes.dp(posY));
+ aboutPopup.popupY = Qt.binding(() => {
+ return root.Sizes.dp(Config.centerConsoleHeight / 4);
+ });
aboutPopup.visible = true;
}
@@ -95,11 +119,6 @@ Item {
MusicSourcesPopup {
id: musicSourcesPopup
- width: root.Sizes.dp(910)
- // caclulate popup height based on musicSources list items
- // + 200 for header & margins
- height: model ? root.Sizes.dp(200 + (model.count * 96)) : root.Sizes.dp(296)
- popupY: root.Sizes.dp(Config.centerConsoleHeight / 4)
onSwitchSourceClicked: {
store.switchSource(source)
}
@@ -107,11 +126,6 @@ Item {
AboutPopup {
id: aboutPopup
- width: root.Sizes.dp(910)
- // caclulate popup height based on musicSources list items
- // + 200 for header & margins
- height: root.Sizes.dp(450)
- popupY: root.Sizes.dp(Config.centerConsoleHeight / 4)
}
GridView {