mirror of
https://github.com/86Box/86Box.git
synced 2026-02-25 12:55:32 -07:00
* Turned the software renderer into a window as well
* Fix inability to move window on GNOME * Fix status bar icons being frozen after icon set switch
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
#include "qt_renderercomon.hpp"
|
||||
#include "qt_mainwindow.hpp"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QWidget>
|
||||
#include <QEvent>
|
||||
#include <QApplication>
|
||||
|
||||
#include <cmath>
|
||||
|
||||
@@ -12,6 +15,7 @@ extern "C" {
|
||||
|
||||
RendererCommon::RendererCommon() = default;
|
||||
|
||||
extern MainWindow* main_window;
|
||||
void RendererCommon::onPaint(QPaintDevice* device) {
|
||||
QPainter painter(device);
|
||||
painter.setRenderHint(QPainter::SmoothPixmapTransform, video_filter_method > 0 ? true : false);
|
||||
@@ -86,3 +90,25 @@ void RendererCommon::onResize(int width, int height) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool RendererCommon::eventDelegate(QEvent *event, bool& result)
|
||||
{
|
||||
switch (event->type())
|
||||
{
|
||||
default:
|
||||
return false;
|
||||
case QEvent::KeyPress:
|
||||
case QEvent::KeyRelease:
|
||||
result = QApplication::sendEvent(main_window, event);
|
||||
return true;
|
||||
case QEvent::MouseButtonPress:
|
||||
case QEvent::MouseMove:
|
||||
case QEvent::MouseButtonRelease:
|
||||
case QEvent::Wheel:
|
||||
case QEvent::Enter:
|
||||
case QEvent::Leave:
|
||||
result = QApplication::sendEvent(parentWidget, event);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user