mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
added text for empty categories in emote popup
This commit is contained in:
parent
12670e51b7
commit
3f4e9cdf91
|
@ -29,11 +29,17 @@ namespace {
|
|||
builder->flags.set(MessageFlag::Centered);
|
||||
builder->flags.set(MessageFlag::DisableCompactEmotes);
|
||||
|
||||
for (const auto &emote : map) {
|
||||
builder
|
||||
.emplace<EmoteElement>(emote.second,
|
||||
MessageElementFlag::AlwaysShow)
|
||||
->setLink(Link(Link::InsertText, emote.first.string));
|
||||
if (!map.empty()) {
|
||||
for (const auto &emote : map) {
|
||||
builder
|
||||
.emplace<EmoteElement>(emote.second,
|
||||
MessageElementFlag::AlwaysShow)
|
||||
->setLink(Link(Link::InsertText, emote.first.string));
|
||||
}
|
||||
} else {
|
||||
builder.emplace<TextElement>("no emotes available",
|
||||
MessageElementFlag::Text,
|
||||
MessageColor::System);
|
||||
}
|
||||
|
||||
return builder.release();
|
||||
|
@ -139,6 +145,16 @@ void EmotePopup::loadChannel(ChannelPtr _channel)
|
|||
this->globalEmotesView_->setChannel(globalChannel);
|
||||
this->subEmotesView_->setChannel(subChannel);
|
||||
this->channelEmotesView_->setChannel(channelChannel);
|
||||
|
||||
if (subChannel->getMessageSnapshot().getLength() == 0) {
|
||||
MessageBuilder builder;
|
||||
builder->flags.set(MessageFlag::Centered);
|
||||
builder->flags.set(MessageFlag::DisableCompactEmotes);
|
||||
builder.emplace<TextElement>("no subscription emotes available",
|
||||
MessageElementFlag::Text,
|
||||
MessageColor::System);
|
||||
subChannel->addMessage(builder.release());
|
||||
}
|
||||
}
|
||||
|
||||
void EmotePopup::loadEmojis()
|
||||
|
|
|
@ -173,9 +173,9 @@ void SplitHeader::initializeLayout()
|
|||
std::unique_ptr<QMenu> SplitHeader::createMainMenu()
|
||||
{
|
||||
auto menu = std::make_unique<QMenu>();
|
||||
menu->addAction("New split", this->split_, &Split::addSibling,
|
||||
menu->addAction("Add new", this->split_, &Split::addSibling,
|
||||
QKeySequence("Ctrl+T"));
|
||||
menu->addAction("Close split", this->split_, &Split::deleteFromContainer,
|
||||
menu->addAction("Close", this->split_, &Split::deleteFromContainer,
|
||||
QKeySequence("Ctrl+W"));
|
||||
menu->addAction("Change channel", this->split_, &Split::changeChannel,
|
||||
QKeySequence("Ctrl+R"));
|
||||
|
|
Loading…
Reference in a new issue