From 1eb36a74767c0ee661078724a7c4e3c7ff14e251 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Sat, 18 Dec 2021 13:00:18 +0100 Subject: [PATCH] Fix quit popup condition Remove monitor index display for now because of incorrect index from windows --- .../Wizards/Importh264/Importh264Init.qml | 2 +- ScreenPlay/qml/Monitors/MonitorSelection.qml | 4 ++-- .../qml/Monitors/MonitorSelectionItem.qml | 9 +-------- ScreenPlay/qml/Monitors/Monitors.qml | 20 ++++++++++--------- ScreenPlay/qml/Navigation/Navigation.qml | 4 ++-- 5 files changed, 17 insertions(+), 22 deletions(-) diff --git a/ScreenPlay/qml/Create/Wizards/Importh264/Importh264Init.qml b/ScreenPlay/qml/Create/Wizards/Importh264/Importh264Init.qml index 7db08486..a458ba40 100644 --- a/ScreenPlay/qml/Create/Wizards/Importh264/Importh264Init.qml +++ b/ScreenPlay/qml/Create/Wizards/Importh264/Importh264Init.qml @@ -120,7 +120,7 @@ Item { text: qsTr("Open Documentation") Material.background: Material.LightGreen - Material.foreground: "white" + highlighted: true icon.source: "qrc:/assets/icons/icon_document.svg" icon.color: "white" icon.width: 16 diff --git a/ScreenPlay/qml/Monitors/MonitorSelection.qml b/ScreenPlay/qml/Monitors/MonitorSelection.qml index 8c82e595..38c8e65f 100644 --- a/ScreenPlay/qml/Monitors/MonitorSelection.qml +++ b/ScreenPlay/qml/Monitors/MonitorSelection.qml @@ -17,7 +17,7 @@ Rectangle { property alias background: root.color property alias radius: root.radius - signal requestProjectSettings(int index, var installedType, string appID) + signal requestProjectSettings(var index, var installedType, var appID) function selectOnly(index) { for (var i = 0; i < rp.count; i++) { @@ -142,7 +142,7 @@ Rectangle { previewImage: m_previewImage installedType: m_installedType monitorWithoutContentSelectable: root.monitorWithoutContentSelectable - onMonitorSelected: root.selectMonitorAt(delegate.index) + onMonitorSelected: (index) => root.selectMonitorAt(index) } } diff --git a/ScreenPlay/qml/Monitors/MonitorSelectionItem.qml b/ScreenPlay/qml/Monitors/MonitorSelectionItem.qml index 2204dbf2..d7849c09 100644 --- a/ScreenPlay/qml/Monitors/MonitorSelectionItem.qml +++ b/ScreenPlay/qml/Monitors/MonitorSelectionItem.qml @@ -75,13 +75,6 @@ Item { fillMode: Image.PreserveAspectCrop } - Text { - font.pointSize: 14 - text: root.index - anchors.centerIn: parent - color: "white" - } - MouseArea { anchors.fill: parent hoverEnabled: true @@ -89,7 +82,7 @@ Item { onClicked: { if (monitorWithoutContentSelectable) { monitorSelected(index); - return ; + return } if (root.hasContent && !root.monitorWithoutContentSelectable) monitorSelected(index); diff --git a/ScreenPlay/qml/Monitors/Monitors.qml b/ScreenPlay/qml/Monitors/Monitors.qml index e6d6b31c..5f7a3243 100644 --- a/ScreenPlay/qml/Monitors/Monitors.qml +++ b/ScreenPlay/qml/Monitors/Monitors.qml @@ -92,7 +92,9 @@ Popup { } else { videoControlWrapper.state = "hidden"; customPropertiesGridView.visible = true; - ScreenPlay.screenPlayManager.requestProjectSettingsAtMonitorIndex(index); + if(!ScreenPlay.screenPlayManager.requestProjectSettingsAtMonitorIndex(index)){ + console.warn("Unable to get requested settings from index: ", index) + } } activeMonitorIndex = index; } @@ -126,12 +128,11 @@ Popup { Button { id: btnRemoveSelectedWallpaper - - text: qsTr("Remove selected") Material.background: Material.accent - Material.foreground: "white" + highlighted: true + text: qsTr("Remove selected") font.family: ScreenPlay.settings.font - enabled: monitorSelection.activeMonitors.length == 1 + enabled: monitorSelection.activeMonitors.length == 1 && ScreenPlay.screenPlayManager.activeWallpaperCounter > 0 onClicked: { if (!ScreenPlay.screenPlayManager.removeWallpaperAt(monitorSelection.activeMonitors[0])) print("Unable to close singel wallpaper"); @@ -142,9 +143,9 @@ Popup { Button { id: btnRemoveAllWallpape - text: qsTr("Remove ") + ScreenPlay.screenPlayManager.activeWallpaperCounter + " " + qsTr("Wallpapers") + text: qsTr("Remove all ") + ScreenPlay.screenPlayManager.activeWallpaperCounter + " " + qsTr("Wallpapers") Material.background: Material.accent - Material.foreground: "white" + highlighted: true font.family: ScreenPlay.settings.font enabled: ScreenPlay.screenPlayManager.activeWallpaperCounter > 0 onClicked: { @@ -158,9 +159,10 @@ Popup { Button { id: btnRemoveAllWidgets - text: qsTr("Remove ") + ScreenPlay.screenPlayManager.activeWidgetsCounter + " " + qsTr("Widgets") + text: qsTr("Remove all ") + ScreenPlay.screenPlayManager.activeWidgetsCounter + " " + qsTr("Widgets") Material.background: Material.accent - Material.foreground: "white" + Material.foreground: Material.primaryTextColor + highlighted: true font.family: ScreenPlay.settings.font enabled: ScreenPlay.screenPlayManager.activeWidgetsCounter > 0 onClicked: { diff --git a/ScreenPlay/qml/Navigation/Navigation.qml b/ScreenPlay/qml/Navigation/Navigation.qml index 208ab735..c8e1757c 100644 --- a/ScreenPlay/qml/Navigation/Navigation.qml +++ b/ScreenPlay/qml/Navigation/Navigation.qml @@ -249,8 +249,8 @@ Rectangle { icon.width: root.iconWidth icon.height: root.iconHeight onClicked: { - if(ScreenPlay.screenPlayManager.activeWallpaperCounter > 0 - && ScreenPlay.screenPlayManager.activeWidgetsCounter > 0){ + if(ScreenPlay.screenPlayManager.activeWallpaperCounter === 0 + && ScreenPlay.screenPlayManager.activeWidgetsCounter === 0){ Qt.quit() return }