Procházet zdrojové kódy

Disable custom titlebar on Mac, Linux, fix resize (#4973)

Signed-off-by: AMZN-alexpete <[email protected]>
Alex Peterson před 3 roky
rodič
revize
c00b99f2d5

+ 1 - 0
Code/Tools/ProjectManager/CMakeLists.txt

@@ -34,6 +34,7 @@ ly_add_target(
     INCLUDE_DIRECTORIES
         PRIVATE
             Source
+            Platform/${PAL_PLATFORM_NAME}
     BUILD_DEPENDENCIES
         PRIVATE
             3rdParty::Qt::Core

+ 2 - 0
Code/Tools/ProjectManager/Platform/Linux/PAL_linux_files.cmake

@@ -11,4 +11,6 @@ set(FILES
     ProjectBuilderWorker_linux.cpp
     ProjectUtils_linux.cpp
     ProjectManagerDefs_linux.cpp
+    ProjectManager_Traits_Platform.h
+    ProjectManager_Traits_Linux.h
 )

+ 11 - 0
Code/Tools/ProjectManager/Platform/Linux/ProjectManager_Traits_Linux.h

@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#pragma once
+
+#define AZ_TRAIT_PROJECT_MANAGER_CUSTOM_TITLEBAR false

+ 11 - 0
Code/Tools/ProjectManager/Platform/Linux/ProjectManager_Traits_Platform.h

@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#pragma once
+
+#include <ProjectManager_Traits_Linux.h>

+ 2 - 0
Code/Tools/ProjectManager/Platform/Mac/PAL_mac_files.cmake

@@ -11,4 +11,6 @@ set(FILES
     ProjectBuilderWorker_mac.cpp
     ProjectUtils_mac.cpp
     ProjectManagerDefs_mac.cpp
+    ProjectManager_Traits_Platform.h
+    ProjectManager_Traits_Mac.h
 )

+ 11 - 0
Code/Tools/ProjectManager/Platform/Mac/ProjectManager_Traits_Mac.h

@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#pragma once
+
+#define AZ_TRAIT_PROJECT_MANAGER_CUSTOM_TITLEBAR false

+ 11 - 0
Code/Tools/ProjectManager/Platform/Mac/ProjectManager_Traits_Platform.h

@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#pragma once
+
+#include <ProjectManager_Traits_Mac.h>

+ 2 - 0
Code/Tools/ProjectManager/Platform/Windows/PAL_windows_files.cmake

@@ -11,4 +11,6 @@ set(FILES
     ProjectBuilderWorker_windows.cpp
     ProjectUtils_windows.cpp
     ProjectManagerDefs_windows.cpp
+    ProjectManager_Traits_Platform.h
+    ProjectManager_Traits_Windows.h
 )

+ 11 - 0
Code/Tools/ProjectManager/Platform/Windows/ProjectManager_Traits_Platform.h

@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#pragma once
+
+#include <ProjectManager_Traits_Windows.h>

+ 11 - 0
Code/Tools/ProjectManager/Platform/Windows/ProjectManager_Traits_Windows.h

@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#pragma once
+
+#define AZ_TRAIT_PROJECT_MANAGER_CUSTOM_TITLEBAR true

+ 6 - 1
Code/Tools/ProjectManager/Source/Application.cpp

@@ -16,6 +16,7 @@
 #include <AzQtComponents/Utilities/HandleDpiAwareness.h>
 #include <AzQtComponents/Components/StyleManager.h>
 #include <AzQtComponents/Components/WindowDecorationWrapper.h>
+#include <ProjectManager_Traits_Platform.h>
 
 #include <QApplication>
 #include <QDir>
@@ -194,8 +195,12 @@ namespace O3DE::ProjectManager
         // set stylesheet after creating the main window or their styles won't get updated
         AzQtComponents::StyleManager::setStyleSheet(m_mainWindow.data(), QStringLiteral("style:ProjectManager.qss"));
 
-        // the decoration wrapper is intended to remember window positioning and sizing 
+        // the decoration wrapper is intended to remember window positioning and sizing
+#if AZ_TRAIT_PROJECT_MANAGER_CUSTOM_TITLEBAR
         auto wrapper = new AzQtComponents::WindowDecorationWrapper();
+#else
+        auto wrapper = new AzQtComponents::WindowDecorationWrapper(AzQtComponents::WindowDecorationWrapper::OptionDisabled);
+#endif
         wrapper->setGuest(m_mainWindow.data());
 
         // show the main window here to apply the stylesheet before restoring geometry or we