#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),
m_backupFacebookPublishPolicity = false;
}
+void UserInfo::collapse()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ setExpanded(false);
+}
+
void UserInfo::findButtonClicked()
{
qDebug() << __PRETTY_FUNCTION__;
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;
}
}
}
m_messageText = list.join(" ");
- setText(false);
+
+ setExpanded(false);
}
void UserInfo::setProfileImage(const QPixmap &image)
m_findButton->setButtonIcon(image);
}
-void UserInfo::setText(bool expanded)
+void UserInfo::setExpanded(bool expanded)
{
qDebug() << __PRETTY_FUNCTION__;
qDebug() << __PRETTY_FUNCTION__;
m_userName = name;
+
m_nameLabel->setText(shortenText(m_nameLabel, m_userName, LABEL_MAX_WIDTH));
}