From 7b0348449723fc30bc7d3259c61106ff5e1873ff Mon Sep 17 00:00:00 2001
From: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
Date: Tue, 6 Feb 2024 19:08:39 -0500
Subject: [PATCH] misc: fix some frameless window hit-test issues

- Moves the plugin settings close(on GNU/Linux and Windows) to the left to avoid a visual conflict with the system buttons.
- Adds hit testability to BackButton.qml

Note: this commit does not address the style difference in the back buttons thoughout the onboarding pages.
Change-Id: Ia4a2ce2a1228888e3c3101f3472fbe1843b4a522
---
 src/app/commoncomponents/BackButton.qml        |  2 ++
 .../components/PluginPreferencesView.qml       | 18 ++++++------------
 .../settingsview/components/SettingsHeader.qml |  2 +-
 src/app/wizardview/WizardView.qml              |  3 ++-
 4 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/src/app/commoncomponents/BackButton.qml b/src/app/commoncomponents/BackButton.qml
index 781498514..7bfa52eba 100644
--- a/src/app/commoncomponents/BackButton.qml
+++ b/src/app/commoncomponents/BackButton.qml
@@ -42,4 +42,6 @@ PushButton {
             keyEvent.accepted = true;
         }
     }
+
+    QWKSetParentHitTestVisible {}
 }
diff --git a/src/app/settingsview/components/PluginPreferencesView.qml b/src/app/settingsview/components/PluginPreferencesView.qml
index a05719522..3a12546a3 100644
--- a/src/app/settingsview/components/PluginPreferencesView.qml
+++ b/src/app/settingsview/components/PluginPreferencesView.qml
@@ -80,25 +80,19 @@ Item {
                     }
                 }
                 contentItem: ColumnLayout {
-                    width: parent.width
-                    JamiPushButton {
+                    JamiPushButton { QWKSetParentHitTestVisible {}
                         id: closeButton
+                        readonly property bool alignLeft: Qt.platform.os.toString() !== "osx"
                         normalColor: Qt.rgba(124, 124, 124, 0.36)
                         hoveredColor: Qt.rgba(124, 124, 124, 0.75)
-                        Layout.alignment: Qt.AlignRight
+                        Layout.alignment: alignLeft ? Qt.AlignLeft : Qt.AlignRight
+                        Layout.leftMargin: 10
+                        Layout.rightMargin: 30
                         Layout.topMargin: 10
-                        Layout.rightMargin: 35
-                        Layout.preferredWidth: JamiTheme.preferredFieldHeight
-                        Layout.preferredHeight: childrenRect.height
-
                         imageColor: JamiTheme.blackColor
                         toolTipText: JamiStrings.closeSettings
-
-                        preferredSize: 32
                         source: JamiResources.round_close_24dp_svg
-                        onClicked: {
-                            closed();
-                        }
+                        onClicked: closed()
                     }
 
                     ResponsiveImage {
diff --git a/src/app/settingsview/components/SettingsHeader.qml b/src/app/settingsview/components/SettingsHeader.qml
index 9b203db2c..ec686c803 100644
--- a/src/app/settingsview/components/SettingsHeader.qml
+++ b/src/app/settingsview/components/SettingsHeader.qml
@@ -29,7 +29,7 @@ RowLayout {
     signal backArrowClicked
     spacing: 10
 
-    BackButton { QWKSetParentHitTestVisible {}
+    BackButton {
         id: backToSettingsMenuButton
 
         Layout.preferredWidth: JamiTheme.preferredFieldHeight
diff --git a/src/app/wizardview/WizardView.qml b/src/app/wizardview/WizardView.qml
index 995de9919..16c45c008 100644
--- a/src/app/wizardview/WizardView.qml
+++ b/src/app/wizardview/WizardView.qml
@@ -33,7 +33,7 @@ BaseView {
 
     inhibits: ["ConversationView"]
 
-    color: JamiTheme.backgroundColor
+    color: JamiTheme.secondaryBackgroundColor
 
     Connections {
         target: AccountAdapter
@@ -90,6 +90,7 @@ BaseView {
         property ScrollBar vScrollBar: ScrollBar.vertical
 
         anchors.fill: parent
+        anchors.topMargin: appWindow.useFrameless && Qt.platform.os.toString() === "osx" ? 16 : 0
 
         contentHeight: controlPanelStackView.height
         boundsBehavior: Flickable.StopAtBounds
-- 
GitLab