Option to hide mouse on inactivity (#5094)

* Add and implement option to hide mouse on iniactivity
+ clang format

* Set mouse hide timeout as a constant

* Address review comments, decrease mouse inactivity timeout to 2500ms

* Hide mouse: fix menubar bugs

squashable

* Hide mouse: ensure status bar has the default pointer
This commit is contained in:
Vitor K 2020-04-07 11:58:51 -03:00 committed by GitHub
parent d37b0476ad
commit 23921e3203
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 77 additions and 0 deletions

View file

@ -199,6 +199,8 @@ GRenderWindow::GRenderWindow(QWidget* parent_, EmuThread* emu_thread)
setLayout(layout);
InputCommon::Init();
this->setMouseTracking(true);
GMainWindow* parent = GetMainWindow();
connect(this, &GRenderWindow::FirstFrameDisplayed, parent, &GMainWindow::OnLoadComplete);
}
@ -295,6 +297,7 @@ void GRenderWindow::mousePressEvent(QMouseEvent* event) {
} else if (event->button() == Qt::RightButton) {
InputCommon::GetMotionEmu()->BeginTilt(pos.x(), pos.y());
}
QWidget::mouseMoveEvent(event);
}
void GRenderWindow::mouseMoveEvent(QMouseEvent* event) {
@ -305,6 +308,7 @@ void GRenderWindow::mouseMoveEvent(QMouseEvent* event) {
const auto [x, y] = ScaleTouch(pos);
this->TouchMoved(x, y);
InputCommon::GetMotionEmu()->Tilt(pos.x(), pos.y());
QWidget::mouseMoveEvent(event);
}
void GRenderWindow::mouseReleaseEvent(QMouseEvent* event) {