From 44fae8e280c71c835bcef5148f6b27946040a704 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Mon, 26 Apr 2010 13:55:41 +0300 Subject: QS60Style: Menu separators are not drawn, yet they take up screen space Currently, QS60Style does not draw menu separators at all, yet they are calculated to take screen estate. Remove the screen reservation from them. See also QTBUG-10054 for details to add menu separator support to style. Task-number: QTBUG-10191 Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 3d993da..90b8be3 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2494,6 +2494,12 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt, break; case CT_MenuItem: case CT_ItemViewItem: + if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast(opt)) { + if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) { + sz = QSize(); + break; + } + } sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget); if (QS60StylePrivate::isTouchSupported()) //Make itemview easier to use in touch devices -- cgit v0.12