Qt/Windows: Don't use new windows11 style with Qt 6.7.

It has some glitches.
This commit is contained in:
BearOso 2024-04-15 15:51:41 -05:00
parent 9d22dbb8d8
commit 31db46516d
2 changed files with 12 additions and 13 deletions

View File

@ -11,7 +11,7 @@
</rect> </rect>
</property> </property>
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::NoFocus</enum> <enum>Qt::FocusPolicy::NoFocus</enum>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Settings</string> <string>Settings</string>
@ -28,10 +28,10 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="sizeAdjustPolicy"> <property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustToContents</enum> <enum>QAbstractScrollArea::SizeAdjustPolicy::AdjustToContents</enum>
</property> </property>
<property name="resizeMode"> <property name="resizeMode">
<enum>QListView::Fixed</enum> <enum>QListView::ResizeMode::Fixed</enum>
</property> </property>
<item> <item>
<property name="text"> <property name="text">
@ -115,7 +115,7 @@
<item> <item>
<widget class="QPushButton" name="defaultsButton"> <widget class="QPushButton" name="defaultsButton">
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::TabFocus</enum> <enum>Qt::FocusPolicy::TabFocus</enum>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Restore all settings on the current page to their default values.</string> <string>Restore all settings on the current page to their default values.</string>
@ -126,10 +126,6 @@
<property name="text"> <property name="text">
<string>Restore Defaults</string> <string>Restore Defaults</string>
</property> </property>
<property name="icon">
<iconset theme="view-refresh">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="autoDefault"> <property name="autoDefault">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -151,7 +147,7 @@
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Orientation::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -166,10 +162,6 @@
<property name="text"> <property name="text">
<string>Close</string> <string>Close</string>
</property> </property>
<property name="icon">
<iconset theme="window-close">
<normaloff>.</normaloff>.</iconset>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>

View File

@ -5,6 +5,7 @@
#include <clocale> #include <clocale>
#include <qnamespace.h> #include <qnamespace.h>
#include <QStyle>
#ifndef _WIN32 #ifndef _WIN32
#include <csignal> #include <csignal>
@ -25,6 +26,12 @@ int main(int argc, char *argv[])
QGuiApplication::setDesktopFileName("snes9x-gtk"); QGuiApplication::setDesktopFileName("snes9x-gtk");
if (emu.qtapp->platformName() == "windows")
{
if (emu.qtapp->style()->name() == "windows11")
emu.qtapp->setStyle("windowsvista");
}
#ifndef _WIN32 #ifndef _WIN32
auto quit_handler = [](int) { QApplication::quit(); }; auto quit_handler = [](int) { QApplication::quit(); };
for (auto s : { SIGQUIT, SIGINT, SIGTERM, SIGHUP }) for (auto s : { SIGQUIT, SIGINT, SIGTERM, SIGHUP })