summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/text/qtextlayout.cpp2
-rw-r--r--src/plugins/graphicssystems/meego/qmeegographicssystem.cpp8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 4b3c9e7..0fbf838 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -76,7 +76,7 @@ static QFixed alignLine(QTextEngine *eng, const QScriptLine &line)
if (align & Qt::AlignRight)
x = line.width - (line.textAdvance + eng->leadingSpaceWidth(line));
else if (align & Qt::AlignHCenter)
- x = (line.width - line.textAdvance)/2;
+ x = (line.width - (line.textAdvance))/2 - eng->leadingSpaceWidth(line);
}
return x;
}
diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
index 6268d4b..a034b0e 100644
--- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
+++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
@@ -174,6 +174,14 @@ bool QMeeGoGraphicsSystemSwitchHandler::eventFilter(QObject *object, QEvent *eve
QMeeGoGraphicsSystem::switchToMeeGo();
}
}
+ } else if (event->type() == QEvent::Show
+ && QMeeGoGraphicsSystem::switchPolicy == QMeeGoGraphicsSystem::AutomaticSwitch) {
+ if (visibleWidgets() > 0)
+ QMeeGoGraphicsSystem::switchToMeeGo();
+ } else if (event->type() == QEvent::Hide
+ && QMeeGoGraphicsSystem::switchPolicy == QMeeGoGraphicsSystem::AutomaticSwitch) {
+ if (visibleWidgets() == 0)
+ QMeeGoGraphicsSystem::switchToRaster();
}
// resume processing of event