summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-05-30 22:43:14 (GMT)
committerKevin Smith <kevin.smith@isode.com>2015-05-31 15:30:49 (GMT)
commite677a606d5f3d4ef5b0e6a29ec8eb996f197600b (patch)
treebb5768c6d0a836086201aa533c833825e1f50e1a /Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.cpp
parente36548d66bdcc70e891ff7f84707ee59c5562c64 (diff)
downloadswift-e677a606d5f3d4ef5b0e6a29ec8eb996f197600b.zip
swift-e677a606d5f3d4ef5b0e6a29ec8eb996f197600b.tar.bz2
Layout improvements to QtVCardPhotoAndNameFields
Layout label and editing widgets below each other instead of next to each other. This way there will not be any horizontal spacing if one of them is hidden. This also removes empty name parts in the shown fullname. Test-Information: Tested on Mac OS X 10.9.5 and Qt 5.4.1. Change-Id: I20561a8e7f8b9305cd3314b1250a2d006abbccb5
Diffstat (limited to 'Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.cpp')
-rw-r--r--Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.cpp b/Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.cpp
index c8b010e..75b1f07 100644
--- a/Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.cpp
+++ b/Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.cpp
@@ -56,16 +56,13 @@ void QtVCardPhotoAndNameFields::setEditable(bool editable) {
this->editable = editable;
ui->avatarWidget->setEditable(editable);
- ui->horizontalLayoutFN->setSpacing(editable ? 2 : 0);
ui->lineEditFN->setVisible(editable);
ui->labelFN->setVisible(!editable);
- ui->horizontalLayoutNICKNAME->setSpacing(editable ? 2 : 0);
ui->lineEditNICKNAME->setVisible(editable);
ui->labelNICKNAME->setVisible(!editable);
// prefix given middle last suffix
- ui->horizontalLayoutFULLNAME->setSpacing(editable ? 2 : 0);
ui->lineEditPREFIX->setVisible(editable);
ui->lineEditGIVEN->setVisible(editable);
ui->lineEditMIDDLE->setVisible(editable);
@@ -79,7 +76,7 @@ void QtVCardPhotoAndNameFields::setEditable(bool editable) {
for (QStringList::iterator i = fullname.begin(); i != fullname.end(); i++) {
*i = i->trimmed();
}
- ui->labelFULLNAME->setText(fullname.join(" "));
+ ui->labelFULLNAME->setText((fullname.filter(QRegExp(".+"))).join(" "));
}
void QtVCardPhotoAndNameFields::setAvatar(const ByteArray &data, const std::string &type) {