Add fullscreen mode toggleable with F11
This commit is contained in:
parent
b2ea4212fd
commit
c91e1dcdd9
2 changed files with 24 additions and 0 deletions
|
|
@ -28,6 +28,7 @@
|
|||
#include <QMessageBox>
|
||||
#include <QCloseEvent>
|
||||
#include <QStyleFactory>
|
||||
#include <QKeyEvent>
|
||||
#include "OpenRGBFont.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
|
@ -665,6 +666,26 @@ void OpenRGBDialog2::closeEvent(QCloseEvent *event)
|
|||
}
|
||||
}
|
||||
|
||||
void OpenRGBDialog2::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if(event->key() == Qt::Key_F11)
|
||||
{
|
||||
if(isFullScreen())
|
||||
{
|
||||
showNormal();
|
||||
}
|
||||
else
|
||||
{
|
||||
showFullScreen();
|
||||
}
|
||||
event->accept();
|
||||
}
|
||||
else
|
||||
{
|
||||
QMainWindow::keyPressEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
bool OpenRGBDialog2::SelectConfigProfile(const std::string name)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
|
|
|
|||
|
|
@ -84,6 +84,9 @@ public slots:
|
|||
void SetTrayIcon(bool tray_icon);
|
||||
void handleAboutToQuit();
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
|
||||
private:
|
||||
const char* context = "Ui::OpenRGBDialog2";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue