qt: Restore Close button on monitor windows

This commit is contained in:
Cacodemon345
2022-07-05 17:57:25 +06:00
parent a809942d4f
commit 85baf0c7fb
3 changed files with 9 additions and 1 deletions

View File

@@ -583,7 +583,7 @@ void MainWindow::initRendererMonitorSlot(int monitor_index)
{
this->renderers[monitor_index]->show();
});
secondaryRenderer->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint);
secondaryRenderer->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
secondaryRenderer->setWindowTitle(QObject::tr("86Box Monitor #") + QString::number(monitor_index + 1));
if (vid_resize == 2) {

View File

@@ -443,3 +443,10 @@ RendererStack::blitCommon(int x, int y, int w, int h)
emit blitToRenderer(currentBuf, sx, sy, sw, sh);
currentBuf = (currentBuf + 1) % imagebufs.size();
}
void RendererStack::closeEvent(QCloseEvent* event)
{
event->ignore();
main_window->close();
}

View File

@@ -31,6 +31,7 @@ public:
void mouseMoveEvent(QMouseEvent *event) override;
void wheelEvent(QWheelEvent *event) override;
void leaveEvent(QEvent *event) override;
void closeEvent(QCloseEvent *event) override;
void keyPressEvent(QKeyEvent *event) override
{
event->ignore();