void KCategorizedView::startDrag(Qt::DropActions 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.
+ // QAbstractItemView::startDrag(supportedActions);
QListView::startDrag(supportedActions);
d->isDragging = false;
}
QModelIndex KCategorizedView::moveCursor(CursorAction cursorAction,
- Qt::KeyboardModifiers modifiers)
+ Qt::KeyboardModifiers modifiers)
{
if ((viewMode() != KCategorizedView::IconMode) ||
!d->proxyModel ||
}
case QAbstractItemView::MoveLeft:
+ if (layoutDirection() == Qt::RightToLeft)
+ {
+ d->forcedSelectionPosition = d->elementsInfo[current.row() + 1].relativeOffsetToCategory % elementsPerRow;
+
+ if (d->forcedSelectionPosition < 0)
+ d->forcedSelectionPosition = (d->categoriesIndexes[theCategory].count() - 1) % elementsPerRow;
+
+ return d->proxyModel->index(current.row() + 1, 0);
+ }
+
d->forcedSelectionPosition = d->elementsInfo[current.row() - 1].relativeOffsetToCategory % elementsPerRow;
if (d->forcedSelectionPosition < 0)
return d->proxyModel->index(current.row() - 1, 0);
case QAbstractItemView::MoveRight:
+ if (layoutDirection() == Qt::RightToLeft)
+ {
+ d->forcedSelectionPosition = d->elementsInfo[current.row() - 1].relativeOffsetToCategory % elementsPerRow;
+
+ if (d->forcedSelectionPosition < 0)
+ d->forcedSelectionPosition = (d->categoriesIndexes[theCategory].count() - 1) % elementsPerRow;
+
+ return d->proxyModel->index(current.row() - 1, 0);
+ }
+
d->forcedSelectionPosition = d->elementsInfo[current.row() + 1].relativeOffsetToCategory % elementsPerRow;
if (d->forcedSelectionPosition < 0)