summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-04-15 10:37:40 (GMT)
committerSami Merila <sami.merila@nokia.com>2010-04-15 10:41:07 (GMT)
commit22df502bd5fcdb51bfcfa2e5d3f6fbf2d9fc3562 (patch)
treed1718f8240a5a17e206d85dcc66a7645746f5d92 /src
parent6a78005ed2e2d29225e322d53bb422438c8f9935 (diff)
downloadQt-22df502bd5fcdb51bfcfa2e5d3f6fbf2d9fc3562.zip
Qt-22df502bd5fcdb51bfcfa2e5d3f6fbf2d9fc3562.tar.gz
Qt-22df502bd5fcdb51bfcfa2e5d3f6fbf2d9fc3562.tar.bz2
Dialogs in landscape mode are not correctly positioned
If AVKON is using a StaCon component (combined Status and Control Pane), then dialogs were incorrectly positioned. Native side, places dialogs shown with StaCon to right border, whereas the current implementation was placing them to left. Fixed, by asking from AVKON the rect for StaCon. If it is empty, then use the existing placement rules, otherwise place to the right border. Task-number: QTBUG-9910 Reviewed-by: Janne Anttila
Diffstat (limited to 'src')
-rw-r--r--src/gui/dialogs/qdialog.cpp41
1 files changed, 24 insertions, 17 deletions
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index 25ba016..8b40b52 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -904,26 +904,33 @@ bool QDialog::s60AdjustedPosition()
} else {
cbaHeight = qt_TSize2QSize(bgContainer->Size()).height();
}
- p.setY(S60->screenHeightInPixels-height()-cbaHeight);
+ p.setY(S60->screenHeightInPixels - height() - cbaHeight);
p.setX(0);
} else {
const int scrollbarWidth = style()->pixelMetric(QStyle::PM_ScrollBarExtent);
- TRect cbaRect = TRect();
- AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, cbaRect);
- AknLayoutUtils::TAknCbaLocation cbaLocation = AknLayoutUtils::CbaLocation();
- switch (cbaLocation) {
- case AknLayoutUtils::EAknCbaLocationBottom:
- p.setY(S60->screenHeightInPixels - height()-cbaRect.Height());
- p.setX((S60->screenWidthInPixels - width())>>1);
- break;
- case AknLayoutUtils::EAknCbaLocationRight:
- p.setY((S60->screenHeightInPixels - height())>>1);
- p.setX(qMax(0,S60->screenWidthInPixels-width()-scrollbarWidth-cbaRect.Width()));
- break;
- case AknLayoutUtils::EAknCbaLocationLeft:
- p.setY((S60->screenHeightInPixels - height())>>1);
- p.setX(qMax(0,scrollbarWidth+cbaRect.Width()));
- break;
+ TRect staConTopRect = TRect();
+ AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStaconTop, staConTopRect);
+ if (staConTopRect.IsEmpty()) {
+ TRect cbaRect = TRect();
+ AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, cbaRect);
+ AknLayoutUtils::TAknCbaLocation cbaLocation = AknLayoutUtils::CbaLocation();
+ switch (cbaLocation) {
+ case AknLayoutUtils::EAknCbaLocationBottom:
+ p.setY(S60->screenHeightInPixels - height() - cbaRect.Height());
+ p.setX((S60->screenWidthInPixels - width()) >> 1);
+ break;
+ case AknLayoutUtils::EAknCbaLocationRight:
+ p.setY((S60->screenHeightInPixels - height()) >> 1);
+ p.setX(qMax(0,S60->screenWidthInPixels - width() - scrollbarWidth - cbaRect.Width()));
+ break;
+ case AknLayoutUtils::EAknCbaLocationLeft:
+ p.setY((S60->screenHeightInPixels - height()) >> 1);
+ p.setX(qMax(0,scrollbarWidth + cbaRect.Width()));
+ break;
+ }
+ } else {
+ p.setY((S60->screenHeightInPixels - height()) >> 1);
+ p.setX(qMax(0,S60->screenWidthInPixels - width()));
}
}
move(p);