zero or report, we just disable them commenting them out and with a comment to remind ourselves to uncomment them after.
The smooth scrolling is being combined with a good behavior when using the mouse wheel.
Some investigation on QListView found nice stuff for KCategorizedView.
Peter, I have the smooth scrolling for KDirOperator too, let me that one... I have binary incompatible changes merged there with this ones and I am committing everything
together on friday.
CCMAIL: peter.penz@gmx.at
svn path=/trunk/KDE/kdebase/apps/; revision=720918
m_viewOptions.font = font;
m_viewOptions.showDecorationSelected = true;
m_viewOptions.font = font;
m_viewOptions.showDecorationSelected = true;
+ setVerticalScrollMode(QListView::ScrollPerPixel);
+ setHorizontalScrollMode(QListView::ScrollPerPixel);
+
updateDecorationSize();
}
updateDecorationSize();
}
hideColumn(DolphinModel::Rating);
hideColumn(DolphinModel::Tags);
}
hideColumn(DolphinModel::Rating);
hideColumn(DolphinModel::Tags);
}
+ else if (event->type() == QEvent::UpdateRequest) {
+ // A wheel movement will scroll 4 items
+ if (model()->rowCount())
+ verticalScrollBar()->setSingleStep((sizeHintForRow(0) / 3) * 4);
+ }
return QTreeView::event(event);
}
return QTreeView::event(event);
}
void KCategorizedView::startDrag(Qt::DropActions supportedActions)
{
void KCategorizedView::startDrag(Qt::DropActions supportedActions)
{
- QListView::startDrag(supportedActions);
+ // FIXME: QAbstractItemView does far better here since it sets the
+ // pixmap of selected icons to the dragging cursor, but it sets a non
+ // ARGB window so it is no transparent. Use QAbstractItemView when
+ // this is fixed on Qt.
+ //QListView::startDrag(supportedActions);
+ QAbstractItemView::startDrag(supportedActions);
d->isDragging = false;
d->mouseButtonPressed = false;
d->isDragging = false;
d->mouseButtonPressed = false;
#include <QKeyEvent>
#include <QPainter>
#include <QHeaderView>
#include <QKeyEvent>
#include <QPainter>
#include <QHeaderView>
SidebarTreeView::SidebarTreeView(QWidget* parent) :
QTreeView(parent),
SidebarTreeView::SidebarTreeView(QWidget* parent) :
QTreeView(parent),
setDragDropMode(QAbstractItemView::DragDrop);
setDropIndicatorShown(false);
setAutoExpandDelay(300);
setDragDropMode(QAbstractItemView::DragDrop);
setDropIndicatorShown(false);
setAutoExpandDelay(300);
+ setVerticalScrollMode(QListView::ScrollPerPixel);
+ setHorizontalScrollMode(QListView::ScrollPerPixel);
viewport()->setAttribute(Qt::WA_Hover);
viewport()->setAttribute(Qt::WA_Hover);
hideColumn(DolphinModel::Tags);
header()->hide();
}
hideColumn(DolphinModel::Tags);
header()->hide();
}
+ else if (event->type() == QEvent::UpdateRequest) {
+ // A wheel movement will scroll 1 item
+ if (model()->rowCount())
+ verticalScrollBar()->setSingleStep(sizeHintForRow(0) / 3);
+ }
return QTreeView::event(event);
}
return QTreeView::event(event);
}