Skip to content

Commit

Permalink
F11キーで最大化を切り替えられるようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
soramimi committed Apr 27, 2024
1 parent fe2f6f4 commit a8666a2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,13 @@ void MainWindow::closeEvent(QCloseEvent *event)
QMainWindow::closeEvent(event);
}

void MainWindow::toggleMaximized()
{
auto state = windowState();
state ^= Qt::WindowMaximized;
setWindowState(state);
}

void MainWindow::setStatusBarText(QString const &text)
{
m->status_bar_label->setText(text);
Expand Down Expand Up @@ -5803,6 +5810,10 @@ void MainWindow::keyPressEvent(QKeyEvent *event)
test();
return;
}
if (c == Qt::Key_F11) {
toggleMaximized();
return;
}
if (QApplication::focusWidget() == ui->tableWidget_log && (c == Qt::Key_Return || c == Qt::Key_Enter)) {
Git::CommitItem const *commit = selectedCommitItem(frame());
if (commit) {
Expand Down
1 change: 1 addition & 0 deletions src/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ private slots:
void on_toolButton_addrepo_clicked();

void test();
void toggleMaximized();
protected slots:
void onLogIdle();
signals:
Expand Down

0 comments on commit a8666a2

Please sign in to comment.