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::currentChanged(const QModelIndex& current, const QModelIndex& previous)
{
QListView::currentChanged(current, previous);
- if (current.isValid()) {
+ if (current.isValid() && !m_autoScroller->isActive()) {
scrollTo(current);
}
}
class DolphinModel;
class DolphinSortFilterProxyModel;
class DolphinDirLister;
+class DolphinViewAutoScroller;
class KFilePreviewGenerator;
class KJob;
class KFileItem;
bool m_active;
DolphinColumnView* m_view;
SelectionManager* m_selectionManager;
+ DolphinViewAutoScroller* m_autoScroller;
KUrl m_url; // URL of the directory that is shown
KUrl m_childUrl; // URL of the next column that is shown
m_ignoreScrollTo(false),
m_controller(controller),
m_selectionManager(0),
+ m_autoScroller(0),
m_font(),
m_decorationSize(),
m_band()
setEditTriggers(QAbstractItemView::NoEditTriggers);
setMouseTracking(true);
- new DolphinViewAutoScroller(this);
+ m_autoScroller = new DolphinViewAutoScroller(this);
const ViewProperties props(controller->url());
setSortIndicatorSection(props.sorting());
void DolphinDetailsView::currentChanged(const QModelIndex& current, const QModelIndex& previous)
{
QTreeView::currentChanged(current, previous);
- if (current.isValid()) {
+ if (current.isValid() && !m_autoScroller->isActive()) {
scrollTo(current);
}
class DolphinController;
class SelectionManager;
+class DolphinViewAutoScroller;
/**
* @brief Represents the details view which shows the name, size,
DolphinController* m_controller;
SelectionManager* m_selectionManager;
+ DolphinViewAutoScroller* m_autoScroller;
QFont m_font;
QSize m_decorationSize;
m_enableScrollTo(false),
m_controller(controller),
m_selectionManager(0),
+ m_autoScroller(0),
m_categoryDrawer(0),
m_font(),
m_decorationSize(),
viewport()->setAcceptDrops(true);
setMouseTracking(true);
- new DolphinViewAutoScroller(this);
+ m_autoScroller = new DolphinViewAutoScroller(this);
connect(this, SIGNAL(clicked(const QModelIndex&)),
controller, SLOT(requestTab(const QModelIndex&)));
void DolphinIconsView::currentChanged(const QModelIndex& current, const QModelIndex& previous)
{
KCategorizedView::currentChanged(current, previous);
- if (current.isValid()) {
+ if (current.isValid() && !m_autoScroller->isActive()) {
scrollTo(current);
}
}
class DolphinController;
class SelectionManager;
class DolphinCategoryDrawer;
+class DolphinViewAutoScroller;
/**
* @brief Represents the view, where each item is shown as an icon.
bool m_enableScrollTo;
DolphinController* m_controller;
SelectionManager* m_selectionManager;
+ DolphinViewAutoScroller* m_autoScroller;
DolphinCategoryDrawer* m_categoryDrawer;
QFont m_font;
{
}
+bool DolphinViewAutoScroller::isActive() const
+{
+ return m_timer->isActive();
+}
+
bool DolphinViewAutoScroller::eventFilter(QObject* watched, QEvent* event)
{
if (watched == m_itemView->viewport()) {
public:
DolphinViewAutoScroller(QAbstractItemView* parent);
virtual ~DolphinViewAutoScroller();
+ bool isActive() const;
protected:
virtual bool eventFilter(QObject* watched, QEvent* event);