Update Mentions UI

Mentions are now an '@' icon in the upper right.

UI Popup is now a smaller dialog.

Still lots of work to be done here.
This commit is contained in:
Joseph Donofry 2019-07-21 21:58:11 -04:00
parent d2af827194
commit 8b2488b7ef
No known key found for this signature in database
GPG key ID: E8A1D78EF044B0CB
6 changed files with 36 additions and 10 deletions

View file

@ -80,11 +80,21 @@ TopRoomBar::TopRoomBar(QWidget *parent)
settingsBtn_->setFixedSize(buttonSize_, buttonSize_);
settingsBtn_->setCornerRadius(buttonSize_ / 2);
mentionsBtn_ = new FlatButton(this);
mentionsBtn_->setToolTip(tr("Mentions"));
mentionsBtn_->setFixedSize(buttonSize_, buttonSize_);
mentionsBtn_->setCornerRadius(buttonSize_ / 2);
QIcon settings_icon;
settings_icon.addFile(":/icons/icons/ui/vertical-ellipsis.png");
settingsBtn_->setIcon(settings_icon);
settingsBtn_->setIconSize(QSize(buttonSize_ / 2, buttonSize_ / 2));
QIcon mentions_icon;
mentions_icon.addFile(":/icons/icons/ui/at-solid.svg");
mentionsBtn_->setIcon(mentions_icon);
mentionsBtn_->setIconSize(QSize(buttonSize_ / 2, buttonSize_ / 2));
backBtn_ = new FlatButton(this);
backBtn_->setFixedSize(buttonSize_, buttonSize_);
backBtn_->setCornerRadius(buttonSize_ / 2);
@ -100,6 +110,7 @@ TopRoomBar::TopRoomBar(QWidget *parent)
topLayout_->addWidget(avatar_);
topLayout_->addWidget(backBtn_);
topLayout_->addLayout(textLayout_, 1);
topLayout_->addWidget(mentionsBtn_, 0, Qt::AlignRight);
topLayout_->addWidget(settingsBtn_, 0, Qt::AlignRight);
menu_ = new Menu(this);
@ -135,6 +146,11 @@ TopRoomBar::TopRoomBar(QWidget *parent)
menu_->popup(
QPoint(pos.x() + buttonSize_ - menu_->sizeHint().width(), pos.y() + buttonSize_));
});
connect(mentionsBtn_, &QPushButton::clicked, this, [this]() {
auto pos = mapToGlobal(mentionsBtn_->pos());
emit mentionsClicked(pos);
});
}
void