diff options
| author | Méven Car <[email protected]> | 2026-05-03 14:53:01 +0200 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2026-06-13 12:24:37 +0200 |
| commit | 70f34211cb4ad1f3f6170ded062bafff85d66643 (patch) | |
| tree | cdcbce9a16cc6deed31f0550e7867b0335968ea2 /src/dolphinmainwindow.cpp | |
| parent | 169332e5691267fd69ac20ac2b1aa06441c588db (diff) | |
Add A restore view properties to defaults button
The button allows to restore to defaults, in case you are using the
per-folder view properties settings.
The button disables or enables itself whether or not it matches the
defaults view settings.
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index c1bbcc5f5..d35575624 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -1677,6 +1677,8 @@ void DolphinMainWindow::activeViewChanged(DolphinViewContainer *viewContainer) &DolphinViewContainer::selectionModeChanged, actionCollection()->action(QStringLiteral("toggle_selection_mode")), &QAction::setChecked); + + disconnect(oldViewContainer->view(), &DolphinView::viewSettingsChanged, this, nullptr); } connectViewSignals(viewContainer); @@ -2732,6 +2734,9 @@ void DolphinMainWindow::updateViewActions() QAction *toggleFilterBarAction = actionCollection()->action(QStringLiteral("toggle_filter")); toggleFilterBarAction->setChecked(m_activeViewContainer->isFilterBarVisible()); + QAction *restoreViewSettingsToDefault = actionCollection()->action(QStringLiteral("restore_view_settings_default")); + restoreViewSettingsToDefault->setEnabled(!m_activeViewContainer->view()->isViewSettingsDefaults()); + updateSplitActions(); } @@ -2813,6 +2818,11 @@ void DolphinMainWindow::connectViewSignals(DolphinViewContainer *container) connect(navigator, &KUrlNavigator::tabRequested, this, &DolphinMainWindow::openNewTab); connect(navigator, &KUrlNavigator::activeTabRequested, this, &DolphinMainWindow::openNewTabAndActivate); connect(navigator, &KUrlNavigator::newWindowRequested, this, &DolphinMainWindow::openNewWindow); + + connect(view, &DolphinView::viewSettingsChanged, this, [this](bool isDefault) { + QAction *restoreViewSettingsToDefault = actionCollection()->action(QStringLiteral("restore_view_settings_default")); + restoreViewSettingsToDefault->setEnabled(!isDefault); + }); } void DolphinMainWindow::updateSplitActions() |
