Add fullscreen mode toggleable with F11

This commit is contained in:
RedBlackAka 2025-01-05 22:48:31 +00:00 committed by Adam Honse
parent b2ea4212fd
commit c91e1dcdd9
2 changed files with 24 additions and 0 deletions

View file

@ -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)
{
/*-----------------------------------------------------*\

View file

@ -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";