From 6e405e08718d8b178830f2e6eeb644a650cfe7ef Mon Sep 17 00:00:00 2001 From: TechnoHector Date: Sun, 31 Mar 2024 18:19:21 -0400 Subject: [PATCH 1/2] Testing modifications on the main window as an evaluation of the possibility of rebuilding the new UI. --- src/suyu/main.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/suyu/main.cpp b/src/suyu/main.cpp index 9a3ee7f662..f178eeed7a 100644 --- a/src/suyu/main.cpp +++ b/src/suyu/main.cpp @@ -77,6 +77,7 @@ #include #include #include +#include #ifdef HAVE_SDL2 #include // For SDL ScreenSaver functions @@ -5115,8 +5116,19 @@ int main(int argc, char* argv[]) { setlocale(LC_ALL, "C"); GMainWindow main_window{std::move(config), has_broken_vulkan}; - // After settings have been loaded by GMainWindow, apply the filter - main_window.show(); + + main_window.setWindowFlags(Qt::FramelessWindowHint); + main_window.show(); // After settings have been loaded by GMainWindow, apply the filter + main_window.resize(800, 600); + + QRect screenGeometry = QApplication::desktop()->availableGeometry(); + + main_window.setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, main_window.size(), screenGeometry)); + main_window.setStyleSheet(QStringLiteral("background-image: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 255, 255, 255), stop:1 rgba(0, 0, 0, 255));")); + + // Temporary: Hide the console to avoid interference. + ShowWindow(GetConsoleWindow(), SW_HIDE); + QObject::connect(&app, &QGuiApplication::applicationStateChanged, &main_window, &GMainWindow::OnAppFocusStateChanged); From 74a299cf71cea513dc67f5b2f7eb21f9fe431615 Mon Sep 17 00:00:00 2001 From: TechnoHector Date: Sun, 31 Mar 2024 21:00:23 -0400 Subject: [PATCH 2/2] Fork commit --- src/suyu/main.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/suyu/main.cpp b/src/suyu/main.cpp index f178eeed7a..e669a5b738 100644 --- a/src/suyu/main.cpp +++ b/src/suyu/main.cpp @@ -5119,19 +5119,20 @@ int main(int argc, char* argv[]) { main_window.setWindowFlags(Qt::FramelessWindowHint); main_window.show(); // After settings have been loaded by GMainWindow, apply the filter - main_window.resize(800, 600); + main_window.resize(1200, 800); // Test size + main_window.setStyleSheet(QStringLiteral("background-color: cyan;" + "border-radius: 10px;")); QRect screenGeometry = QApplication::desktop()->availableGeometry(); - main_window.setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, main_window.size(), screenGeometry)); - main_window.setStyleSheet(QStringLiteral("background-image: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 255, 255, 255), stop:1 rgba(0, 0, 0, 255));")); + main_window.setGeometry(QStyle::alignedRect( + Qt::LeftToRight, Qt::AlignCenter, main_window.size(), screenGeometry)); // Temporary: Hide the console to avoid interference. ShowWindow(GetConsoleWindow(), SW_HIDE); - - QObject::connect(&app, &QGuiApplication::applicationStateChanged, &main_window, - &GMainWindow::OnAppFocusStateChanged); + QObject::connect(&app, &QGuiApplication::applicationStateChanged, + &main_window, &GMainWindow::OnAppFocusStateChanged); int result = app.exec(); detached_tasks.WaitForAllTasks();