connect(m_tabbedPanel, SIGNAL(panelOpened()),
m_mapView, SLOT(enableCenterShift()));
+
+ connect(m_tabbedPanel, SIGNAL(panelClosed()),
- m_userInfoPanel, SIGNAL(collapse()));
++ m_userInfoPanel, SIGNAL(collapse()));
+
+ connect(m_tabbedPanel, SIGNAL(currentChanged(int)),
- m_userInfoPanel, SIGNAL(collapse()));
++ m_userInfoPanel, SIGNAL(collapse()));
}
void MainWindow::buildRoutingPanel()
{
qDebug() << __PRETTY_FUNCTION__ << " " << event->pos();
-
- const int MOUSE_PRESS_AREA_WIDTH = 20;
const int MOUSE_PRESS_AREA_HEIGHT = 20;
+ const int MOUSE_PRESS_AREA_WIDTH = 20;
- if ((abs(m_mousePosition.y() - event->pos().y()) <= MOUSE_PRESS_AREA_WIDTH) &&
- (abs(m_mousePosition.x() - event->pos().x()) <= MOUSE_PRESS_AREA_HEIGHT)) {
+ 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 {
}
m_messageText = list.join(" ");
- m_statusTextLabel->setText(m_messageText);
- setText(false);
++
+ setExpanded(false);
}
void UserInfo::setProfileImage(const QPixmap &image)
qDebug() << __PRETTY_FUNCTION__;
m_userName = name;
- setExpanded(false);
++
+ m_nameLabel->setText(shortenText(m_nameLabel, m_userName, LABEL_MAX_WIDTH));
}
QString UserInfo::shortenText(const QLabel *label, const QString &text, int textMaxWidth)
*
* @param expanded true if full-length text is set, false otherwise
*/
- void setText(bool expanded);
+ void setExpanded(bool expanded);
/**
- * @brief Set shortened texts from User data.
+ * @brief Elides long text
*
- * Text length is defined by MAXIMUM_CHARS.
+ * @param label get the fontmetrics from the label
+ * @param text long text to be shortened
+ * @param textMaxWidth label width
+ * @returns shortened text
*/
QString shortenText(const QLabel *label, const QString &text, int textMaxWidth);
m_userInfo, SLOT(clearUpdateLocationDialogData()));
connect(m_userInfo, SIGNAL(notificateUpdateFailing(QString, bool)),
-- this, SIGNAL(notificateUpdateFailing(QString, bool)));
++ this, SIGNAL(notificateUpdateFailing(QString, bool)));
+
+ connect(this, SIGNAL(collapse()),
- m_userInfo, SLOT(collapse()));
++ m_userInfo, SLOT(collapse()));
}
void UserInfoPanel::userDataReceived(User *user)
void findUser(const GeoCoordinate &coordinates);
/**
- * @brief Slot for collapse user info
++ * @brief Signal for collapse user info
+ */
+ void collapse();
+
+ /**
* @brief Signal that used to inform user that his message/location update tp Situare server
* was failed.
* This signal is originally sended from UserInfo