Skip to content

Commit

Permalink
feat(ui): add shortcut (Ctrl+B) to toggle sidebar visibility
Browse files Browse the repository at this point in the history
Fixes #1652.
  • Loading branch information
trollixx committed Sep 2, 2024
1 parent 92fa74f commit a4fc8c1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/libs/ui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,19 @@ MainWindow::MainWindow(Core::Application *app, QWidget *parent)
shortcut = new QShortcut(QStringLiteral("Ctrl+Alt+T"), this);
connect(shortcut, &QShortcut::activated, this, [this]() { duplicateTab(m_tabBar->currentIndex()); });

// Hide/show sidebar.
// TODO: Move to the View menu.
shortcut = new QShortcut(QStringLiteral("Ctrl+B"), this);
connect(shortcut, &QShortcut::activated, this, [this]() {
auto sb = ui->splitter->widget(0);
if (sb == nullptr) {
// This should not really happen.
return;
}

sb->setVisible(!sb->isVisible());
});

restoreGeometry(m_settings->windowGeometry);

// Menu
Expand Down

0 comments on commit a4fc8c1

Please sign in to comment.