[yast-commit] r63911 - in /trunk/control-center: VERSION.cmake package/yast2-control-center.changes src/kcategorizedview.cpp
Author: tgoettlicher Date: Thu May 5 15:59:15 2011 New Revision: 63911 URL: http://svn.opensuse.org/viewcvs/yast?rev=63911&view=rev Log: - Fixed module highlighting when window is scrolled (bnc #685446) - 2.21.2 Modified: trunk/control-center/VERSION.cmake trunk/control-center/package/yast2-control-center.changes trunk/control-center/src/kcategorizedview.cpp Modified: trunk/control-center/VERSION.cmake URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center/VERSION.cmake?rev=63911&r1=63910&r2=63911&view=diff ============================================================================== --- trunk/control-center/VERSION.cmake (original) +++ trunk/control-center/VERSION.cmake Thu May 5 15:59:15 2011 @@ -1,3 +1,3 @@ SET(VERSION_MAJOR "2") SET(VERSION_MINOR "21") -SET(VERSION_PATCH "1") +SET(VERSION_PATCH "2") Modified: trunk/control-center/package/yast2-control-center.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center/package/yast2-control-center.changes?rev=63911&r1=63910&r2=63911&view=diff ============================================================================== --- trunk/control-center/package/yast2-control-center.changes (original) +++ trunk/control-center/package/yast2-control-center.changes Thu May 5 15:59:15 2011 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu May 5 15:57:43 CEST 2011 - tgoettlicher@suse.de + +- Fixed module highlighting when window is scrolled (bnc #685446) +- 2.21.2 + +------------------------------------------------------------------- Wed Apr 27 17:22:24 CEST 2011 - tgoettlicher@suse.de - Removed useless warning message (bnc #620617) Modified: trunk/control-center/src/kcategorizedview.cpp URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center/src/kcategorizedview.cpp?rev=63911&r1=63910&r2=63911&view=diff ============================================================================== --- trunk/control-center/src/kcategorizedview.cpp (original) +++ trunk/control-center/src/kcategorizedview.cpp Thu May 5 15:59:15 2011 @@ -697,6 +697,8 @@ } } + + void KCategorizedView::selectCategory( const QString cat ) { QRect previous = d->categoryVisualRect( d->selectedCategory ); @@ -917,147 +919,6 @@ d->updateScrollbars(); } -/*void KCategorizedView::setSelection(const QRect &rect, - QItemSelectionModel::SelectionFlags flags) -{ - if (!d->proxyModel || !d->categoryDrawer || !d->proxyModel->isCategorizedModel()) - { - QListView::setSelection(rect, flags); - return; - } - - if (!flags) - return; - - if (flags & QItemSelectionModel::Clear) - { - selectionModel()->clear(); - d->lastSelection.clear(); - } - - QModelIndexList dirtyIndexes = d->intersectionSet(rect); - - // no items affected, just leave - if (!dirtyIndexes.count()) - { - selectionModel()->select(d->lastSelection, QItemSelectionModel::SelectCurrent); - - return; - } - - QModelIndex topLeft; - QModelIndex bottomRight; - - if (d->mouseButtonPressed || d->rightMouseButtonPressed) // selection with click + drag - { - QItemSelection selection; - - QModelIndex prev = dirtyIndexes[0]; - QModelIndex first = prev; - foreach (const QModelIndex &index, dirtyIndexes) - { - // we have a different interval. non-contiguous items - if ((index.row() - prev.row()) > 1) { - selection << QItemSelectionRange(first, prev); - - first = index; - } - - prev = index; - } - - selection << QItemSelectionRange(first, prev); - - if (flags & QItemSelectionModel::Current) - { - if (rect.topLeft() == rect.bottomRight()) - { - selectionModel()->setCurrentIndex(indexAt(rect.topLeft()), QItemSelectionModel::NoUpdate); - } - - selection.merge(d->lastSelection, flags); - } - else - { - selection.merge(selectionModel()->selection(), flags); - - selectionModel()->select(selection, QItemSelectionModel::SelectCurrent); - - return; - } - - selectionModel()->select(selection, flags); - } - else // selection with click + keyboard keys - { - QModelIndex topLeftIndex = indexAt(QPoint(rect.topLeft().x(), - rect.topLeft().y())); - QModelIndex bottomRightIndex = indexAt(QPoint(rect.bottomRight().x(), - rect.bottomRight().y())); - - // keyboard selection comes "upside down". Let's normalize it - if (topLeftIndex.row() > bottomRightIndex.row()) - { - QModelIndex auxIndex = topLeftIndex; - topLeftIndex = bottomRightIndex; - bottomRightIndex = auxIndex; - } - - int viewportWidth = viewport()->width() - spacing(); - int itemWidth; - - if (gridSize().isEmpty()) - { - itemWidth = d->biggestItemSize.width(); - } - else - { - itemWidth = gridSize().width(); - } - - int itemWidthPlusSeparation = spacing() + itemWidth; - if (!itemWidthPlusSeparation) - itemWidthPlusSeparation++; - int elementsPerRow = viewportWidth / itemWidthPlusSeparation; - if (!elementsPerRow) - elementsPerRow++; - - QModelIndexList theoricDirty(dirtyIndexes); - dirtyIndexes.clear(); - int first = model()->rowCount(); - int last = 0; - - foreach (const QModelIndex &index, theoricDirty) - { - if ((index.row() < first) && - ((((topLeftIndex.row() / elementsPerRow) == (index.row() / elementsPerRow)) && - ((topLeftIndex.row() % elementsPerRow) <= (index.row() % elementsPerRow))) || - (topLeftIndex.row() / elementsPerRow) != (index.row() / elementsPerRow))) - { - first = index.row(); - topLeft = index; - } - - if ((index.row() > last) && - ((((bottomRightIndex.row() / elementsPerRow) == (index.row() / elementsPerRow)) && - ((bottomRightIndex.row() % elementsPerRow) >= (index.row() % elementsPerRow))) || - (bottomRightIndex.row() / elementsPerRow) != (index.row() / elementsPerRow))) - { - last = index.row(); - bottomRight = index; - } - } - - for (int i = first; i <= last; i++) - { - dirtyIndexes << model()->index(i, theoricDirty[0].column(), theoricDirty[0].parent()); - } - - QItemSelection selection(topLeft, bottomRight); - - selectionModel()->select(selection, flags); - } -}*/ void KCategorizedView::mouseMoveEvent(QMouseEvent *event) { @@ -1126,6 +987,7 @@ viewport()->update(rect); } + viewport()->update(); } void KCategorizedView::mousePressEvent(QMouseEvent *event) @@ -1178,28 +1040,6 @@ if (/*(selectionMode() != SingleSelection) && (selectionMode() != NoSelection) &&*/ (initialPressPosition == d->initialPressPosition)) { - /*foreach(const QString &category, d->categories) - { - if (d->categoryVisualRect(category).contains(event->pos()) && - selectionModel()) - { - QItemSelection selection; = selectionModel()->selection(); - QModelIndexList indexList = d->categoriesIndexes[category]; - - foreach (const QModelIndex &index, indexList) - { - QModelIndex selectIndex = index.model()->index(index.row(), 0); - if( d->visualRectInViewport( selectIndex ).contains(initialPressPosition)) - { - selection << QItemSelectionRange(selectIndex); - //selectionModel()->select(selection, QItemSelectionModel::SelectCurrent); - //selectionModel()->setCurrentIndex(selectIndex, QItemSelectionModel::SelectCurrent); - selectionModel()->select(selectIndex, QItemSelectionModel::SelectCurrent); - } - } - - //} - }*/ selectionModel()->select( d->hovered, QItemSelectionModel::SelectCurrent); } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
tgoettlicher@svn2.opensuse.org