aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/configuration/configuration.cpp15
-rw-r--r--linux/man/smolbote.787
-rw-r--r--linux/man/smolbote.7.html71
-rw-r--r--linux/man/smolbote.7.ronn65
-rw-r--r--src/mainwindow/mainwindow.cpp10
-rw-r--r--src/mainwindow/mainwindow.h1
-rw-r--r--src/mainwindow/widgets/tabwidget.cpp22
-rw-r--r--src/mainwindow/widgets/tabwidget.h4
-rw-r--r--src/mainwindow/window.cpp37
-rw-r--r--src/mainwindow/window.h2
10 files changed, 164 insertions, 150 deletions
diff --git a/lib/configuration/configuration.cpp b/lib/configuration/configuration.cpp
index fdcb5b5..edca0d8 100644
--- a/lib/configuration/configuration.cpp
+++ b/lib/configuration/configuration.cpp
@@ -27,7 +27,6 @@ Configuration::Configuration()
("mainwindow.title", po::value<std::string>()->default_value("smolbote"))
// main window shortcuts
- ("mainwindow.shortcuts.newTab", po::value<std::string>()->default_value("Ctrl+T"))
("mainwindow.shortcuts.newGroup", po::value<std::string>()->default_value("Ctrl+G"))
("mainwindow.shortcuts.newWindow", po::value<std::string>()->default_value("Ctrl+N"))
@@ -50,14 +49,12 @@ Configuration::Configuration()
("addressbar.shortcuts.pageMenu", po::value<std::string>()->default_value("F2"))
("addressbar.shortcuts.toolsMenu", po::value<std::string>()->default_value("F10"))
- // tab bar
- ("tabbar.shortcuts.new", po::value<std::string>()->default_value("Ctrl+T"))
- ("tabbar.shortcuts.close", po::value<std::string>()->default_value("Ctrl+X"))
- ("tabbar.shortcuts.left", po::value<std::string>()->default_value("Ctrl+O"))
- ("tabbar.shortcuts.right", po::value<std::string>()->default_value("Ctrl+P"))
-
- // page
- ("browser.shortcuts.fullscreen", po::value<std::string>()->default_value("F11"))
+ // window
+ ("window.shortcuts.new", po::value<std::string>()->default_value("Ctrl+T"))
+ ("window.shortcuts.close", po::value<std::string>()->default_value("Ctrl+X"))
+ ("window.shortcuts.left", po::value<std::string>()->default_value("Ctrl+O"))
+ ("window.shortcuts.right", po::value<std::string>()->default_value("Ctrl+P"))
+ ("window.shortcuts.fullscreen", po::value<std::string>()->default_value("F11"))
// Filter settings
("filter.path", po::value<std::string>()->default_value("~/.config/smolbote/hosts.d"))
diff --git a/linux/man/smolbote.7 b/linux/man/smolbote.7
index f13f1c0..bd865e9 100644
--- a/linux/man/smolbote.7
+++ b/linux/man/smolbote.7
@@ -53,119 +53,124 @@ The Configuration is loaded from \fI~/\.config/smolbote/smolbote\.cfg\fR, and ca
.P
Settings are only loaded on launch, so re\-run the browser to apply changes\.
.
-.IP "\(bu" 4
-browser\.profile: Profile to be used by default, "" is off\-the\-record
+.SS "Main Window"
.
-.IP "" 0
+.IP "\(bu" 4
+mainwindow\.height: 720
.
-.SS "Default window size"
+.IP "\(bu" 4
+mainwindow\.width: 1280
.
.IP "\(bu" 4
-browser\.window\.height: 720
+mainwindow\.maximized: true
.
.IP "\(bu" 4
-browser\.window\.width: 1280
+mainwindow\.title: smolbote
.
.IP "\(bu" 4
-browser\.window\.maximized: true
+mainwindow\.shortcuts\.newGroup: Ctrl+G
.
.IP "\(bu" 4
-browser\.window\.title: title — smolbote [profile]
+mainwindow\.shortcuts\.newWindow: Ctrl+N (todo)
.
-.IP "" 0
+.IP "\(bu" 4
+mainwindow\.shortcuts\.about: F1
.
-.SS "Window UI"
+.IP "\(bu" 4
+mainwindow\.shortcuts\.quit: Ctrl+Q
.
.IP "\(bu" 4
-browser\.ui\.navtoolbarMovable: false
+mainwindow\.shortcuts\.search: F3
.
.IP "\(bu" 4
-browser\.ui\.tabtoolbarMovable: false
+mainwindow\.shortcuts\.tileWindows: F9
.
.IP "" 0
.
-.SS "Shortcuts"
+.SS "Navigation bar"
.
.IP "\(bu" 4
-browser\.shortcuts\.newWindow: Ctrl+N
+navigation\.movable: false
.
.IP "\(bu" 4
-browser\.shortcuts\.about: F1
+navigation\.shortcuts\.back: Ctrl+Left
.
.IP "\(bu" 4
-browser\.shortcuts\.quit: Ctrl+Q
+navigation\.shortcuts\.forward: Ctrl+Right
.
.IP "\(bu" 4
-browser\.shortcuts\.back: Ctrl+Left
+navigation\.shortcuts\.refresh: F5
.
.IP "\(bu" 4
-browser\.shortcuts\.forward: Ctrl+Right
+navigation\.shortcuts\.home: Ctrl+Home
.
-.IP "\(bu" 4
-browser\.shortcuts\.refresh: F5
+.IP "" 0
.
-.IP "\(bu" 4
-browser\.shortcuts\.reload: Ctrl+F5
+.SS "Address bar"
.
.IP "\(bu" 4
-browser\.shortcuts\.home: Ctrl+Home
+addressbar\.shortcuts\.focus: F4
.
.IP "\(bu" 4
-browser\.shortcuts\.toggleSearchBox: F3
+addressbar\.shortcuts\.pageMenu: F2
.
.IP "\(bu" 4
-browser\.shortcuts\.fullscreen: F11
+addressbar\.shortcuts\.toolsMenu: F10
.
-.IP "\(bu" 4
-addressbar\.shortcuts\.focus: F4
+.IP "" 0
.
-.IP "\(bu" 4
-addressbar\.shortcuts\.pageMenu: F2
+.SS "Window"
.
.IP "\(bu" 4
-addressbar\.shortcuts\.toolsMenu: F10
+window\.shortcuts\.new: Ctrl+T
.
.IP "\(bu" 4
-tabbar\.shortcuts\.new: Ctrl+T
+window\.shortcuts\.close: Ctrl+X
.
.IP "\(bu" 4
-tabbar\.shortcuts\.close: Ctrl+X
+window\.shortcuts\.left: Ctrl+O
.
.IP "\(bu" 4
-tabbar\.shortcuts\.left: Ctrl+O
+window\.shortcuts\.right: Ctrl+P
.
.IP "\(bu" 4
-tabbar\.shortcuts\.right: Ctrl+P
+window\.shortcuts\.fullscreen: F11 (todo)
.
.IP "" 0
.
-.SS "Filter settings"
+.SS "Filter"
.
.IP "\(bu" 4
filter\.path: ~/\.config/smolbote/hosts\.d
.
.IP "\(bu" 4
-filter\.cookies\.block\.all: false
+filter\.cookies\.block\.all: false (todo: in qt5\.11)
.
.IP "\(bu" 4
filter\.cookies\.block\.thirdParty: true
.
+.IP "\(bu" 4
+filter\.cookies\.path: ~/\.config/smolbote/cookies\.d
+.
.IP "" 0
.
-.SS "Plugin settings"
+.SS "Plugins (to\-redo)"
.
.IP "\(bu" 4
plugins\.path: ~/\.config/smolbote/plugins\.d
.
.IP "" 0
.
-.SS "Profile settings"
+.SS "Profiles"
+.
+.IP "\(bu" 4
+profile\.default: \'\'
.
.IP "\(bu" 4
profile\.path: ~/\.config/smolbote/profiles\.d
.
.IP "\(bu" 4
-profile\.search: https://duckduckgo\.com/?q=$term&ia=web
+profile\.search: https://duckduckgo\.com/?q=%1&ia=web
.
.IP "\(bu" 4
profile\.homepage: about:blank
@@ -175,7 +180,7 @@ profile\.newtab: about:blank
.
.IP "" 0
.
-.SS "Bookmark settings"
+.SS "Bookmarks"
.
.IP "\(bu" 4
bookmarks\.path: ~/\.config/smolbote/bookmarks\.xbel
@@ -185,7 +190,7 @@ bookmarks\.shortcut: Ctrl+B
.
.IP "" 0
.
-.SS "Downloads settings"
+.SS "Downloads"
.
.IP "\(bu" 4
downloads\.path: ~/Downloads
diff --git a/linux/man/smolbote.7.html b/linux/man/smolbote.7.html
index 1d967b1..a7c99f8 100644
--- a/linux/man/smolbote.7.html
+++ b/linux/man/smolbote.7.html
@@ -113,79 +113,82 @@ edited with the <code>poi-config</code> tool.</p>
<p>Settings are only loaded on launch, so re-run the browser to apply changes.</p>
+<h3 id="Main-Window">Main Window</h3>
+
<ul>
-<li>browser.profile: Profile to be used by default, "" is off-the-record</li>
+<li>mainwindow.height: 720</li>
+<li>mainwindow.width: 1280</li>
+<li>mainwindow.maximized: true</li>
+<li><p>mainwindow.title: smolbote</p></li>
+<li><p>mainwindow.shortcuts.newGroup: Ctrl+G</p></li>
+<li><p>mainwindow.shortcuts.newWindow: Ctrl+N (todo)</p></li>
+<li><p>mainwindow.shortcuts.about: F1</p></li>
+<li><p>mainwindow.shortcuts.quit: Ctrl+Q</p></li>
+<li><p>mainwindow.shortcuts.search: F3</p></li>
+<li>mainwindow.shortcuts.tileWindows: F9</li>
</ul>
-<h3 id="Default-window-size">Default window size</h3>
+<h3 id="Navigation-bar">Navigation bar</h3>
<ul>
-<li>browser.window.height: 720</li>
-<li>browser.window.width: 1280</li>
-<li>browser.window.maximized: true</li>
-<li>browser.window.title: title — smolbote [profile]</li>
+<li>navigation.movable: false</li>
+<li>navigation.shortcuts.back: Ctrl+Left</li>
+<li>navigation.shortcuts.forward: Ctrl+Right</li>
+<li>navigation.shortcuts.refresh: F5</li>
+<li>navigation.shortcuts.home: Ctrl+Home</li>
</ul>
-<h3 id="Window-UI">Window UI</h3>
+<h3 id="Address-bar">Address bar</h3>
<ul>
-<li>browser.ui.navtoolbarMovable: false</li>
-<li>browser.ui.tabtoolbarMovable: false</li>
+<li>addressbar.shortcuts.focus: F4</li>
+<li>addressbar.shortcuts.pageMenu: F2</li>
+<li>addressbar.shortcuts.toolsMenu: F10</li>
</ul>
-<h3 id="Shortcuts">Shortcuts</h3>
+<h3 id="Window">Window</h3>
<ul>
-<li>browser.shortcuts.newWindow: Ctrl+N</li>
-<li>browser.shortcuts.about: F1</li>
-<li><p>browser.shortcuts.quit: Ctrl+Q</p></li>
-<li><p>browser.shortcuts.back: Ctrl+Left</p></li>
-<li>browser.shortcuts.forward: Ctrl+Right</li>
-<li>browser.shortcuts.refresh: F5</li>
-<li>browser.shortcuts.reload: Ctrl+F5</li>
-<li><p>browser.shortcuts.home: Ctrl+Home</p></li>
-<li><p>browser.shortcuts.toggleSearchBox: F3</p></li>
-<li><p>browser.shortcuts.fullscreen: F11</p></li>
-<li><p>addressbar.shortcuts.focus: F4</p></li>
-<li>addressbar.shortcuts.pageMenu: F2</li>
-<li><p>addressbar.shortcuts.toolsMenu: F10</p></li>
-<li><p>tabbar.shortcuts.new: Ctrl+T</p></li>
-<li>tabbar.shortcuts.close: Ctrl+X</li>
-<li>tabbar.shortcuts.left: Ctrl+O</li>
-<li>tabbar.shortcuts.right: Ctrl+P</li>
+<li>window.shortcuts.new: Ctrl+T</li>
+<li>window.shortcuts.close: Ctrl+X</li>
+<li>window.shortcuts.left: Ctrl+O</li>
+<li>window.shortcuts.right: Ctrl+P</li>
+<li>window.shortcuts.fullscreen: F11 (todo)</li>
</ul>
-<h3 id="Filter-settings">Filter settings</h3>
+<h3 id="Filter">Filter</h3>
<ul>
<li>filter.path: ~/.config/smolbote/hosts.d</li>
-<li>filter.cookies.block.all: false</li>
+<li>filter.cookies.block.all: false (todo: in qt5.11)</li>
<li>filter.cookies.block.thirdParty: true</li>
+<li>filter.cookies.path: ~/.config/smolbote/cookies.d</li>
</ul>
-<h3 id="Plugin-settings">Plugin settings</h3>
+<h3 id="Plugins-to-redo-">Plugins (to-redo)</h3>
<ul>
<li>plugins.path: ~/.config/smolbote/plugins.d</li>
</ul>
-<h3 id="Profile-settings">Profile settings</h3>
+<h3 id="Profiles">Profiles</h3>
<ul>
+<li>profile.default: ''</li>
<li>profile.path: ~/.config/smolbote/profiles.d</li>
-<li>profile.search: https://duckduckgo.com/?q=$term&amp;ia=web</li>
+<li>profile.search: https://duckduckgo.com/?q=%1&amp;ia=web</li>
<li>profile.homepage: about:blank</li>
<li>profile.newtab: about:blank</li>
</ul>
-<h3 id="Bookmark-settings">Bookmark settings</h3>
+<h3 id="Bookmarks">Bookmarks</h3>
<ul>
<li>bookmarks.path: ~/.config/smolbote/bookmarks.xbel</li>
@@ -193,7 +196,7 @@ edited with the <code>poi-config</code> tool.</p>
</ul>
-<h3 id="Downloads-settings">Downloads settings</h3>
+<h3 id="Downloads">Downloads</h3>
<ul>
<li>downloads.path: ~/Downloads</li>
diff --git a/linux/man/smolbote.7.ronn b/linux/man/smolbote.7.ronn
index ef97373..ba60db6 100644
--- a/linux/man/smolbote.7.ronn
+++ b/linux/man/smolbote.7.ronn
@@ -31,59 +31,60 @@ edited with the `poi-config` tool.
Settings are only loaded on launch, so re-run the browser to apply changes.
-* browser.profile: Profile to be used by default, "" is off-the-record
+### Main Window
+* mainwindow.height: 720
+* mainwindow.width: 1280
+* mainwindow.maximized: true
+* mainwindow.title: smolbote
-### Default window size
-* browser.window.height: 720
-* browser.window.width: 1280
-* browser.window.maximized: true
-* browser.window.title: title — smolbote [profile]
+* mainwindow.shortcuts.newGroup: Ctrl+G
+* mainwindow.shortcuts.newWindow: Ctrl+N (todo)
-### Window UI
-* browser.ui.navtoolbarMovable: false
-* browser.ui.tabtoolbarMovable: false
+* mainwindow.shortcuts.about: F1
+* mainwindow.shortcuts.quit: Ctrl+Q
-### Shortcuts
-* browser.shortcuts.newWindow: Ctrl+N
-* browser.shortcuts.about: F1
-* browser.shortcuts.quit: Ctrl+Q
+* mainwindow.shortcuts.search: F3
+* mainwindow.shortcuts.tileWindows: F9
-* browser.shortcuts.back: Ctrl+Left
-* browser.shortcuts.forward: Ctrl+Right
-* browser.shortcuts.refresh: F5
-* browser.shortcuts.reload: Ctrl+F5
-* browser.shortcuts.home: Ctrl+Home
-
-* browser.shortcuts.toggleSearchBox: F3
-* browser.shortcuts.fullscreen: F11
+### Navigation bar
+* navigation.movable: false
+* navigation.shortcuts.back: Ctrl+Left
+* navigation.shortcuts.forward: Ctrl+Right
+* navigation.shortcuts.refresh: F5
+* navigation.shortcuts.home: Ctrl+Home
+### Address bar
* addressbar.shortcuts.focus: F4
* addressbar.shortcuts.pageMenu: F2
* addressbar.shortcuts.toolsMenu: F10
-* tabbar.shortcuts.new: Ctrl+T
-* tabbar.shortcuts.close: Ctrl+X
-* tabbar.shortcuts.left: Ctrl+O
-* tabbar.shortcuts.right: Ctrl+P
+### Window
+* window.shortcuts.new: Ctrl+T
+* window.shortcuts.close: Ctrl+X
+* window.shortcuts.left: Ctrl+O
+* window.shortcuts.right: Ctrl+P
+* window.shortcuts.fullscreen: F11 (todo)
-### Filter settings
+### Filter
* filter.path: ~/.config/smolbote/hosts.d
-* filter.cookies.block.all: false
+* filter.cookies.block.all: false (todo: in qt5.11)
* filter.cookies.block.thirdParty: true
+* filter.cookies.path: ~/.config/smolbote/cookies.d
-### Plugin settings
+### Plugins (to-redo)
* plugins.path: ~/.config/smolbote/plugins.d
-### Profile settings
+### Profiles
+* profile.default: ''
* profile.path: ~/.config/smolbote/profiles.d
-* profile.search: https://duckduckgo.com/?q=$term&ia=web
+* profile.search: https://duckduckgo.com/?q=%1&ia=web
* profile.homepage: about:blank
* profile.newtab: about:blank
-### Bookmark settings
+### Bookmarks
* bookmarks.path: ~/.config/smolbote/bookmarks.xbel
* bookmarks.shortcut: Ctrl+B
-### Downloads settings
+### Downloads
* downloads.path: ~/Downloads
* downloads.shortcut: Ctrl+D
diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp
index 0052d13..23bc7da 100644
--- a/src/mainwindow/mainwindow.cpp
+++ b/src/mainwindow/mainwindow.cpp
@@ -66,6 +66,7 @@ MainWindow::MainWindow(std::shared_ptr<Configuration> &config, QWidget *parent)
disconnect(navigationBarConnection);
disconnect(searchBoxConnection);
disconnect(statusBarConnection);
+ windowMenu->setMenu(nullptr);
auto *w = qobject_cast<Window *>(window);
if(w == nullptr) {
@@ -75,6 +76,7 @@ MainWindow::MainWindow(std::shared_ptr<Configuration> &config, QWidget *parent)
navigationToolBar->connectWebView(nullptr);
searchBox->setView(nullptr);
} else {
+ windowMenu->setMenu(w->systemMenu());
addressBar->connectWebView(w->currentView());
addressBarConnection = connect(w, &Window::currentViewChanged, addressBar, &AddressBar::connectWebView);
navigationToolBar->connectWebView(w->currentView());
@@ -107,11 +109,6 @@ MainWindow::~MainWindow()
void MainWindow::createMenuBar()
{
auto *smolboteMenu = menuBar()->addMenu(qApp->applicationDisplayName());
- smolboteMenu->addAction(tr("New tab"), this, [this]() {
- createTab(QUrl::fromUserInput("about:blank"));
- },
- QKeySequence(m_config->value<std::string>("mainwindow.shortcuts.newTab").value().c_str()));
-
smolboteMenu->addAction(tr("New tab group"), this, [this]() {
createSubWindow(QUrl::fromUserInput("about:blank"));
},
@@ -132,6 +129,7 @@ void MainWindow::createMenuBar()
smolboteMenu->addAction(tr("Quit"), qApp, &QApplication::quit,
QKeySequence(m_config->value<std::string>("mainwindow.shortcuts.quit").value().c_str()));
+ windowMenu = menuBar()->addAction(tr("Window"));
toolsMenu = menuBar()->addMenu(tr("Tools"));
}
@@ -174,7 +172,7 @@ void MainWindow::createTab(const QUrl &url)
Window *MainWindow::createSubWindow(const QUrl &url)
{
- auto *w = new Window(this);
+ auto *w = new Window(m_config->section("window"), this);
mdiArea->addSubWindow(w);
w->showMaximized();
w->setFocus();
diff --git a/src/mainwindow/mainwindow.h b/src/mainwindow/mainwindow.h
index 0d7939c..6ed9e5b 100644
--- a/src/mainwindow/mainwindow.h
+++ b/src/mainwindow/mainwindow.h
@@ -46,6 +46,7 @@ protected:
void closeEvent(QCloseEvent *event) override;
private:
+ QAction *windowMenu = nullptr;
QMenu *toolsMenu = nullptr;
AddressBar *addressBar = nullptr;
SearchForm *searchBox = nullptr;
diff --git a/src/mainwindow/widgets/tabwidget.cpp b/src/mainwindow/widgets/tabwidget.cpp
index 21476cd..66182c3 100644
--- a/src/mainwindow/widgets/tabwidget.cpp
+++ b/src/mainwindow/widgets/tabwidget.cpp
@@ -25,28 +25,6 @@ TabWidget::TabWidget(QWidget *parent)
connect(this, &TabWidget::tabCloseRequested, this, &TabWidget::deleteTab);
- // general actions
- closeTab_action = new QAction(this);
- closeTab_action->setShortcut(QKeySequence("Ctrl+X"));
- connect(closeTab_action, &QAction::triggered, this, [this]() {
- this->deleteTab(this->currentIndex());
- });
- addAction(closeTab_action);
-
- leftTab_action = new QAction(this);
- leftTab_action->setShortcut(QKeySequence("Ctrl+O"));
- connect(leftTab_action, &QAction::triggered, this, [this]() {
- this->setCurrentIndex(qMax(0, this->currentIndex() - 1));
- });
- addAction(leftTab_action);
-
- rightTab_action = new QAction(this);
- rightTab_action->setShortcut(QKeySequence("Ctrl+P"));
- connect(rightTab_action, &QAction::triggered, this, [this]() {
- this->setCurrentIndex(qMin(this->currentIndex() + 1, this->count() - 1));
- });
- addAction(rightTab_action);
-
// context menu
tabContextMenu = new QMenu(this);
auto *closeTab = tabContextMenu->addAction(tr("Close Tab"));
diff --git a/src/mainwindow/widgets/tabwidget.h b/src/mainwindow/widgets/tabwidget.h
index b7aad63..06fa79b 100644
--- a/src/mainwindow/widgets/tabwidget.h
+++ b/src/mainwindow/widgets/tabwidget.h
@@ -30,10 +30,6 @@ protected:
void contextMenuEvent(QContextMenuEvent *event) override;
private:
- QAction *closeTab_action;
- QAction *leftTab_action;
- QAction *rightTab_action;
-
QMenu *tabContextMenu;
};
diff --git a/src/mainwindow/window.cpp b/src/mainwindow/window.cpp
index 0c52076..735df4a 100644
--- a/src/mainwindow/window.cpp
+++ b/src/mainwindow/window.cpp
@@ -11,8 +11,11 @@
#include "webengine/webview.h"
#include "widgets/tabwidget.h"
#include <QUrl>
+#include <QToolButton>
+#include <QStyle>
+#include <QAction>
-Window::Window(QWidget *parent, Qt::WindowFlags flags)
+Window::Window(const QHash<QString, QString> &config, QWidget *parent, Qt::WindowFlags flags)
: QMdiSubWindow(parent, flags)
, tabWidget(new TabWidget(this))
{
@@ -22,6 +25,38 @@ Window::Window(QWidget *parent, Qt::WindowFlags flags)
resize(800, 600);
setWidget(tabWidget);
+ // new tab button
+ auto *newTab_button = new QToolButton(this);
+ newTab_button->setIcon(style()->standardIcon(QStyle::SP_FileIcon));
+ 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());
+ });
+ tabWidget->setCornerWidget(newTab_button, Qt::TopRightCorner);
+
+ // general actions
+ auto *closeTab_action = new QAction(this);
+ closeTab_action->setShortcut(QKeySequence(config.value("window.shortcuts.close")));
+ connect(closeTab_action, &QAction::triggered, this, [=]() {
+ tabWidget->deleteTab(tabWidget->currentIndex());
+ });
+ addAction(closeTab_action);
+
+ auto *leftTab_action = new QAction(this);
+ leftTab_action->setShortcut(QKeySequence(config.value("window.shortcuts.left")));
+ connect(leftTab_action, &QAction::triggered, this, [=]() {
+ tabWidget->setCurrentIndex(qMax(0, tabWidget->currentIndex() - 1));
+ });
+ addAction(leftTab_action);
+
+ auto *rightTab_action = new QAction(this);
+ rightTab_action->setShortcut(QKeySequence(config.value("window.shortcuts.right")));
+ connect(rightTab_action, &QAction::triggered, this, [=]() {
+ tabWidget->setCurrentIndex(qMin(tabWidget->currentIndex() + 1, tabWidget->count() - 1));
+ });
+ addAction(rightTab_action);
+
connect(tabWidget, &TabWidget::currentChanged, [this](int index) {
if(index < 0) {
// last tab has been closed
diff --git a/src/mainwindow/window.h b/src/mainwindow/window.h
index ee9a11d..cdc504c 100644
--- a/src/mainwindow/window.h
+++ b/src/mainwindow/window.h
@@ -19,7 +19,7 @@ class Window : public QMdiSubWindow
Q_OBJECT
public:
- explicit Window(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
+ explicit Window(const QHash<QString, QString> &config, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
~Window() override;
WebView *currentView();