summaryrefslogtreecommitdiff
path: root/client/widgets/label.cc
diff options
context:
space:
mode:
authorsenator <senator>2007-10-02 10:09:37 +0000
committersenator <senator>2007-10-02 10:09:37 +0000
commit8dadd3a9f18b6d4e8884862658fe8a1d042f631c (patch)
treee28c16aafcfdb9c76cdc34aeb5c9b1cbdd5d9bbe /client/widgets/label.cc
parent9910c8962ab813ab7d9a04609b689e1d9ae038e0 (diff)
misc minor changes for testing
Diffstat (limited to 'client/widgets/label.cc')
-rw-r--r--client/widgets/label.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/client/widgets/label.cc b/client/widgets/label.cc
index dd658d3..a9a78b4 100644
--- a/client/widgets/label.cc
+++ b/client/widgets/label.cc
@@ -33,11 +33,12 @@ Label::Label(QDomNode node)
QDomElement elem = node.toElement();
if(elem.hasAttribute("width")) {
+ //resize(elem.attribute("width").toInt(), height());
setMinimumWidth(elem.attribute("width").toInt());
}
if(elem.hasAttribute("height")) {
- setMinimumWidth(elem.attribute("height").toInt());
+ resize(width(), elem.attribute("height").toInt());
}
if(elem.hasAttribute("caption")) {
@@ -46,17 +47,22 @@ Label::Label(QDomNode node)
setText(elem.attribute(""));
}
- if(elem.hasAttribute("align")) {
- if(elem.attribute("align") == "left") {
+ // Check for horizontal alignment and set it up accordingly
+ if(elem.hasAttribute("alignment")) {
+ if(elem.attribute("alignment") == "left") {
setAlignment(Qt::AlignLeft);
- } else if (elem.attribute("align") == "center") {
+ } else if (elem.attribute("alignment") == "center") {
setAlignment(Qt::AlignHCenter);
- } else if (elem.attribute("align") == "right") {
+ } else if (elem.attribute("alignment") == "right") {
setAlignment(Qt::AlignRight);
}
} else {
setAlignment(Qt::AlignLeft);
}
+
+ // Always center vertically in the adressed space
+ setAlignment(Qt::AlignVCenter);
+
}
QString Label::getValue()