mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 22:23:56 +08:00
cabana: press F11 to toggle fullscreen (#27455)
This commit is contained in:
@@ -194,6 +194,8 @@ void MainWindow::createStatusBar() {
|
||||
void MainWindow::createShortcuts() {
|
||||
auto shortcut = new QShortcut(QKeySequence(Qt::Key_Space), this, nullptr, nullptr, Qt::ApplicationShortcut);
|
||||
QObject::connect(shortcut, &QShortcut::activated, []() { can->pause(!can->isPaused()); });
|
||||
shortcut = new QShortcut(QKeySequence(QKeySequence::FullScreen), this, nullptr, nullptr, Qt::ApplicationShortcut);
|
||||
QObject::connect(shortcut, &QShortcut::activated, this, &MainWindow::toggleFullScreen);
|
||||
// TODO: add more shortcuts here.
|
||||
}
|
||||
|
||||
@@ -482,6 +484,19 @@ void MainWindow::onlineHelp() {
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::toggleFullScreen() {
|
||||
if (isFullScreen()) {
|
||||
menuBar()->show();
|
||||
statusBar()->show();
|
||||
showNormal();
|
||||
showMaximized();
|
||||
} else {
|
||||
menuBar()->hide();
|
||||
statusBar()->hide();
|
||||
showFullScreen();
|
||||
}
|
||||
}
|
||||
|
||||
// HelpOverlay
|
||||
HelpOverlay::HelpOverlay(MainWindow *parent) : QWidget(parent) {
|
||||
setAttribute(Qt::WA_NoSystemBackground, true);
|
||||
|
||||
@@ -56,6 +56,7 @@ protected:
|
||||
void undoStackCleanChanged(bool clean);
|
||||
void undoStackIndexChanged(int index);
|
||||
void onlineHelp();
|
||||
void toggleFullScreen();
|
||||
void updateStatus();
|
||||
|
||||
VideoWidget *video_widget = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user