summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
authorSami Merilä <sami.merila@nokia.com>2009-10-21 09:09:39 (GMT)
committerSami Merilä <sami.merila@nokia.com>2009-10-21 09:09:39 (GMT)
commit4b678fe08ec8de5a34d8b2ec2d9ec44276424636 (patch)
treeca4676d81d97acc67532031d18d1f52497cbbf92 /src/gui/styles
parenta6af1538ea53408399fb29870a4ef16a92c7893a (diff)
downloadQt-4b678fe08ec8de5a34d8b2ec2d9ec44276424636.zip
Qt-4b678fe08ec8de5a34d8b2ec2d9ec44276424636.tar.gz
Qt-4b678fe08ec8de5a34d8b2ec2d9ec44276424636.tar.bz2
S60Style's tab widget is too small for touch use
TabWidget for S60Style is too small for touch use, it is rather hard to accurately touch the tabpane to switch the active tab. To fix this, we ask the native tabpane height from AVKON and set the QTabWiget's pane height to native height (or bigger). Task-number: QTBUG-4243 Reviewed-by: Alessandro Portale
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qs60style.cpp14
-rw-r--r--src/gui/styles/qs60style_p.h2
-rw-r--r--src/gui/styles/qs60style_s60.cpp20
-rw-r--r--src/gui/styles/qs60style_simulated.cpp4
4 files changed, 36 insertions, 4 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 6d95336..4c6bc46 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -1844,8 +1844,8 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
//todo: update to horizontal table graphic
QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, option->rect, flags | QS60StylePrivate::SF_PointWest);
}
- } else if (qobject_cast<const QFrame *>(widget)) {
- QCommonStyle::drawControl(element, option, painter, widget);
+ } else if (qobject_cast<const QFrame *>(widget)) {
+ QCommonStyle::drawControl(element, option, painter, widget);
}
break;
case CE_MenuScroller:
@@ -2216,6 +2216,12 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(opt))
sz += QSize(2*f->lineWidth, 4*f->lineWidth);
break;
+ case CT_TabBarTab:
+ QSize naviPaneSize = QS60StylePrivate::naviPaneSize();
+ sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
+ if (naviPaneSize.height() > sz.height())
+ sz.setHeight(naviPaneSize.height());
+ break;
default:
sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
break;
@@ -2425,8 +2431,8 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
case SC_ComboBoxArrow:
ret.setRect(
ret.x() + ret.width() - buttonMargin - buttonWidth,
- ret.y() + buttonMargin,
- buttonWidth,
+ ret.y() + buttonMargin,
+ buttonWidth,
height - 2*buttonMargin);
break;
case SC_ComboBoxEditField: {
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index 5422ff6..8e53eee 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -460,6 +460,8 @@ public:
void handleSkinChange();
#endif // Q_WS_S60
+ static QSize naviPaneSize();
+
private:
static void drawPart(QS60StyleEnums::SkinParts part, QPainter *painter,
const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags);
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index d760016..9765066 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -61,6 +61,7 @@
#include <AknFontAccess.h>
#include <AknLayoutFont.h>
#include <aknutils.h>
+#include <aknnavi.h>
#if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN)
@@ -104,6 +105,7 @@ public:
static bool disabledPartGraphic(QS60StyleEnums::SkinParts &part);
static bool disabledFrameGraphic(QS60StylePrivate::SkinFrameElements &frame);
static QPixmap generateMissingThemeGraphic(QS60StyleEnums::SkinParts &part, const QSize &size, QS60StylePrivate::SkinElementFlags flags);
+ static QSize naviPaneSize();
private:
static QPixmap createSkinnedGraphicsLX(QS60StyleEnums::SkinParts part,
@@ -1388,6 +1390,24 @@ void QS60StylePrivate::handleSkinChange()
topLevelWidget->ensurePolished();
}
}
+
+QSize QS60StylePrivate::naviPaneSize()
+{
+ return QS60StyleModeSpecifics::naviPaneSize();
+}
+
+QSize QS60StyleModeSpecifics::naviPaneSize()
+{
+ CAknNavigationControlContainer* naviContainer;
+ if (S60->statusPane())
+ naviContainer = static_cast<CAknNavigationControlContainer*>
+ (S60->statusPane()->ControlL(TUid::Uid(EEikStatusPaneUidNavi)));
+ if (naviContainer)
+ return QSize(naviContainer->Size().iWidth, naviContainer->Size().iHeight);
+ else
+ return QSize(0,0);
+}
+
#endif // Q_WS_S60
QT_END_NAMESPACE
diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp
index 89a9158..8a2616d 100644
--- a/src/gui/styles/qs60style_simulated.cpp
+++ b/src/gui/styles/qs60style_simulated.cpp
@@ -326,6 +326,10 @@ QPixmap QS60StylePrivate::backgroundTexture()
return *m_background;
}
+QSize QS60StylePrivate::naviPaneSize()
+{
+ return QSize(0, 0);
+}
bool QS60StylePrivate::isTouchSupported()
{