From 9d60570ca784000cb5ef78b13861eee58117595d Mon Sep 17 00:00:00 2001 From: Akseli Lahtinen Date: Sat, 12 Apr 2025 16:28:38 +0000 Subject: DolphinNavigator: Hide the KUrlNavigator background if DolphinNavigator is outside of toolbar When the DolphinNavigator is outside of the toolbar, it's better to hide the background for better looks. This change works only when Dolphin is built against KIO 6.14. --- src/dolphinmainwindow.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/dolphinmainwindow.cpp') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 12b8be955..efcd4190e 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -236,6 +236,7 @@ DolphinMainWindow::DolphinMainWindow() } updateAllowedToolbarAreas(); + updateNavigatorsBackground(); // enable middle-click on back/forward/up to open in a new tab auto *middleClickEventFilter = new MiddleClickActionEventFilter(this); @@ -2760,6 +2761,12 @@ void DolphinMainWindow::updateAllowedToolbarAreas() } } +void DolphinMainWindow::updateNavigatorsBackground() +{ + auto navigators = static_cast(actionCollection()->action(QStringLiteral("url_navigators"))); + navigators->setBackgroundEnabled(navigators->isInToolbar()); +} + bool DolphinMainWindow::isKompareInstalled() const { static bool initialized = false; @@ -2946,6 +2953,7 @@ void DolphinMainWindow::saveNewToolbarConfig() m_tabWidget->currentTabPage()->insertNavigatorsWidget(navigators); } updateAllowedToolbarAreas(); + updateNavigatorsBackground(); (static_cast(actionCollection()->action(KStandardAction::name(KStandardAction::HamburgerMenu))))->hideActionsOf(toolBar()); } -- cgit v1.3