X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fui%2Fuserinfo.cpp;h=244041ed979d21d29876a56fbdbb60d13f706db4;hb=f4d35a5ccb86127d44aa73d44349773b0d4f3ed1;hp=0465bf7da52779b81e2f7858ec87dd94ee81c5c2;hpb=6ffa9a4734575fd34f7f88c17216948ffdb7b6f9;p=situare diff --git a/src/ui/userinfo.cpp b/src/ui/userinfo.cpp index 0465bf7..244041e 100644 --- a/src/ui/userinfo.cpp +++ b/src/ui/userinfo.cpp @@ -36,13 +36,13 @@ #include "userinfo.h" -const int BACKGROUND_WIDTH = 368; -const int BACKGROUND_TOP_HEIGHT = 20; const int BACKGROUND_BOTTOM_HEIGHT = 15; +const int BACKGROUND_TOP_HEIGHT = 20; +const int BACKGROUND_WIDTH = 368; const int ICON_HEIGHT = 24; const int ICON_WIDTH = 24; -const int MARGIN = 5; const int LABEL_MAX_WIDTH = 300; +const int MARGIN = 5; UserInfo::UserInfo(QWidget *parent) : QWidget(parent), @@ -166,6 +166,13 @@ void UserInfo::clearUpdateLocationDialogData() m_backupFacebookPublishPolicity = false; } +void UserInfo::collapse() +{ + qDebug() << __PRETTY_FUNCTION__; + + setExpanded(false); +} + void UserInfo::findButtonClicked() { qDebug() << __PRETTY_FUNCTION__; @@ -215,11 +222,11 @@ void UserInfo::mouseReleaseEvent(QMouseEvent *event) if ((abs(m_mousePosition.y() - event->pos().y()) <= MOUSE_PRESS_AREA_WIDTH) && (abs(m_mousePosition.x() - event->pos().x()) <= MOUSE_PRESS_AREA_HEIGHT)) { if (m_expanded) { - setText(false); + setExpanded(false); m_expanded = false; } else { - setText(true); + setExpanded(true); m_expanded = true; } } @@ -280,7 +287,8 @@ void UserInfo::setMessageText(const QString &text) } m_messageText = list.join(" "); - setText(false); + + setExpanded(false); } void UserInfo::setProfileImage(const QPixmap &image) @@ -291,7 +299,7 @@ void UserInfo::setProfileImage(const QPixmap &image) m_findButton->setButtonIcon(image); } -void UserInfo::setText(bool expanded) +void UserInfo::setExpanded(bool expanded) { qDebug() << __PRETTY_FUNCTION__; @@ -313,6 +321,7 @@ void UserInfo::setUserName(const QString &name) qDebug() << __PRETTY_FUNCTION__; m_userName = name; + m_nameLabel->setText(shortenText(m_nameLabel, m_userName, LABEL_MAX_WIDTH)); }