}
updateAllowedToolbarAreas();
+ updateNavigatorsBackground();
// enable middle-click on back/forward/up to open in a new tab
auto *middleClickEventFilter = new MiddleClickActionEventFilter(this);
}
}
+void DolphinMainWindow::updateNavigatorsBackground()
+{
+ auto navigators = static_cast<DolphinNavigatorsWidgetAction *>(actionCollection()->action(QStringLiteral("url_navigators")));
+ navigators->setBackgroundEnabled(navigators->isInToolbar());
+}
+
bool DolphinMainWindow::isKompareInstalled() const
{
static bool initialized = false;
m_tabWidget->currentTabPage()->insertNavigatorsWidget(navigators);
}
updateAllowedToolbarAreas();
+ updateNavigatorsBackground();
(static_cast<KHamburgerMenu *>(actionCollection()->action(KStandardAction::name(KStandardAction::HamburgerMenu))))->hideActionsOf(toolBar());
}
*/
void updateAllowedToolbarAreas();
+ /**
+ * Sets the background of the location bar(s) on if they are inside the toolbar,
+ * or off if they are outside the toolbar.
+ */
+ void updateNavigatorsBackground();
+
bool isKompareInstalled() const;
/**
#include "trash/dolphintrash.h"
+#include <KCoreAddons>
#include <KLocalizedString>
#include <KNotificationJobUiDelegate>
#include <KService>
Q_ASSERT(m_splitter->count() == 1);
m_splitter->addWidget(createNavigatorWidget(Secondary));
Q_ASSERT(m_splitter->count() == 2);
+ secondaryUrlNavigator()->setBackgroundEnabled(primaryUrlNavigator()->isBackgroundEnabled());
updateText();
}
updateText();
}
+void DolphinNavigatorsWidgetAction::setBackgroundEnabled(bool enabled)
+{
+#if KIO_VERSION >= QT_VERSION_CHECK(6, 14, 0)
+ m_splitter->setAutoFillBackground(!enabled);
+ m_splitter->setBackgroundRole(enabled ? QPalette::Window : QPalette::Base);
+ primaryUrlNavigator()->setBackgroundEnabled(enabled);
+ if (secondaryUrlNavigator()) {
+ secondaryUrlNavigator()->setBackgroundEnabled(enabled);
+ }
+#endif
+}
+
QWidget *DolphinNavigatorsWidgetAction::createWidget(QWidget *parent)
{
QWidget *oldParent = m_splitter->parentWidget();
*/
void setSecondaryNavigatorVisible(bool visible);
+ /**
+ * Sets the background cosmetic of the location bar(s) visible or hidden.
+ * In frameless designs it's better to hide the background.
+ * @param enabled True for showing background cosmetic, false for hiding it.
+ */
+ void setBackgroundEnabled(bool enabled);
+
protected:
/**
* There should always ever be one navigatorsWidget for this action so