From 5cf6565df83a2d9711ad8f4e7794ffdff6736ab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Blin?= <sebastien.blin@savoirfairelinux.com> Date: Tue, 7 Dec 2021 15:34:56 -0500 Subject: [PATCH] SelectScreen: label should always be at the same place Change-Id: Ic3ac47d20e21c31a37fe0c69e5ad5ac9ba2f2575 GitLab: #611 --- src/mainview/components/SelectScreen.qml | 86 ++++++++++++------------ 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/src/mainview/components/SelectScreen.qml b/src/mainview/components/SelectScreen.qml index 2e4b26273..e4902d2bc 100644 --- a/src/mainview/components/SelectScreen.qml +++ b/src/mainview/components/SelectScreen.qml @@ -140,10 +140,24 @@ Window { border.color: selectedScreenNumber === index ? JamiTheme.screenSelectionBorderColor : JamiTheme.tabbarBorderColor visible: JamiStrings.selectScreen !== screens[index] && index < Qt.application.screens.length + Text { + id: screenName + + anchors.top: screenItem.top + anchors.topMargin: 10 + anchors.horizontalCenter: screenItem.horizontalCenter + width: parent.width + font.pointSize: JamiTheme.textFontSize + text: screens[index] ? screens[index] : "" + elide: Text.ElideMiddle + horizontalAlignment: Text.AlignHCenter + color: JamiTheme.textColor + } + PreviewRenderer { id: screenPreview - anchors.top: screenItem.top + anchors.top: screenName.bottom anchors.topMargin: 10 anchors.horizontalCenter: screenItem.horizontalCenter height: screenItem.height - 50 @@ -164,20 +178,6 @@ Window { } } - Text { - id: screenName - - anchors.top: screenPreview.bottom - anchors.topMargin: 10 - anchors.horizontalCenter: screenItem.horizontalCenter - width: parent.width - font.pointSize: JamiTheme.textFontSize - text: screens[index] ? screens[index] : "" - elide: Text.ElideMiddle - horizontalAlignment: Text.AlignHCenter - color: JamiTheme.textColor - } - MouseArea { anchors.fill: screenItem acceptedButtons: Qt.LeftButton @@ -215,10 +215,22 @@ Window { visible: Qt.application.screens.length > 1 + Text { + id: screenNameAll + + anchors.top: screenSelectionRectAll.top + anchors.topMargin: 10 + anchors.horizontalCenter: screenSelectionRectAll.horizontalCenter + + font.pointSize: JamiTheme.textFontSize + text: JamiStrings.allScreens + color: JamiTheme.textColor + } + PreviewRenderer { id: screenShotAll - anchors.top: screenSelectionRectAll.top + anchors.top: screenNameAll.bottom anchors.topMargin: 10 anchors.horizontalCenter: screenSelectionRectAll.horizontalCenter height: screenSelectionRectAll.height - 50 @@ -239,18 +251,6 @@ Window { } } - Text { - id: screenNameAll - - anchors.top: screenShotAll.bottom - anchors.topMargin: 10 - anchors.horizontalCenter: screenSelectionRectAll.horizontalCenter - - font.pointSize: JamiTheme.textFontSize - text: JamiStrings.allScreens - color: JamiTheme.textColor - } - MouseArea { anchors.fill: parent acceptedButtons: Qt.LeftButton @@ -291,10 +291,24 @@ Window { border.color: selectedScreenNumber === index ? JamiTheme.screenSelectionBorderColor : JamiTheme.tabbarBorderColor visible: JamiStrings.selectScreen !== screens[index] && index >= Qt.application.screens.length + Text { + id: screenName2 + + anchors.top: screenItem2.top + anchors.topMargin: 10 + anchors.horizontalCenter: screenItem2.horizontalCenter + width: parent.width + font.pointSize: JamiTheme.textFontSize + text: screens[index] ? screens[index] : "" + elide: Text.ElideMiddle + horizontalAlignment: Text.AlignHCenter + color: JamiTheme.textColor + } + PreviewRenderer { id: screenPreview2 - anchors.top: screenItem2.top + anchors.top: screenName2.bottom anchors.topMargin: 10 anchors.horizontalCenter: screenItem2.horizontalCenter anchors.leftMargin: 25 @@ -317,20 +331,6 @@ Window { } } - Text { - id: screenName2 - - anchors.top: screenPreview2.bottom - anchors.topMargin: 10 - anchors.horizontalCenter: screenItem2.horizontalCenter - width: parent.width - font.pointSize: JamiTheme.textFontSize - text: screens[index] ? screens[index] : "" - elide: Text.ElideMiddle - horizontalAlignment: Text.AlignHCenter - color: JamiTheme.textColor - } - MouseArea { anchors.fill: screenItem2 acceptedButtons: Qt.LeftButton -- GitLab