View File BMC_13622_statusbar_2.patch for package meego-ux-compositor (Project home:jieyang:branches:MeeGo:1.2.0:oss:Update:Testing)
>From b2720fe21f8d97c050c160aa1cda9adab87dca05 Mon Sep 17 00:00:00 2001
From: Alexandr Ivanov <alexandr.ivanov@tieto.com>
Date: Fri, 25 Feb 2011 12:11:06 +0200
Subject: [PATCH] Fixes: BMC#11531, issues with toolbar/statusbar alignment
RevBy:
Details: As part of fixing https://bugs.meego.com/show_bug.cgi?id=12753
SystemUI statusbar height reported by geometry is wrong, and geometry() of navigation bar, etc
is always starts at (0,0), real position on scene is sceneBoundingRect()
---
decorators/mdecorator/mdecoratorwindow.cpp | 22 ++++++----------------
decorators/mdecorator/mdecoratorwindow.h | 1 -
2 files changed, 6 insertions(+), 17 deletions(-)
--- a/decorators/mdecorator/mdecoratorwindow.cpp
+++ b/decorators/mdecorator/mdecoratorwindow.cpp
@@ -245,7 +245,6 @@ MDecoratorWindow::MDecoratorWindow(QWidg
escapeButtonPanel(0),
navigationBar(0),
statusBar(0),
- statusBarHeight(0),
messageBox(0),
managed_window(0),
menuVisible(false)
@@ -278,15 +277,6 @@ MDecoratorWindow::MDecoratorWindow(QWidg
if (!statusBar) {
statusBar = dynamic_cast<MStatusBar*>(item);
if (statusBar) {
- // We can't believe statusBar.geometry() because it
- // includes some unwanted margins. Get straight the
- // constant if available.
- MDeviceProfile *dev = MDeviceProfile::instance();
- QSettings ini("/usr/share/themes/base/meegotouch/constants.ini",
- QSettings::IniFormat);
- QString mm = ini.value("Sizes/HEIGHT_STATUSBAR").toString();
- if (mm.endsWith("mm"))
- statusBarHeight = dev->mmToPixels(atoi(mm.toLatin1().constData()));
continue;
}
}
@@ -521,16 +511,16 @@ void MDecoratorWindow::setInputRegion()
// Decoration includes the status bar, and possibly other elements.
QRect sbrect;
if (statusBar) {
- sbrect = statusBar->geometry().toRect();
- if (statusBarHeight)
- sbrect.setHeight(statusBarHeight);
+ sbrect = statusBar->sceneBoundingRect().toRect();
+ sbrect.setHeight(statusBar->property("sharedPixmapHeight").value<qreal>());
}
region = sbrect;
+
if (!only_statusbar) {
- region += navigationBar->geometry().toRect();
- region += homeButtonPanel->geometry().toRect();
+ region += navigationBar->sceneBoundingRect().toRect();
+ region += homeButtonPanel->sceneBoundingRect().toRect();
if (escapeButtonPanel)
- region += escapeButtonPanel->geometry().toRect();
+ region += escapeButtonPanel->sceneBoundingRect().toRect();
}
// The coordinates we receive from libmeegotouch are rotated
--- a/decorators/mdecorator/mdecoratorwindow.h
+++ b/decorators/mdecorator/mdecoratorwindow.h
@@ -90,7 +90,6 @@ private:
MEscapeButtonPanel *escapeButtonPanel;
MNavigationBar *navigationBar;
MStatusBar *statusBar;
- unsigned statusBarHeight;
MMessageBox *messageBox;
Window managed_window;
QRect availableRect; // available area for the managed window