connect(m_tabbedPanel, SIGNAL(panelOpened()),
m_mapView, SLOT(enableCenterShift()));
+
+ connect(m_tabbedPanel, SIGNAL(panelClosed()),
+ m_userInfoPanel, SIGNAL(collapse()));
+
+ connect(m_tabbedPanel, SIGNAL(currentChanged(int)),
+ m_userInfoPanel, SIGNAL(collapse()));
}
void MainWindow::buildRoutingPanel()
USA.\r
*/\r
\r
-#include <Qt/qapplication.h>\r
-\r
+#include <QApplication>\r
#include <QCheckBox>\r
#include <QDebug>\r
#include <QDialogButtonBox>\r
\r
QString msgText = m_textEdit->toPlainText().toUtf8();\r
\r
- if (msgText.length() > MESSAGE_MAX_LENGTH)\r
- {\r
+ if (msgText.length() > MESSAGE_MAX_LENGTH) {\r
QKeyEvent event = QKeyEvent(QEvent::KeyPress, Qt::Key_Backspace, Qt::NoModifier);\r
QApplication::sendEvent(m_textEdit, &event);\r
}\r
#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(" ");
m_statusTextLabel->setText(m_messageText);
- 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;
- setText(false);
+ setExpanded(false);
}
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.
private slots:
/**
+ * @brief Slot for collapse user info
+ */
+ void collapse();
+
+ /**
* @brief Slot for find button click
*/
void findButtonClicked();
connect(m_userInfo, SIGNAL(notificateUpdateFailing(QString, bool)),
this, SIGNAL(notificateUpdateFailing(QString, bool)));
+
+ connect(this, SIGNAL(collapse()),
+ m_userInfo, SLOT(collapse()));
}
void UserInfoPanel::userDataReceived(User *user)
void findUser(const GeoCoordinate &coordinates);
/**
+ * @brief Slot 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