summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-02-15 07:13:38 (GMT)
committerSami Merila <sami.merila@nokia.com>2010-02-15 07:17:43 (GMT)
commit6e88bdd8012b54549a22e22da4c35215bbc67917 (patch)
tree79e0f4583fba3ef58084867730582c727c5d217d /src
parent12bbcde642ed81c574b8f8d7af1d15885e998582 (diff)
downloadQt-6e88bdd8012b54549a22e22da4c35215bbc67917.zip
Qt-6e88bdd8012b54549a22e22da4c35215bbc67917.tar.gz
Qt-6e88bdd8012b54549a22e22da4c35215bbc67917.tar.bz2
QS60Style: Branch indicator in tree view is misplaced
Fix for QTBUG-7258 make itemview margins larger. This broke the treeviews visually, as indicators are not shown in correct places. Now, indocators are placed correctly for treeviews as well. Task-number: QTBUG-7995 Reviewed-by: Alessandro Portale
Diffstat (limited to 'src')
-rw-r--r--src/gui/styles/qs60style.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index dd1489f..ea7399f 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -2277,14 +2277,16 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
QS60StyleEnums::SkinParts skinPart =
(option->state & State_Open) ? QS60StyleEnums::SP_QgnIndiHlColSuper : QS60StyleEnums::SP_QgnIndiHlExpSuper;
int minDimension = qMin(option->rect.width(), option->rect.height());
- const int resizeValue = minDimension >> 1;
- minDimension += resizeValue; // Adjust the icon bigger because of empty space in svg icon.
QRect iconRect(option->rect.topLeft(), QSize(minDimension, minDimension));
- int verticalMagic(0);
- // magic values for positioning svg icon.
- if (option->rect.width() <= option->rect.height())
- verticalMagic = 3;
- iconRect.translate(3, verticalMagic - resizeValue);
+ const int magicTweak = 3;
+ int resizeValue = minDimension >> 1;
+ if (!QS60StylePrivate::isTouchSupported()) {
+ minDimension += resizeValue; // Adjust the icon bigger because of empty space in svg icon.
+ iconRect.setSize(QSize(minDimension, minDimension));
+ const int verticalMagic = (option->rect.width() <= option->rect.height()) ? magicTweak : 0;
+ resizeValue = verticalMagic - resizeValue;
+ }
+ iconRect.translate(magicTweak, resizeValue);
QS60StylePrivate::drawSkinPart(skinPart, painter, iconRect, flags);
}
}