diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-04-02 15:47:01 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-04-02 15:47:01 +0200 |
commit | a6e6823da845ca14d37d8914c80185257e8c0e62 (patch) | |
tree | 1c0126f5a78bc95a6f536d2b091cf762972943c9 /src/mainwindow/mainwindow.cpp | |
parent | Updated documentation (diff) | |
download | smolbote-a6e6823da845ca14d37d8914c80185257e8c0e62.tar.xz |
Refactoring TabBar
- cleaned up code
- moved to mainwindow/widgets
- add Close tabs left/right to context menu
Diffstat (limited to 'src/mainwindow/mainwindow.cpp')
-rw-r--r-- | src/mainwindow/mainwindow.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp index db059a2..99a80b8 100644 --- a/src/mainwindow/mainwindow.cpp +++ b/src/mainwindow/mainwindow.cpp @@ -8,10 +8,12 @@ #include "mainwindow.h" #include "addressbar/urllineedit.h" +#include "configuration/configuration.h" #include "forms/aboutdialog.h" #include "mainwindow/widgets/searchform.h" #include "ui_mainwindow.h" #include "widgets/mainwindowmenubar.h" +#include "mainwindow/widgets/tabbar.h" #include <QDockWidget> #include <QMessageBox> #include <bookmarks/bookmarksview.h> @@ -21,10 +23,10 @@ MainWindow::MainWindow(std::shared_ptr<Configuration> config, QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) - , tabBar(new MainWindowTabBar(config, this)) - , menuBar(new MainWindowMenuBar(config, this)) + , tabBar(new TabBar(config->section("tabbar"), this)) , m_addressBar(new UrlLineEdit(config->section("addressbar"), this)) , m_progressBar(new LoadingBar(this)) + , menuBar(new MainWindowMenuBar(config, this)) { Q_ASSERT(config); m_config = config; @@ -72,7 +74,7 @@ MainWindow::MainWindow(std::shared_ptr<Configuration> config, QWidget *parent) url.replace("$term", t); tabBar->currentView()->load(QUrl::fromUserInput(url)); }); - connect(tabBar, &MainWindowTabBar::currentTabChanged, this, &MainWindow::handleTabChanged); + connect(tabBar, &TabBar::currentTabChanged, this, &MainWindow::handleTabChanged); // loading bar ui->statusBar->addPermanentWidget(m_progressBar); |