summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-03-25 12:50:48 +0200
committerSami Merila <sami.merila@nokia.com>2010-03-25 12:50:48 +0200
commit80cf88a395d61c2dee83d484c91f24437be0c0e0 (patch)
tree92f972c268f34fafb3251d4e0d7e207d6f18e9f9 /util
parent126849067d3c9d126606afaacecfef5559c2e657 (diff)
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')
-rw-r--r--util/s60pixelmetrics/pixel_metrics.cpp11
-rw-r--r--util/s60pixelmetrics/pixel_metrics.h4
-rw-r--r--util/s60pixelmetrics/pm_mapperapp.cpp9
3 files changed, 18 insertions, 6 deletions
diff --git a/util/s60pixelmetrics/pixel_metrics.cpp b/util/s60pixelmetrics/pixel_metrics.cpp
index beb785e45c..814e185fd4 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;
diff --git a/util/s60pixelmetrics/pixel_metrics.h b/util/s60pixelmetrics/pixel_metrics.h
index 3536c0e14b..4b0f57ed5f 100644
--- a/util/s60pixelmetrics/pixel_metrics.h
+++ b/util/s60pixelmetrics/pixel_metrics.h
@@ -185,7 +185,9 @@ NONSHARABLE_CLASS( QStyle )
// Bold line width
PM_Custom_BoldLineWidth,
// Thin line width
- PM_Custom_ThinLineWidth
+ PM_Custom_ThinLineWidth,
+ // Height of a popup info messagebox
+ PM_Custom_MessageBoxHeight
};
};
diff --git a/util/s60pixelmetrics/pm_mapperapp.cpp b/util/s60pixelmetrics/pm_mapperapp.cpp
index acc6137c7b..a88499da29 100644
--- a/util/s60pixelmetrics/pm_mapperapp.cpp
+++ b/util/s60pixelmetrics/pm_mapperapp.cpp
@@ -155,7 +155,7 @@ void CPixelMetricsMapperAppUi::HandleCommandL( TInt aCommand )
Exit();
break;
case ECmdSwitchOutput:
- {
+ {
HBufC* buffer = HBufC::NewLC( 100 );
TPtr bufferPtr = buffer->Des();
TBool last = ETrue;
@@ -166,7 +166,7 @@ void CPixelMetricsMapperAppUi::HandleCommandL( TInt aCommand )
else
bufferPtr.Append(_L("screen."));
ShowL( *buffer, last );
- }
+ }
break;
case ECmdStatus:
{
@@ -323,7 +323,7 @@ void CPixelMetricsMapperAppUi::HandleCommandL( TInt aCommand )
TInt myValue = KErrNotFound;
for (;;)
{
- if (index==QStyle::PM_Custom_ThinLineWidth)
+ if (index==QStyle::PM_Custom_MessageBoxHeight)
{
last = ETrue;
}
@@ -656,6 +656,9 @@ void CPixelMetricsMapperAppUi::ShowSingleValueL(TInt& aPixelMetric, TInt& aValue
case QStyle::PM_Custom_BoldLineWidth:
bufferPtr.Append(_L("C_BoldLineWidth: "));
break;
+ case QStyle::PM_Custom_MessageBoxHeight:
+ bufferPtr.Append(_L("C_MsgBoxHeight: "));
+ break;
default:
bufferPtr.Append(_L("Default: "));
break;