diff options
author | Sami Merila <sami.merila@nokia.com> | 2010-05-05 11:07:01 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2010-05-05 11:07:01 (GMT) |
commit | 3fb8a253c0f7823c07dc2f716c12540ff421cabb (patch) | |
tree | ef184c826a8a30d709a89899e7b385b4cda22fdd /src | |
parent | 6c8acf656a9293db2fdbad569bb1fa3a83975462 (diff) | |
download | Qt-3fb8a253c0f7823c07dc2f716c12540ff421cabb.zip Qt-3fb8a253c0f7823c07dc2f716c12540ff421cabb.tar.gz Qt-3fb8a253c0f7823c07dc2f716c12540ff421cabb.tar.bz2 |
QS60Style: QCalendarWidget draws only one-digit dates
Due to largish pixel metrics values for text margins, content does not
fit into QCalendarWidget date-cells.
To fix this, the failing pixel metric values are halved for
QTableViews and its derivatives. This matches native margins almost
perfectly (depending on native layout 1-2 pixel offset).
Task-number: QTBUG-10417
Reviewed-by: Alessandro Portale
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/styles/qs60style.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 20297ae..f32bd5e 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -653,6 +653,8 @@ void QS60StylePrivate::setFont(QWidget *widget) const fontCategory = QS60StyleEnums::FC_Primary; } else if (qobject_cast<QMenu *>(widget)){ fontCategory = QS60StyleEnums::FC_Primary; + } else if (qobject_cast<QCalendarWidget *>(widget)){ + fontCategory = QS60StyleEnums::FC_Secondary; } if (fontCategory != QS60StyleEnums::FC_Undefined) { const bool resolveFontSize = widget->testAttribute(Qt::WA_SetFont) @@ -2478,6 +2480,12 @@ int QS60Style::pixelMetric(PixelMetric metric, const QStyleOption *option, const //double the top layout margin for dialogs, it is very close to real value //without having to define custom pixel metric metricValue *= 2; + + if (widget && (metric == PM_FocusFrameHMargin)) + if (qobject_cast<const QTableView *>(widget)) + //Halve the focus frame margin for table items + metricValue /= 2; + return metricValue; } |