mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Hide the Usercard button in the User Info Popup in special channels (#4972)
This commit is contained in:
parent
507f27e3d2
commit
401e097d62
|
@ -46,6 +46,7 @@
|
|||
- Bugfix: Fixed lookahead/-behind not working in _Ignores_. (#4965)
|
||||
- Bugfix: Fixed Image Uploader accidentally deleting images with some hosts when link resolver was enabled. (#4971)
|
||||
- Bugfix: Fixed rare crash with Image Uploader when closing a split right after starting an upload. (#4971)
|
||||
- Bugfix: Hide the Usercard button in the User Info Popup when in special channels. (#4972)
|
||||
- Bugfix: Fixed support for Windows 11 Snap layouts. (#4994)
|
||||
- Bugfix: Fixed some windows appearing between screens. (#4797)
|
||||
- Bugfix: Fixed a bug on Wayland where tooltips would spawn as separate windows instead of behaving like tooltips. (#4998)
|
||||
|
|
|
@ -385,7 +385,10 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically, QWidget *parent,
|
|||
user.emplace<QCheckBox>("Block").assign(&this->ui_.block);
|
||||
user.emplace<QCheckBox>("Ignore highlights")
|
||||
.assign(&this->ui_.ignoreHighlights);
|
||||
auto usercard = user.emplace<EffectLabel2>(this);
|
||||
// visibility of this is updated in setData
|
||||
|
||||
auto usercard =
|
||||
user.emplace<EffectLabel2>(this).assign(&this->ui_.usercardLabel);
|
||||
usercard->getLabel().setText("Usercard");
|
||||
auto mod = user.emplace<Button>(this);
|
||||
mod->setPixmap(getResources().buttons.mod);
|
||||
|
@ -739,6 +742,15 @@ void UserInfoPopup::setData(const QString &name,
|
|||
this->updateLatestMessages();
|
||||
}
|
||||
// If we're opening by ID, this will be called as soon as we get the information from twitch
|
||||
|
||||
auto type = this->channel_->getType();
|
||||
if (type == Channel::Type::TwitchLive ||
|
||||
type == Channel::Type::TwitchWhispers || type == Channel::Type::Irc ||
|
||||
type == Channel::Type::Misc)
|
||||
{
|
||||
// not a normal twitch channel, the url opened by the button will be invalid, so hide the button
|
||||
this->ui_.usercardLabel->hide();
|
||||
}
|
||||
}
|
||||
|
||||
void UserInfoPopup::updateLatestMessages()
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "widgets/DraggablePopup.hpp"
|
||||
#include "widgets/helper/EffectLabel.hpp"
|
||||
|
||||
#include <pajlada/signals/scoped-connection.hpp>
|
||||
#include <pajlada/signals/signal.hpp>
|
||||
|
@ -80,6 +81,8 @@ private:
|
|||
|
||||
Label *noMessagesLabel = nullptr;
|
||||
ChannelView *latestMessages = nullptr;
|
||||
|
||||
EffectLabel2 *usercardLabel = nullptr;
|
||||
} ui_;
|
||||
|
||||
class TimeoutWidget : public BaseWidget
|
||||
|
|
Loading…
Reference in a new issue