summaryrefslogtreecommitdiffstats
path: root/util/s60pixelmetrics/pixel_metrics.cpp
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-03-25 10:50:48 (GMT)
committerSami Merila <sami.merila@nokia.com>2010-03-25 10:50:48 (GMT)
commit80cf88a395d61c2dee83d484c91f24437be0c0e0 (patch)
tree92f972c268f34fafb3251d4e0d7e207d6f18e9f9 /util/s60pixelmetrics/pixel_metrics.cpp
parent126849067d3c9d126606afaacecfef5559c2e657 (diff)
downloadQt-80cf88a395d61c2dee83d484c91f24437be0c0e0.zip
Qt-80cf88a395d61c2dee83d484c91f24437be0c0e0.tar.gz
Qt-80cf88a395d61c2dee83d484c91f24437be0c0e0.tar.bz2
QMessageBox is smaller than native MessageBox
Messageboxes are smaller than native ones. This is due to that native ones have a lot of empty space. To fix this, we define a new custom pixel metrics that is the minimum height of one text line messagebox (aka AknPopUp) on the native side. Then we ensure that the QMessageBox is at least of this height. Additionally we do some minor styling for QMessageBox: - the corners graphics are now as rounded as on native side - the font is set to match the native side - the top margin space is doubled for dialogs, which is rather good approximation of native side Task-number: QTBUG-4875 Reviewed-by: Janne Anttila
Diffstat (limited to 'util/s60pixelmetrics/pixel_metrics.cpp')
-rw-r--r--util/s60pixelmetrics/pixel_metrics.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/util/s60pixelmetrics/pixel_metrics.cpp b/util/s60pixelmetrics/pixel_metrics.cpp
index beb785e..814e185 100644
--- a/util/s60pixelmetrics/pixel_metrics.cpp
+++ b/util/s60pixelmetrics/pixel_metrics.cpp
@@ -50,7 +50,7 @@
// so that we can keep dynamic and static values inline.
// Please adjust version data if correcting dynamic PM calculations.
const TInt KPMMajorVersion = 1;
-const TInt KPMMinorVersion = 16;
+const TInt KPMMinorVersion = 17;
TPixelMetricsVersion PixelMetrics::Version()
{
@@ -869,7 +869,7 @@ TInt PixelMetrics::PixelMetricValue(QStyle::PixelMetric metric)
// The difference of center piece from border tell the frame width.
if ( value == QStyle::PM_FocusFrameHMargin)
{
- //use topleft for horizontal as S60 uses different values for right and left borders
+ //use topleft for horizontal as S60 uses different values for right and left borders
value = listSinglePaneText.TextRect().iTl.iX - highlightRect.Rect().iTl.iX;
}
else
@@ -1003,6 +1003,13 @@ TInt PixelMetrics::PixelMetricValue(QStyle::PixelMetric metric)
case QStyle::PM_Custom_ThinLineWidth:
value = 1;
break;
+ case QStyle::PM_Custom_MessageBoxHeight:
+ {
+ TAknLayoutRect popupRect;
+ popupRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::popup_window_general(0));
+ value = popupRect.Rect().Height();
+ }
+ break;
case QStyle::PM_ButtonShiftHorizontal:
case QStyle::PM_ButtonShiftVertical:
value = 0;