diff options
Diffstat (limited to 'Swift/QtUI/QtRosterHeader.cpp')
-rw-r--r-- | Swift/QtUI/QtRosterHeader.cpp | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/Swift/QtUI/QtRosterHeader.cpp b/Swift/QtUI/QtRosterHeader.cpp index 0fad137..57e7af1 100644 --- a/Swift/QtUI/QtRosterHeader.cpp +++ b/Swift/QtUI/QtRosterHeader.cpp @@ -15,6 +15,7 @@ #include "QtStatusWidget.h" #include <Swift/QtUI/QtElidingLabel.h> +#include <Swift/QtUI/QtClickableLabel.h> #include <Swift/QtUI/QtNameWidget.h> namespace Swift { @@ -26,14 +27,14 @@ QtRosterHeader::QtRosterHeader(QtSettingsProvider* settings, QWidget* parent) : setMinimumHeight(50); setMaximumHeight(50); - avatarLabel_ = new QLabel(this); + avatarLabel_ = new QtClickableLabel(this); avatarLabel_->setMinimumSize(avatarSize_, avatarSize_); avatarLabel_->setMaximumSize(avatarSize_, avatarSize_); avatarLabel_->setAlignment(Qt::AlignCenter); setAvatar(":/icons/avatar.png"); avatarLabel_->setScaledContents(false); topLayout->addWidget(avatarLabel_); - //connect(avatarLabel_, SIGNAL(clicked()), this, SIGNAL(onEditProfileRequest())); /* FIXME: clickableish signal for label */ + connect(avatarLabel_, SIGNAL(clicked()), this, SIGNAL(onEditProfileRequest())); QVBoxLayout* rightLayout = new QVBoxLayout(); rightLayout->setSpacing(4); @@ -49,38 +50,12 @@ QtRosterHeader::QtRosterHeader(QtSettingsProvider* settings, QWidget* parent) : connect(statusWidget_, SIGNAL(onChangeStatusRequest(StatusShow::Type, const QString&)), this, SLOT(handleChangeStatusRequest(StatusShow::Type, const QString&))); rightLayout->addWidget(statusWidget_); show(); - //statusWidget_->setMaximumWidth(60); - - // statusEdit_ = new QtTextEdit(this); - // expandedLayout_->addWidget(statusEdit_); - // statusEdit_->resize(statusEdit_->width(), 64); - // statusEdit_->setAcceptRichText(false); - // statusEdit_->setReadOnly(false); - // setStatusText(""); - // connect(statusEdit_, SIGNAL(returnPressed()), this, SLOT(emitStatus())); - - //setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed)); } -// void QtRosterHeader::mousePressEvent(QMouseEvent* event) { -// if (nameLabel_->underMouse() || (toolBar_->underMouse() && !statusWidget_->underMouse())) { -// toggleExpanded(); -// event->accept(); -// } else { -// event->ignore(); -// } - -// } - - void QtRosterHeader::handleChangeStatusRequest(StatusShow::Type type, const QString& text) { emit onChangeStatusRequest(type, text); } -//void QtRosterHeader::emitStatus() { -// emit onChangeStatusRequest(statusWidget_->getSelectedStatusShow(), statusEdit_->toPlainText()); -//} - void QtRosterHeader::setStatusText(const QString& statusMessage) { statusWidget_->setStatusText(statusMessage); } @@ -96,7 +71,7 @@ void QtRosterHeader::setConnecting() { void QtRosterHeader::setAvatar(const QString& path) { QIcon avatar(path); if (avatar.isNull()) { - qDebug() << "Setting null avatar"; + //qDebug() << "Setting null avatar"; avatar = QIcon(":/icons/avatar.png"); } avatarLabel_->setPixmap(avatar.pixmap(avatarSize_, avatarSize_)); |