#include "dolphincontroller.h"
#include "dolphindirlister.h"
#include "dolphinsortfilterproxymodel.h"
-#include "dolphinsettings.h"
+#include "settings/dolphinsettings.h"
#include "dolphinviewautoscroller.h"
#include "dolphin_columnmodesettings.h"
#include "dolphin_generalsettings.h"
#include "draganddrophelper.h"
#include "folderexpander.h"
#include "selectionmanager.h"
-#include "tooltipmanager.h"
+#include "tooltips/tooltipmanager.h"
#include <kcolorscheme.h>
#include <kdirlister.h>
m_active(true),
m_view(columnView),
m_selectionManager(0),
+ m_autoScroller(0),
m_url(url),
m_childUrl(),
m_font(),
setVerticalScrollMode(QListView::ScrollPerPixel);
setHorizontalScrollMode(QListView::ScrollPerPixel);
- new DolphinViewAutoScroller(this);
+ m_autoScroller = new DolphinViewAutoScroller(this);
// apply the column mode settings to the widget
const ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
void DolphinColumnWidget::setActive(bool active)
{
- if (m_active == active) {
- return;
+ if (active && (m_view->focusProxy() != this)) {
+ m_view->setFocusProxy(this);
}
- m_active = active;
+ if (m_active != active) {
+ m_active = active;
- if (active) {
- activate();
- } else {
- deactivate();
+ if (active) {
+ activate();
+ } else {
+ deactivate();
+ }
}
}
selModel->select(deselected, QItemSelectionModel::Deselect);
}
+void DolphinColumnWidget::currentChanged(const QModelIndex& current, const QModelIndex& previous)
+{
+ QListView::currentChanged(current, previous);
+ if (current.isValid() && !m_autoScroller->isActive()) {
+ scrollTo(current);
+ }
+}
+
void DolphinColumnWidget::slotEntered(const QModelIndex& index)
{
m_view->m_controller->setItemView(this);