diff options
author | aqua <aqua@iserlohn-fortress.net> | 2022-09-18 09:57:29 +0300 |
---|---|---|
committer | aqua <aqua@iserlohn-fortress.net> | 2022-09-18 09:57:29 +0300 |
commit | 1b1e327cb73491c17972a33a07c3c9beafe7f938 (patch) | |
tree | 57fa4bc121fc2e172db42288fec7cdd7ff95399c /src/rekonqwindow.cpp | |
parent | Add Bookmarks toolbar (diff) | |
download | rekonq-1b1e327cb73491c17972a33a07c3c9beafe7f938.tar.xz |
Add Navigation and Tab toolbars
Diffstat (limited to 'src/rekonqwindow.cpp')
-rw-r--r-- | src/rekonqwindow.cpp | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/src/rekonqwindow.cpp b/src/rekonqwindow.cpp index 461de12e..2295cd50 100644 --- a/src/rekonqwindow.cpp +++ b/src/rekonqwindow.cpp @@ -15,36 +15,11 @@ // -------------------------------------------------------------------------------------------------- -RekonqView *RekonqWindow::currentView() -{ - auto *view = ui->tabs->view(ui->tabs->currentIndex()); - Q_CHECK_PTR(view); - return view; -} - int RekonqWindow::addView(RekonqView *view) { Q_CHECK_PTR(view); - ui->views->addWidget(view); - const auto index = ui->tabs->addTab(view); - connect(view, &RekonqView::urlChanged, [this, view](const QUrl &url) { - if (view == currentView()) ui->urlBar->setUrl(url); - }); - connect(view, &RekonqView::titleChanged, [this, view](const QString &title) { - const auto idx = ui->views->indexOf(view); - ui->tabs->setTabText(idx, title); - }); - connect(view, &RekonqView::iconChanged, [this, view](const QIcon &icon) { - const auto idx = ui->views->indexOf(view); - ui->tabs->setTabIcon(idx, icon); - }); - - connect(view, &RekonqView::loadStarted, ui->urlBar, &UrlBar::loadStarted); - connect(view, &RekonqView::loadProgress, ui->urlBar, &UrlBar::loadProgress); - connect(view, &RekonqView::loadFinished, ui->urlBar, &UrlBar::loadFinished); - - return index; + return ui->tabToolBar->addView(view); } void RekonqWindow::loadUrl(rekonq::DefaultUrl url, rekonq::OpenType type) @@ -67,13 +42,13 @@ void RekonqWindow::loadUrl(const QUrl &url, rekonq::OpenType type) { switch (type) { case rekonq::CurrentTab: - currentView()->load(url); + ui->tabToolBar->currentView()->load(url); break; case rekonq::NewTab: Application::instance()->newView(url, this); break; case rekonq::NewFocusedTab: - ui->tabs->setCurrentView(Application::instance()->newView(url, this)); + ui->tabToolBar->setCurrentView(Application::instance()->newView(url, this)); break; case rekonq::NewBackGroundTab: break; |