diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-05-28 01:31:39 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-05-28 01:31:39 +0200 |
commit | 6acde5a8179b0b47c3bfa5b512c48fb7493b25da (patch) | |
tree | 270cbcaaf0afd1012de79af902ed9da0aa974d1c /src/mainwindow/window.cpp | |
parent | Focus view when changing tabs (diff) | |
download | smolbote-6acde5a8179b0b47c3bfa5b512c48fb7493b25da.tar.xz |
Swap to new tab after creating it
Diffstat (limited to 'src/mainwindow/window.cpp')
-rw-r--r-- | src/mainwindow/window.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mainwindow/window.cpp b/src/mainwindow/window.cpp index 0c28663..a5ab90b 100644 --- a/src/mainwindow/window.cpp +++ b/src/mainwindow/window.cpp @@ -51,7 +51,8 @@ Window::Window(const QHash<QString, QString> &config, QWidget *parent, Qt::Windo newTab_button->setToolTip(tr("Add tab")); newTab_button->setShortcut(QKeySequence(config.value("window.shortcuts.new"))); connect(newTab_button, &QToolButton::clicked, this, [=]() { - addTab(WebProfile::defaultProfile()->newtab()); + auto index = addTab(WebProfile::defaultProfile()->newtab()); + tabWidget->setCurrentIndex(index); }); tabWidget->setCornerWidget(newTab_button, Qt::TopRightCorner); |