Added recent messages to UserInfoPopup (#1729)
There's a Refresh button added to the popup to refresh the users messages in the popup. Not automatic now while we figure out how fast/slow it would be. Co-authored-by: dnsge <sagedanielr@gmail.com>
This commit is contained in:
@@ -109,6 +109,7 @@ namespace {
|
||||
|
||||
ChannelView::ChannelView(BaseWidget *parent)
|
||||
: BaseWidget(parent)
|
||||
, sourceChannel_(nullptr)
|
||||
, scrollBar_(new Scrollbar(this))
|
||||
{
|
||||
this->setMouseTracking(true);
|
||||
@@ -621,6 +622,21 @@ void ChannelView::setChannel(ChannelPtr channel)
|
||||
}
|
||||
}
|
||||
|
||||
ChannelPtr ChannelView::sourceChannel() const
|
||||
{
|
||||
return this->sourceChannel_;
|
||||
}
|
||||
|
||||
void ChannelView::setSourceChannel(ChannelPtr sourceChannel)
|
||||
{
|
||||
this->sourceChannel_ = sourceChannel;
|
||||
}
|
||||
|
||||
bool ChannelView::hasSourceChannel() const
|
||||
{
|
||||
return this->sourceChannel_ != nullptr;
|
||||
}
|
||||
|
||||
void ChannelView::messageAppended(MessagePtr &message,
|
||||
boost::optional<MessageFlags> overridingFlags)
|
||||
{
|
||||
@@ -1791,8 +1807,8 @@ void ChannelView::hideEvent(QHideEvent *)
|
||||
void ChannelView::showUserInfoPopup(const QString &userName)
|
||||
{
|
||||
auto *userPopup = new UserInfoPopup;
|
||||
userPopup->setData(userName, this->channel_);
|
||||
userPopup->setActionOnFocusLoss(BaseWindow::Delete);
|
||||
userPopup->setData(userName, this->hasSourceChannel() ? this->sourceChannel_
|
||||
: this->channel_);
|
||||
QPoint offset(int(150 * this->scale()), int(70 * this->scale()));
|
||||
userPopup->move(QCursor::pos() - offset);
|
||||
userPopup->show();
|
||||
|
||||
Reference in New Issue
Block a user