mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
DolphinQt2: FocusEventFilter -> WindowActivationEventFilter
This commit is contained in:
@ -1,19 +0,0 @@
|
||||
// Copyright 2017 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <QEvent>
|
||||
#include <QObject>
|
||||
|
||||
#include "DolphinQt2/QtUtils/FocusEventFilter.h"
|
||||
|
||||
bool FocusEventFilter::eventFilter(QObject* object, QEvent* event)
|
||||
{
|
||||
if (event->type() == QEvent::FocusOut)
|
||||
emit focusOutEvent();
|
||||
|
||||
if (event->type() == QEvent::FocusIn)
|
||||
emit focusInEvent();
|
||||
|
||||
return false;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
// Copyright 2017 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <QEvent>
|
||||
#include <QObject>
|
||||
|
||||
#include "DolphinQt2/QtUtils/WindowActivationEventFilter.h"
|
||||
|
||||
bool WindowActivationEventFilter::eventFilter(QObject* object, QEvent* event)
|
||||
{
|
||||
if (event->type() == QEvent::WindowDeactivate)
|
||||
emit windowDeactivated();
|
||||
|
||||
if (event->type() == QEvent::WindowActivate)
|
||||
emit windowActivated();
|
||||
|
||||
return false;
|
||||
}
|
@ -6,12 +6,12 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class FocusEventFilter : public QObject
|
||||
class WindowActivationEventFilter : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
signals:
|
||||
void focusInEvent();
|
||||
void focusOutEvent();
|
||||
void windowActivated();
|
||||
void windowDeactivated();
|
||||
|
||||
private:
|
||||
bool eventFilter(QObject* object, QEvent* event) override;
|
Reference in New Issue
Block a user