aboutsummaryrefslogtreecommitdiff
path: root/src/views/mlabelview_simple.cpp
diff options
context:
space:
mode:
authorStanislav Ionascu <stanislav.ionascu@nokia.com>2010-11-29 10:10:56 +0200
committerStanislav Ionascu <stanislav.ionascu@nokia.com>2010-11-29 12:11:28 +0200
commitc70757a80302397d77ac359ea8f4f0104abae6c0 (patch)
treebad4e5df15bcc8440f8e3f7dfd2e69c11a0164e4 /src/views/mlabelview_simple.cpp
parent16338a30270c60b7fc246b06bff6c96cffe44185 (diff)
New: Label text alignment by style.
RevBy: Peter Penz, John Tapsell, Sergiy Dubovik Details: In case if the text alignment is set programatically, then this alignment is preferred. In any other case the style based alignment is used.
Diffstat (limited to 'src/views/mlabelview_simple.cpp')
-rw-r--r--src/views/mlabelview_simple.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/views/mlabelview_simple.cpp b/src/views/mlabelview_simple.cpp
index c51c595d..fc73c80a 100644
--- a/src/views/mlabelview_simple.cpp
+++ b/src/views/mlabelview_simple.cpp
@@ -219,6 +219,8 @@ void MLabelViewSimple::orientationChangeEvent(MOrientationChangeEvent *event)
void MLabelViewSimple::applyStyle()
{
+ if (viewPrivate->model()->alignmentFromStyle())
+ const_cast<MLabelModel*>(viewPrivate->model())->setAlignment(viewPrivate->style()->horizontalAlignment() | viewPrivate->style()->verticalAlignment());
}
void MLabelViewSimple::initializeStaticText()
@@ -231,7 +233,7 @@ void MLabelViewSimple::initializeStaticText()
const MLabelStyle *style = viewPrivate->style();
- paintingRect = (viewPrivate->textOptions.alignment() == Qt::LeftToRight)
+ paintingRect = (viewPrivate->textOptions.textDirection() == Qt::LeftToRight)
? viewPrivate->boundingRect().adjusted(style->paddingLeft(), style->paddingTop(), -style->paddingRight(), -style->paddingBottom())
: viewPrivate->boundingRect().adjusted(style->paddingRight(), style->paddingTop(), -style->paddingLeft(), -style->paddingBottom());
textOffset = paintingRect.topLeft().toPoint();