mirror of https://github.com/mgba-emu/mgba.git
Qt: More cleanup
This commit is contained in:
parent
1929047896
commit
50005e0703
|
@ -26,6 +26,7 @@ LoadSaveState::LoadSaveState(GameController* controller, QWidget* parent)
|
||||||
, m_currentFocus(controller->stateSlot() - 1)
|
, m_currentFocus(controller->stateSlot() - 1)
|
||||||
, m_mode(LoadSave::LOAD)
|
, m_mode(LoadSave::LOAD)
|
||||||
{
|
{
|
||||||
|
setAttribute(Qt::WA_TranslucentBackground);
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
|
|
||||||
m_slots[0] = m_ui.state1;
|
m_slots[0] = m_ui.state1;
|
||||||
|
@ -208,6 +209,5 @@ void LoadSaveState::showEvent(QShowEvent* event) {
|
||||||
void LoadSaveState::paintEvent(QPaintEvent*) {
|
void LoadSaveState::paintEvent(QPaintEvent*) {
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
QRect full(QPoint(), size());
|
QRect full(QPoint(), size());
|
||||||
painter.drawPixmap(full, m_currentImage);
|
|
||||||
painter.fillRect(full, QColor(0, 0, 0, 128));
|
painter.fillRect(full, QColor(0, 0, 0, 128));
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ using namespace QGBA;
|
||||||
SavestateButton::SavestateButton(QWidget* parent)
|
SavestateButton::SavestateButton(QWidget* parent)
|
||||||
: QAbstractButton(parent)
|
: QAbstractButton(parent)
|
||||||
{
|
{
|
||||||
// Nothing to do
|
setAttribute(Qt::WA_TranslucentBackground);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SavestateButton::paintEvent(QPaintEvent*) {
|
void SavestateButton::paintEvent(QPaintEvent*) {
|
||||||
|
|
|
@ -685,7 +685,7 @@ void Window::openStateWindow(LoadSave ls) {
|
||||||
connect(this, SIGNAL(shutdown()), m_stateWindow, SLOT(close()));
|
connect(this, SIGNAL(shutdown()), m_stateWindow, SLOT(close()));
|
||||||
connect(m_controller, SIGNAL(gameStopped(GBAThread*)), m_stateWindow, SLOT(close()));
|
connect(m_controller, SIGNAL(gameStopped(GBAThread*)), m_stateWindow, SLOT(close()));
|
||||||
connect(m_stateWindow, &LoadSaveState::closed, [this]() {
|
connect(m_stateWindow, &LoadSaveState::closed, [this]() {
|
||||||
m_screenWidget->layout()->removeWidget(m_stateWindow);
|
detachWidget(m_stateWindow);
|
||||||
m_stateWindow = nullptr;
|
m_stateWindow = nullptr;
|
||||||
QMetaObject::invokeMethod(this, "setFocus", Qt::QueuedConnection);
|
QMetaObject::invokeMethod(this, "setFocus", Qt::QueuedConnection);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue