Fix resizable window toggle on Windows
Also include a hex code on process crashes in the VM manager.
This commit is contained in:
@@ -1655,11 +1655,12 @@ MainWindow::focusOutEvent(QFocusEvent *event)
|
||||
void
|
||||
MainWindow::on_actionResizable_window_triggered(bool checked)
|
||||
{
|
||||
hide();
|
||||
if (checked) {
|
||||
vid_resize = 1;
|
||||
setWindowFlag(Qt::WindowMaximizeButtonHint, true);
|
||||
setWindowFlag(Qt::MSWindowsFixedSizeDialogHint, false);
|
||||
setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
|
||||
setWindowFlag(Qt::MSWindowsFixedSizeDialogHint, false);
|
||||
setWindowFlag(Qt::WindowMaximizeButtonHint, true);
|
||||
for (int i = 1; i < MONITORS_NUM; i++) {
|
||||
if (monitors[i].target_buffer) {
|
||||
renderers[i]->setWindowFlag(Qt::WindowMaximizeButtonHint, true);
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <QPixmap>
|
||||
#include <QIcon>
|
||||
#include <QStyleOption>
|
||||
#include <QMainWindow>
|
||||
|
||||
extern "C" {
|
||||
#include <86box/86box.h>
|
||||
@@ -61,8 +62,15 @@ StyleOverride::polish(QWidget *widget)
|
||||
widget->setFixedSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
|
||||
widget->layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||
}
|
||||
if (!qobject_cast<QMainWindow *>(widget)) {
|
||||
widget->setWindowFlag(Qt::MSWindowsFixedSizeDialogHint, true);
|
||||
}
|
||||
|
||||
if (qobject_cast<QMainWindow *>(widget)) {
|
||||
widget->setWindowFlag(Qt::MSWindowsFixedSizeDialogHint, vid_resize != 1);
|
||||
widget->setWindowFlag(Qt::WindowMaximizeButtonHint, vid_resize == 1);
|
||||
}
|
||||
}
|
||||
widget->setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
||||
#ifdef Q_OS_WINDOWS
|
||||
BOOL DarkMode = !util::isWindowsLightTheme();
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
class StyleOverride : public QProxyStyle {
|
||||
public:
|
||||
using QProxyStyle::QProxyStyle;
|
||||
|
||||
int styleHint(
|
||||
StyleHint hint,
|
||||
const QStyleOption *option = nullptr,
|
||||
|
||||
@@ -491,7 +491,7 @@ VMManagerSystem::launchSettings() {
|
||||
if (exitCode != 0 || exitStatus != QProcess::NormalExit) {
|
||||
qInfo().nospace().noquote() << "Abnormal program termination while launching settings: exit code " << exitCode << ", exit status " << exitStatus;
|
||||
QMessageBox::critical(this, tr("Virtual machine crash"),
|
||||
tr("The virtual machine \"%1\"'s process has unexpectedly terminated with exit code %2.").arg(displayName, QString::number(exitCode)));
|
||||
tr("The virtual machine \"%1\"'s process has unexpectedly terminated with exit code %2.").arg(displayName, QString::number(exitCode) + QString(" (0x%1)").arg(QString::number(exitCode, 16))));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user