diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphindetailsview.cpp | 8 | ||||
| -rw-r--r-- | src/kcategorizedview.cpp | 7 | ||||
| -rw-r--r-- | src/sidebartreeview.cpp | 8 |
3 files changed, 22 insertions, 1 deletions
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index 61919c140..590e3c7d8 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -108,6 +108,9 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr m_viewOptions.font = font; m_viewOptions.showDecorationSelected = true; + setVerticalScrollMode(QListView::ScrollPerPixel); + setHorizontalScrollMode(QListView::ScrollPerPixel); + updateDecorationSize(); } @@ -153,6 +156,11 @@ bool DolphinDetailsView::event(QEvent* event) 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); } diff --git a/src/kcategorizedview.cpp b/src/kcategorizedview.cpp index 5ec751fa4..7fe806055 100644 --- a/src/kcategorizedview.cpp +++ b/src/kcategorizedview.cpp @@ -976,7 +976,12 @@ void KCategorizedView::leaveEvent(QEvent *event) 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; diff --git a/src/sidebartreeview.cpp b/src/sidebartreeview.cpp index 8d0b1c73d..86f58c17f 100644 --- a/src/sidebartreeview.cpp +++ b/src/sidebartreeview.cpp @@ -26,6 +26,7 @@ #include <QKeyEvent> #include <QPainter> #include <QHeaderView> +#include <QScrollBar> SidebarTreeView::SidebarTreeView(QWidget* parent) : QTreeView(parent), @@ -40,6 +41,8 @@ SidebarTreeView::SidebarTreeView(QWidget* parent) : setDragDropMode(QAbstractItemView::DragDrop); setDropIndicatorShown(false); setAutoExpandDelay(300); + setVerticalScrollMode(QListView::ScrollPerPixel); + setHorizontalScrollMode(QListView::ScrollPerPixel); viewport()->setAttribute(Qt::WA_Hover); @@ -69,6 +72,11 @@ bool SidebarTreeView::event(QEvent* event) 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); } |
