┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/selectionmanager.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-05-07 16:54:08 +0000
committerPeter Penz <[email protected]>2009-05-07 16:54:08 +0000
commitb8fa103e8a7e9942f472f6e5c931a0db31263568 (patch)
treef4f47aaa6cf3338f25eefe6e492071b92c163138 /src/selectionmanager.cpp
parentc4a72177e2c115870d26b4dfae894d824ce40183 (diff)
increase the size of the selection toggle corresponding to the item size
BUG: 191629 svn path=/trunk/KDE/kdebase/apps/; revision=964924
Diffstat (limited to 'src/selectionmanager.cpp')
-rw-r--r--src/selectionmanager.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/selectionmanager.cpp b/src/selectionmanager.cpp
index 7a7034d22..129e7e2ca 100644
--- a/src/selectionmanager.cpp
+++ b/src/selectionmanager.cpp
@@ -81,11 +81,21 @@ void SelectionManager::slotEntered(const QModelIndex& index)
const QRect rect = m_view->visualRect(index);
+ // align the toggle on the bottom left of the item
const int gap = 2;
const int x = rect.left() + gap;
const int y = rect.top() + gap;
m_toggle->move(QPoint(x, y));
+ // increase the size of the toggle for large items
+ if (rect.height() >= KIconLoader::SizeEnormous) {
+ m_toggle->resize(KIconLoader::SizeMedium, KIconLoader::SizeMedium);
+ } else if (rect.height() >= KIconLoader::SizeHuge) {
+ m_toggle->resize(KIconLoader::SizeSmallMedium, KIconLoader::SizeSmallMedium);
+ } else {
+ m_toggle->resize(KIconLoader::SizeSmall, KIconLoader::SizeSmall);
+ }
+
QItemSelectionModel* selModel = m_view->selectionModel();
m_toggle->setChecked(selModel->isSelected(index));
m_toggle->show();