aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Kapusta <dominik.kapusta@teleca.com>2010-11-29 16:51:00 +0100
committerDominik Kapusta <dominik.kapusta@teleca.com>2010-12-10 09:33:13 +0100
commit67aab107e8d6419c339a6cab4f2926eee0c51327 (patch)
treedf5cdc5a04515ae49c74d25bf78a24472615eee3
parent8d1739f0eb365b3bd5ef7ef898a9128c96e6810d (diff)
Fixes: NB#207856 - Wrong size of status bar tap area
RevBy: Marcin Miklas Details: Make status bar larger, still drawing only the shared pixmap and rendering the bottom part of it transparent. This way taps that fall just below the status bar pixmap will be recognized as taps on the status bar.
-rw-r--r--src/corelib/widgets/mapplicationwindow.cpp4
-rw-r--r--src/views/mstatusbarview.cpp20
2 files changed, 11 insertions, 13 deletions
diff --git a/src/corelib/widgets/mapplicationwindow.cpp b/src/corelib/widgets/mapplicationwindow.cpp
index 3a8806f7..37c12e1d 100644
--- a/src/corelib/widgets/mapplicationwindow.cpp
+++ b/src/corelib/widgets/mapplicationwindow.cpp
@@ -464,7 +464,9 @@ void MApplicationWindowPrivate::_q_updatePageExposedContentRect()
QRectF pageExposedContentRect;
if (showingStatusBar) {
- topCoverage += statusBar->effectiveSizeHint(Qt::PreferredSize).height();
+ // use this instead of the real height since bottom part of status bar is transparent
+ // and therefore it doesn't cover the application page contents
+ topCoverage += statusBar->property("sharedPixmapHeight").value<qreal>();
}
// Interpretation of whether the navigation bar is covering the page
diff --git a/src/views/mstatusbarview.cpp b/src/views/mstatusbarview.cpp
index f3463837..da9d5f84 100644
--- a/src/views/mstatusbarview.cpp
+++ b/src/views/mstatusbarview.cpp
@@ -46,6 +46,7 @@ namespace{
const QString PIXMAP_PROVIDER_DBUS_PATH = "/statusbar";
const QString PIXMAP_PROVIDER_DBUS_INTERFACE = "com.meego.core.MStatusBar";
const QString PIXMAP_PROVIDER_DBUS_SHAREDPIXMAP_CALL = "sharedPixmapHandle";
+ const qreal SharedPixmapHeight = 30;
}
#endif // HAVE_DBUS
@@ -71,6 +72,7 @@ MStatusBarView::MStatusBarView(MStatusBar *controller) :
this, SLOT(disablePixmapUpdates()));
connect(controller, SIGNAL(displayEntered()),
this, SLOT(enablePixmapUpdates()));
+ controller->setProperty("sharedPixmapHeight", SharedPixmapHeight);
if (controller->scene() && !controller->scene()->views().isEmpty()) {
@@ -124,18 +126,12 @@ void MStatusBarView::drawContents(QPainter *painter, const QStyleOptionGraphicsI
return;
QRectF sourceRect;
- if (controller->sceneManager()->orientation() == M::Landscape) {
- sourceRect.setX(0);
- sourceRect.setY(0);
- sourceRect.setWidth(size().width());
- sourceRect.setHeight(size().height());
- } else {
- sourceRect.setX(0);
- sourceRect.setY(size().height());
- sourceRect.setWidth(size().width());
- sourceRect.setHeight(size().height());
- }
-
+
+ sourceRect.setX(0);
+ sourceRect.setY(controller->sceneManager()->orientation() == M::Landscape ? 0 : SharedPixmapHeight);
+ sourceRect.setWidth(size().width());
+ sourceRect.setHeight(SharedPixmapHeight);
+
painter->drawPixmap(QPointF(0.0, 0.0), sharedPixmap, sourceRect);
#else
Q_UNUSED(painter);