diff options
| author | Florian RICHER <[email protected]> | 2026-05-15 17:29:46 +0200 |
|---|---|---|
| committer | Florian RICHER <[email protected]> | 2026-05-31 10:57:56 +0200 |
| commit | 2a72145eb09276a4576762b74cb976fcd4550e87 (patch) | |
| tree | c7be1a38ab004c12162edff698fceafe3d8e6488 /src/dolphinmainwindow.cpp | |
| parent | f622de7f00b6585c9a17e3ed208921582babf77e (diff) | |
dolphinview: Unselect navigator when click on background
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index ebd811efa..439db8293 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -768,6 +768,17 @@ void DolphinMainWindow::slotSaveSession() } } +void DolphinMainWindow::slotClickViewBackground() +{ + auto navigators = static_cast<DolphinNavigatorsWidgetAction *>(actionCollection()->action(QStringLiteral("url_navigators"))); + KUrlNavigator *navigator = + m_tabWidget->currentTabPage()->primaryViewActive() ? navigators->primaryUrlNavigator() : navigators->secondaryUrlNavigator(); + + if (navigator->isUrlEditable() && !GeneralSettings::editableUrl()) { + navigator->setUrlEditable(false); + } +} + void DolphinMainWindow::setSessionAutoSaveEnabled(bool enable) { if (enable) { @@ -2791,6 +2802,7 @@ void DolphinMainWindow::connectViewSignals(DolphinViewContainer *container) connect(view, &DolphinView::urlActivated, this, &DolphinMainWindow::handleUrl); connect(view, &DolphinView::goUpRequested, this, &DolphinMainWindow::goUp); connect(view, &DolphinView::doubleClickViewBackground, this, &DolphinMainWindow::slotDoubleClickViewBackground); + connect(view, &DolphinView::clickViewBackground, this, &DolphinMainWindow::slotClickViewBackground); connect(container->urlNavigatorInternalWithHistory(), &KUrlNavigator::urlChanged, this, &DolphinMainWindow::changeUrl); connect(container->urlNavigatorInternalWithHistory(), &KUrlNavigator::historyChanged, this, &DolphinMainWindow::updateHistory); |
