diff --git a/src/lib/data/breeze-fallback/16x16/view-restore.svg b/bin/themes/linux/images/tools.svg similarity index 56% rename from src/lib/data/breeze-fallback/16x16/view-restore.svg rename to bin/themes/linux/images/tools.svg index 27b9f154c..29a1753f3 100644 --- a/src/lib/data/breeze-fallback/16x16/view-restore.svg +++ b/bin/themes/linux/images/tools.svg @@ -7,7 +7,7 @@ diff --git a/src/lib/app/browserwindow.cpp b/src/lib/app/browserwindow.cpp index 2b8d33269..76403993f 100644 --- a/src/lib/app/browserwindow.cpp +++ b/src/lib/app/browserwindow.cpp @@ -576,7 +576,6 @@ void BrowserWindow::loadSettings() //Browser Window settings settings.beginGroup("Browser-View-Settings"); bool showStatusBar = settings.value("showStatusBar", false).toBool(); - bool showWebSearchBar = settings.value("showWebSearchBar", true).toBool(); bool showBookmarksToolbar = settings.value("showBookmarksToolbar", true).toBool(); bool showNavigationToolbar = settings.value("showNavigationToolbar", true).toBool(); bool showMenuBar = settings.value("showMenubar", false).toBool(); diff --git a/src/lib/app/mainmenu.cpp b/src/lib/app/mainmenu.cpp index 45f71eea7..63ae39cd1 100644 --- a/src/lib/app/mainmenu.cpp +++ b/src/lib/app/mainmenu.cpp @@ -544,7 +544,7 @@ void MainMenu::init() QMenu* toolbarsMenu = new QMenu(tr("Toolbars")); connect(toolbarsMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowToolbarsMenu())); - QMenu* sidebarMenu = new QMenu(tr("Sidebar")); + QMenu* sidebarMenu = new QMenu(tr("Sidebars")); connect(sidebarMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowSidebarsMenu())); QMenu* encodingMenu = new QMenu(tr("Character &Encoding")); connect(encodingMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowEncodingMenu())); diff --git a/src/lib/data/breeze-fallback.qrc b/src/lib/data/breeze-fallback.qrc index 6af56897f..b69991c93 100644 --- a/src/lib/data/breeze-fallback.qrc +++ b/src/lib/data/breeze-fallback.qrc @@ -15,7 +15,7 @@ breeze-fallback/16x16/process-stop.svg breeze-fallback/16x16/user-trash-full.svg breeze-fallback/16x16/view-refresh.svg - breeze-fallback/16x16/view-restore.svg + breeze-fallback/16x16/arrow-right-double.svg breeze-fallback/22x22/configure.svg breeze-fallback/22x22/edit-find.svg breeze-fallback/22x22/go-down.svg @@ -28,7 +28,7 @@ breeze-fallback/22x22/process-stop.svg breeze-fallback/22x22/user-trash-full.svg breeze-fallback/22x22/view-refresh.svg - breeze-fallback/22x22/view-restore.svg + breeze-fallback/22x22/arrow-right-double.svg breeze-fallback/32x32/preferences-system-network.svg breeze-fallback/16x16/window-close.svg diff --git a/src/lib/data/breeze-fallback/16x16/arrow-right-double.svg b/src/lib/data/breeze-fallback/16x16/arrow-right-double.svg new file mode 100644 index 000000000..29a1753f3 --- /dev/null +++ b/src/lib/data/breeze-fallback/16x16/arrow-right-double.svg @@ -0,0 +1,13 @@ + + + + + + diff --git a/src/lib/data/breeze-fallback/22x22/view-restore.svg b/src/lib/data/breeze-fallback/22x22/arrow-right-double.svg similarity index 54% rename from src/lib/data/breeze-fallback/22x22/view-restore.svg rename to src/lib/data/breeze-fallback/22x22/arrow-right-double.svg index 27b11e427..0420e8aee 100644 --- a/src/lib/data/breeze-fallback/22x22/view-restore.svg +++ b/src/lib/data/breeze-fallback/22x22/arrow-right-double.svg @@ -8,7 +8,7 @@ diff --git a/src/lib/navigation/navigationbar.cpp b/src/lib/navigation/navigationbar.cpp index 890a7efe7..e0ff3a982 100644 --- a/src/lib/navigation/navigationbar.cpp +++ b/src/lib/navigation/navigationbar.cpp @@ -121,6 +121,19 @@ NavigationBar::NavigationBar(BrowserWindow* window) m_buttonForward->setMenu(m_menuForward); connect(m_buttonForward, SIGNAL(aboutToShowMenu()), this, SLOT(aboutToShowHistoryNextMenu())); + ToolButton *buttonTools = new ToolButton(this); + buttonTools->setObjectName("navigation-button-tools"); + buttonTools->setPopupMode(QToolButton::InstantPopup); + buttonTools->setToolbarButtonLook(true); + buttonTools->setToolTip(tr("Tools")); + buttonTools->setAutoRaise(true); + buttonTools->setFocusPolicy(Qt::NoFocus); + buttonTools->setShowMenuInside(true); + + m_menuTools = new Menu(this); + buttonTools->setMenu(m_menuTools); + connect(buttonTools, &ToolButton::aboutToShowMenu, this, &NavigationBar::aboutToShowToolsMenu); + m_supMenu = new ToolButton(this); m_supMenu->setObjectName("navigation-button-supermenu"); m_supMenu->setPopupMode(QToolButton::InstantPopup); @@ -145,6 +158,7 @@ NavigationBar::NavigationBar(BrowserWindow* window) addWidget(buttonHome, QSL("button-home")); addWidget(buttonAddTab, QSL("button-addtab")); addWidget(m_navigationSplitter, QSL("locationbar")); + addWidget(buttonTools, QSL("button-tools")); setContextMenuPolicy(Qt::CustomContextMenu); connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint))); @@ -224,6 +238,7 @@ void NavigationBar::addWidget(QWidget *widget, const QString &id) void NavigationBar::removeWidget(const QString &id) { m_widgets.remove(id); + reloadLayout(); } void NavigationBar::aboutToShowHistoryBackMenu() @@ -294,6 +309,17 @@ void NavigationBar::aboutToShowHistoryNextMenu() m_menuForward->addAction(tr("Clear history"), this, SLOT(clearHistory())); } +void NavigationBar::aboutToShowToolsMenu() +{ + m_menuTools->clear(); + + m_window->createToolbarsMenu(m_menuTools->addMenu(tr("Toolbars"))); + m_window->createSidebarsMenu(m_menuTools->addMenu(tr("Sidebars"))); + m_menuTools->addSeparator(); + + m_menuTools->addAction(IconProvider::settingsIcon(), tr("Configure Toolbar"), this, SLOT(openConfigurationDialog())); +} + void NavigationBar::clearHistory() { QWebEngineHistory* history = m_window->weView()->page()->history(); @@ -308,13 +334,18 @@ void NavigationBar::contextMenuRequested(const QPoint &pos) menu.exec(mapToGlobal(pos)); } +void NavigationBar::openConfigurationDialog() +{ +} + void NavigationBar::reloadLayout() { const QStringList defaultIds = { QSL("button-backforward"), QSL("button-reloadstop"), QSL("button-home"), - QSL("locationbar") + QSL("locationbar"), + QSL("button-tools") }; QStringList ids = Settings().value(QSL("NavigationBar/Layout"), defaultIds).toStringList(); diff --git a/src/lib/navigation/navigationbar.h b/src/lib/navigation/navigationbar.h index 62047155b..920dfbe46 100644 --- a/src/lib/navigation/navigationbar.h +++ b/src/lib/navigation/navigationbar.h @@ -74,12 +74,14 @@ public slots: private slots: void aboutToShowHistoryNextMenu(); void aboutToShowHistoryBackMenu(); + void aboutToShowToolsMenu(); void loadHistoryIndex(); void loadHistoryIndexInNewTab(int index = -1); void clearHistory(); void contextMenuRequested(const QPoint &pos); + void openConfigurationDialog(); private: void reloadLayout(); @@ -90,13 +92,14 @@ private: QHBoxLayout* m_layout; QSplitter* m_navigationSplitter; WebSearchBar* m_searchLine; - ToolButton* m_supMenu; Menu* m_menuBack; Menu* m_menuForward; ToolButton* m_buttonBack; ToolButton* m_buttonForward; ReloadStopButton* m_reloadStop; + Menu *m_menuTools; + ToolButton* m_supMenu; QHash m_widgets; }; diff --git a/themes/breathe/main.css b/themes/breathe/main.css index 35dd1d265..cc531ccc0 100644 --- a/themes/breathe/main.css +++ b/themes/breathe/main.css @@ -47,6 +47,11 @@ qproperty-icon: url(images/add.png); } +#navigation-button-tools +{ + qproperty-themeIcon: "arrow-right-double"; +} + #navigation-button-supermenu { qproperty-icon: url(images/menu.png); diff --git a/themes/chrome/main.css b/themes/chrome/main.css index 1c825ec25..e75be825f 100644 --- a/themes/chrome/main.css +++ b/themes/chrome/main.css @@ -91,6 +91,11 @@ qproperty-multiIcon: url(images/navigation-addtab.png); } +#navigation-button-tools +{ + qproperty-themeIcon: "arrow-right-double"; +} + #navigation-button-supermenu { qproperty-multiIcon: url(images/navigation-supermenu.png); diff --git a/themes/linux/main.css b/themes/linux/main.css index 72381320c..5d0d87dfb 100644 --- a/themes/linux/main.css +++ b/themes/linux/main.css @@ -47,6 +47,12 @@ qproperty-themeIcon: "list-add"; } +#navigation-button-tools +{ + qproperty-themeIcon: "arrow-right-double"; + qproperty-fallbackIcon: url(images/tools.svg); +} + #navigation-button-supermenu { qproperty-themeIcon: "application-menu"; diff --git a/themes/mac/main.css b/themes/mac/main.css index 7ffe8b813..c792ccfed 100644 --- a/themes/mac/main.css +++ b/themes/mac/main.css @@ -92,6 +92,11 @@ qproperty-multiIcon: url(images/navigation-addtab.png); } +#navigation-button-tools +{ + qproperty-themeIcon: "arrow-right-double"; +} + #navigation-button-supermenu { qproperty-multiIcon: url(images/navigation-supermenu.png); diff --git a/themes/windows/main.css b/themes/windows/main.css index 003bc8f0b..d1f27ac64 100644 --- a/themes/windows/main.css +++ b/themes/windows/main.css @@ -101,6 +101,11 @@ qproperty-iconSize: 23px 22px; } +#navigation-button-tools +{ + qproperty-themeIcon: "arrow-right-double"; +} + #navigation-button-supermenu { qproperty-icon: url(images/navigation-supermenu.png);