From 76f6eb07739290bd7e7a61946f51d7329fb75545 Mon Sep 17 00:00:00 2001 From: Filip Fila Date: Thu, 4 Jun 2026 08:52:56 +0000 Subject: DolphinNavigatorsWidgetAction: Let non-Breeze QStyles style the non-toolbar navbar how they want Currently when Dolphin's location bar is moved from the main toolbar, it stops being a nice `FrameLineEdit` that QStyles can style as they please. That's because the current code is only adjusted for Breeze, which wants to fill the entire navbar frame with a plain rectangle. Unfortunately, non-Breeze styles suffer from bad looks because this Breeze design is applied for them too. In order to fix this, this MR restores the styling power back to QStyles by removing the rectangle, all the while keeping it for Breeze. | Before (Breeze) | After (Breeze) | | ------ | ------ | |![DolphinURL-before_Breeze_](/uploads/b526076352023862e2f17cef744802a0/DolphinURL-before_Breeze_.png){width=698 height=134} | ![DolphinURL-after_Breeze_](/uploads/eb60d5c2a6dff129c4d200fef5f8c5ab/DolphinURL-after_Breeze_.png){width=715 height=138} | | Before (Oxygen) | After (Oxygen) | | ------ | ------ | | ![DolphinURL-before_Oxygen_](/uploads/2d8f19debbd5410b8f0882ed20b34f83/DolphinURL-before_Oxygen_.png){width=714 height=114} | ![DolphinURL-after_Oxygen_](/uploads/fc6a1bed3de647534494951a7b113d5e/DolphinURL-after_Oxygen_.png){width=687 height=129} | | Before (MSWindows9x) | After (MSWindows9x) | | ------ | ------ | | ![DolphinURL-before_MSWindows9x_](/uploads/88ebd20a2be5d9052165ea417517b4a3/DolphinURL-before_MSWindows9x_.png){width=715 height=107} | ![DolphinURL-after_MSWindows9x_](/uploads/575e7a944238113714c70b7705b3854a/DolphinURL-after_MSWindows9x_.png){width=702 height=100} | | Before (Darkly) | After (Darkly) | | ------ | ------ | | ![DolphinURL-before_Darkly_](/uploads/76f28b8175498b6a611953c05554c4e8/DolphinURL-before_Darkly_.png){width=675 height=123} | ![DolphinURL-after_Darkly_](/uploads/7b9b15eaab10ee7731d55c60af7591bf/DolphinURL-after_Darkly_.png){width=705 height=144} | | Before (Fusion) | After (Fusion) | | ------ | ------ | | ![DolphinURL-before_Fusion_](/uploads/de27a5028986d797407bfe66b2e9916b/DolphinURL-before_Fusion_.png){width=701 height=118} | ![DolphinURL-after_Fusion_](/uploads/7f5c7acd1c433fcba8b96e402cf12a21/DolphinURL-after_Fusion_.png){width=692 height=122} | | Before (Kvantum) | After (Kvantum) | | ------ | ------ | | ![DolphinURL-before_Kvantum](/uploads/21c2126044ba31c3bc00610e34a71ec1/DolphinURL-before_Kvantum.png){width=697 height=135} | ![DolphinURL-after_Kvantum](/uploads/ea5287e7ba59e1f9b449c1b002d3b634/DolphinURL-after_Kvantum.png){width=700 height=123} | BUG: 518285 FIXED-IN: --- src/dolphinnavigatorswidgetaction.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/dolphinnavigatorswidgetaction.cpp b/src/dolphinnavigatorswidgetaction.cpp index b16b4876b..dd7110a08 100644 --- a/src/dolphinnavigatorswidgetaction.cpp +++ b/src/dolphinnavigatorswidgetaction.cpp @@ -161,11 +161,14 @@ void DolphinNavigatorsWidgetAction::setSecondaryNavigatorVisible(bool visible) void DolphinNavigatorsWidgetAction::setBackgroundEnabled(bool enabled) { #if KIO_VERSION >= QT_VERSION_CHECK(6, 14, 0) - m_splitter->setAutoFillBackground(!enabled); + // Breeze wants a plain rectangle to fill the frame, + // but let other QStyles style the navbar how they please + const bool isBreezeStyle = m_splitter->style()->name() == QStringLiteral("breeze"); + m_splitter->setAutoFillBackground(!enabled && isBreezeStyle); m_splitter->setBackgroundRole(enabled ? QPalette::Window : QPalette::Base); - primaryUrlNavigator()->setBackgroundEnabled(enabled); + primaryUrlNavigator()->setBackgroundEnabled(isBreezeStyle ? enabled : true); if (secondaryUrlNavigator()) { - secondaryUrlNavigator()->setBackgroundEnabled(enabled); + secondaryUrlNavigator()->setBackgroundEnabled(isBreezeStyle ? enabled : true); } #else Q_UNUSED(enabled); -- cgit v1.3.1