diff options
| author | Peter Penz <[email protected]> | 2008-01-26 21:45:28 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2008-01-26 21:45:28 +0000 |
| commit | f6c7b90edf05a52fba6e2a06caa0247e909b43e8 (patch) | |
| tree | cda08606cd172d460d404f7f822b528985fa8e03 /src/dolphincolumnwidget.cpp | |
| parent | 453131d6e8a59af87e943455e26074ce8e3ddae3 (diff) | |
Blend in a toggle button when hovering items. This allows selecting items without using the rubberband or Ctrl/Shift-keys in the single-click mode. Any feedback from users is highly welcome (I think people will either love or hate this feature, I'm really not sure -> it can be turned off too).
svn path=/trunk/KDE/kdebase/apps/; revision=766901
Diffstat (limited to 'src/dolphincolumnwidget.cpp')
| -rw-r--r-- | src/dolphincolumnwidget.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/dolphincolumnwidget.cpp b/src/dolphincolumnwidget.cpp index ae5f32fcf..8bf66b2c8 100644 --- a/src/dolphincolumnwidget.cpp +++ b/src/dolphincolumnwidget.cpp @@ -26,7 +26,9 @@ #include "dolphinsortfilterproxymodel.h" #include "dolphinsettings.h" #include "dolphin_columnmodesettings.h" +#include "dolphin_generalsettings.h" #include "draganddrophelper.h" +#include "selectionmanager.h" #include <kcolorscheme.h> #include <kdirlister.h> @@ -118,6 +120,13 @@ DolphinColumnWidget::DolphinColumnWidget(QWidget* parent, m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); setModel(m_proxyModel); + const bool useSelManager = KGlobalSettings::singleClick() && + DolphinSettings::instance().generalSettings()->showSelectionToggle(); + if (useSelManager) { + SelectionManager* selManager = new SelectionManager(this); + connect(selManager, SIGNAL(selectionChanged()), + this, SLOT(requestActivation())); + } new KMimeTypeResolver(this, m_dolphinModel); m_iconManager = new IconManager(this, m_proxyModel); m_iconManager->setShowPreview(m_view->m_controller->dolphinView()->showPreview()); @@ -304,12 +313,7 @@ void DolphinColumnWidget::paintEvent(QPaintEvent* event) void DolphinColumnWidget::mousePressEvent(QMouseEvent* event) { - m_view->m_controller->requestActivation(); - if (!m_active) { - m_view->requestActivation(this); - m_view->m_controller->triggerUrlChangeRequest(m_url); - } - + requestActivation(); QListView::mousePressEvent(event); } @@ -367,6 +371,16 @@ void DolphinColumnWidget::slotEntered(const QModelIndex& index) m_view->m_controller->emitItemEntered(item); } +void DolphinColumnWidget::requestActivation() +{ + m_view->m_controller->requestActivation(); + if (!m_active) { + m_view->requestActivation(this); + m_view->m_controller->triggerUrlChangeRequest(m_url); + selectionModel()->clear(); + } +} + void DolphinColumnWidget::activate() { setFocus(Qt::OtherFocusReason); |
