Changeset View
Changeset View
Standalone View
Standalone View
lib/thumbnailview/thumbnailview.cpp
Show First 20 Lines • Show All 765 Lines • ▼ Show 20 Line(s) | 765 | if (event->modifiers() == Qt::ControlModifier) { | |||
---|---|---|---|---|---|
766 | int width = d->mThumbnailSize.width() + (event->delta() > 0 ? 1 : -1) * WHEEL_ZOOM_MULTIPLIER; | 766 | int width = d->mThumbnailSize.width() + (event->delta() > 0 ? 1 : -1) * WHEEL_ZOOM_MULTIPLIER; | ||
767 | width = qMax(int(MinThumbnailSize), qMin(width, int(MaxThumbnailSize))); | 767 | width = qMax(int(MinThumbnailSize), qMin(width, int(MaxThumbnailSize))); | ||
768 | setThumbnailWidth(width); | 768 | setThumbnailWidth(width); | ||
769 | } else { | 769 | } else { | ||
770 | QListView::wheelEvent(event); | 770 | QListView::wheelEvent(event); | ||
771 | } | 771 | } | ||
772 | } | 772 | } | ||
773 | 773 | | |||
774 | void ThumbnailView::mousePressEvent(QMouseEvent* event) | ||||
775 | { | ||||
776 | switch (event->button()) { | ||||
777 | case Qt::ForwardButton: | ||||
778 | case Qt::BackButton: | ||||
779 | return; | ||||
780 | default: | ||||
781 | QListView::mousePressEvent(event); | ||||
782 | } | ||||
783 | } | ||||
784 | | ||||
774 | void ThumbnailView::scrollToSelectedIndex() | 785 | void ThumbnailView::scrollToSelectedIndex() | ||
775 | { | 786 | { | ||
776 | QModelIndexList list = selectedIndexes(); | 787 | QModelIndexList list = selectedIndexes(); | ||
777 | if (list.count() >= 1) { | 788 | if (list.count() >= 1) { | ||
778 | scrollTo(list.first(), PositionAtCenter); | 789 | scrollTo(list.first(), PositionAtCenter); | ||
779 | } | 790 | } | ||
780 | } | 791 | } | ||
781 | 792 | | |||
▲ Show 20 Lines • Show All 192 Lines • Show Last 20 Lines |