mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Compare commits
14 commits
6c718d58bd
...
24d8144d65
Author | SHA1 | Date | |
---|---|---|---|
|
24d8144d65 | ||
|
18c4815ad7 | ||
|
439d21d009 | ||
|
8d9617df96 | ||
|
16042e7f8a | ||
|
d4c1ef5f80 | ||
|
5b2341aaa0 | ||
|
2d93ceed67 | ||
|
50b2decd1b | ||
|
2a9b8e15c4 | ||
|
e9bebfe788 | ||
|
5e25722d9a | ||
|
b38bfd4feb | ||
|
cd2ab5e0cd |
17 changed files with 194 additions and 12 deletions
|
@ -7,7 +7,7 @@
|
|||
- Major: Improve high-DPI support on Windows. (#4868, #5391, #5664, #5666)
|
||||
- Major: Added transparent overlay window (default keybind: <kbd>CTRL</kbd> + <kbd>ALT</kbd> + <kbd>N</kbd>). (#4746, #5643, #5659)
|
||||
- Minor: Removed the Ctrl+Shift+L hotkey for toggling the "live only" tab visibility state. (#5530)
|
||||
- Minor: Add support for Shared Chat messages. Shared chat messages can be filtered with the `flags.shared` filter variable, or with search using `is:shared`. Some messages like subscriptions are filtered on purpose to avoid confusion for the broadcaster. If you have both channels participating in Shared Chat open, only one of the message triggering your highlight will trigger. (#5606, #5625)
|
||||
- Minor: Add support for Shared Chat messages. Shared chat messages can be filtered with the `flags.shared` filter variable, or with search using `is:shared`. Some messages like subscriptions are filtered on purpose to avoid confusion for the broadcaster. If you have both channels participating in Shared Chat open, only one of the message triggering your highlight will trigger. (#5606, #5625, #5661)
|
||||
- Minor: Moved tab visibility control to a submenu, without any toggle actions. (#5530)
|
||||
- Minor: Add option to customise Moderation buttons with images. (#5369)
|
||||
- Minor: Colored usernames now update on the fly when changing the "Color @usernames" setting. (#5300)
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "common/Args.hpp"
|
||||
#include "mocks/DisabledStreamerMode.hpp"
|
||||
#include "mocks/EmptyApplication.hpp"
|
||||
#include "mocks/TwitchUsers.hpp"
|
||||
#include "providers/bttv/BttvLiveUpdates.hpp"
|
||||
#include "singletons/Fonts.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
|
@ -55,6 +56,11 @@ public:
|
|||
return &this->fonts;
|
||||
}
|
||||
|
||||
ITwitchUsers *getTwitchUsers() override
|
||||
{
|
||||
return &this->twitchUsers;
|
||||
}
|
||||
|
||||
BttvLiveUpdates *getBttvLiveUpdates() override
|
||||
{
|
||||
return nullptr;
|
||||
|
@ -71,6 +77,7 @@ public:
|
|||
DisabledStreamerMode streamerMode;
|
||||
Theme theme;
|
||||
Fonts fonts;
|
||||
TwitchUsers twitchUsers;
|
||||
};
|
||||
|
||||
} // namespace chatterino::mock
|
||||
|
|
24
mocks/include/mocks/TwitchUsers.hpp
Normal file
24
mocks/include/mocks/TwitchUsers.hpp
Normal file
|
@ -0,0 +1,24 @@
|
|||
#pragma once
|
||||
|
||||
#include "providers/twitch/TwitchUser.hpp"
|
||||
#include "providers/twitch/TwitchUsers.hpp"
|
||||
|
||||
namespace chatterino::mock {
|
||||
|
||||
class TwitchUsers : public ITwitchUsers
|
||||
{
|
||||
public:
|
||||
TwitchUsers() = default;
|
||||
|
||||
std::shared_ptr<TwitchUser> resolveID(const UserId &id)
|
||||
{
|
||||
TwitchUser u = {
|
||||
.id = id.string,
|
||||
.name = {},
|
||||
.displayName = {},
|
||||
};
|
||||
return std::make_shared<TwitchUser>(u);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace chatterino::mock
|
BIN
resources/twitch/sharedChat.png
Normal file
BIN
resources/twitch/sharedChat.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1 KiB |
|
@ -9,6 +9,8 @@ namespace {
|
|||
|
||||
} // namespace
|
||||
|
||||
// change made but removed in merge conflict
|
||||
// QColor HighlightPhrase::FALLBACK_HIGHLIGHT_COLOR = QColor(238, 97, 102, 65);
|
||||
QColor HighlightPhrase::FALLBACK_HIGHLIGHT_COLOR = QColor(127, 63, 73, 127);
|
||||
QColor HighlightPhrase::FALLBACK_SELF_MESSAGE_HIGHLIGHT_COLOR =
|
||||
QColor(0, 118, 221, 115);
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "providers/twitch/TwitchChannel.hpp"
|
||||
#include "providers/twitch/TwitchIrc.hpp"
|
||||
#include "providers/twitch/TwitchIrcServer.hpp"
|
||||
#include "providers/twitch/TwitchUsers.hpp"
|
||||
#include "singletons/Emotes.hpp"
|
||||
#include "singletons/Resources.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
|
@ -380,6 +381,18 @@ EmotePtr makeAutoModBadge()
|
|||
Url{"https://dashboard.twitch.tv/settings/moderation/automod"}});
|
||||
}
|
||||
|
||||
EmotePtr makeSharedChatBadge(const QString &sourceName)
|
||||
{
|
||||
return std::make_shared<Emote>(Emote{
|
||||
.name = EmoteName{},
|
||||
.images = ImageSet{Image::fromResourcePixmap(
|
||||
getResources().twitch.sharedChat, 0.25)},
|
||||
.tooltip = Tooltip{"Shared Message" +
|
||||
(sourceName.isEmpty() ? "" : " from " + sourceName)},
|
||||
.homePage = Url{"https://link.twitch.tv/SharedChatViewer"},
|
||||
});
|
||||
}
|
||||
|
||||
std::tuple<std::optional<EmotePtr>, MessageElementFlags, bool> parseEmote(
|
||||
TwitchChannel *twitchChannel, const EmoteName &name)
|
||||
{
|
||||
|
@ -2751,6 +2764,28 @@ void MessageBuilder::appendTwitchBadges(const QVariantMap &tags,
|
|||
return;
|
||||
}
|
||||
|
||||
if (this->message().flags.has(MessageFlag::SharedMessage))
|
||||
{
|
||||
const QString sourceId = tags["source-room-id"].toString();
|
||||
QString sourceName;
|
||||
if (sourceId.isEmpty())
|
||||
{
|
||||
sourceName = "";
|
||||
}
|
||||
else if (twitchChannel->roomId() == sourceId)
|
||||
{
|
||||
sourceName = twitchChannel->getName();
|
||||
}
|
||||
else
|
||||
{
|
||||
sourceName =
|
||||
getApp()->getTwitchUsers()->resolveID({sourceId})->displayName;
|
||||
}
|
||||
|
||||
this->emplace<BadgeElement>(makeSharedChatBadge(sourceName),
|
||||
MessageElementFlag::BadgeSharedChannel);
|
||||
}
|
||||
|
||||
auto badgeInfos = parseBadgeInfoTag(tags);
|
||||
auto badges = parseBadgeTag(tags);
|
||||
appendBadges(this, badges, badgeInfos, twitchChannel);
|
||||
|
|
|
@ -66,6 +66,10 @@ enum class MessageElementFlag : int64_t {
|
|||
BitsStatic = (1LL << 11),
|
||||
BitsAnimated = (1LL << 12),
|
||||
|
||||
// Slot 0: Twitch
|
||||
// - Shared Channel indicator badge
|
||||
BadgeSharedChannel = (1LL << 37),
|
||||
|
||||
// Slot 1: Twitch
|
||||
// - Staff badge
|
||||
// - Admin badge
|
||||
|
@ -119,7 +123,7 @@ enum class MessageElementFlag : int64_t {
|
|||
|
||||
Badges = BadgeGlobalAuthority | BadgePredictions | BadgeChannelAuthority |
|
||||
BadgeSubscription | BadgeVanity | BadgeChatterino | BadgeSevenTV |
|
||||
BadgeFfz,
|
||||
BadgeFfz | BadgeSharedChannel,
|
||||
|
||||
ChannelName = (1LL << 20),
|
||||
|
||||
|
|
|
@ -195,6 +195,7 @@ void WindowManager::updateWordTypeMask()
|
|||
flags.set(settings->animateEmotes ? MEF::BitsAnimated : MEF::BitsStatic);
|
||||
|
||||
// badges
|
||||
flags.set(MEF::BadgeSharedChannel);
|
||||
flags.set(settings->showBadgesGlobalAuthority ? MEF::BadgeGlobalAuthority
|
||||
: MEF::None);
|
||||
flags.set(settings->showBadgesPredictions ? MEF::BadgePredictions
|
||||
|
|
|
@ -1190,11 +1190,13 @@ void ChannelView::messageAppended(MessagePtr &message,
|
|||
(this->channel_->getType() == Channel::Type::TwitchAutomod &&
|
||||
getSettings()->enableAutomodHighlight))
|
||||
{
|
||||
this->tabHighlightRequested.invoke(HighlightState::Highlighted);
|
||||
this->tabHighlightRequested.invoke(HighlightState::Highlighted,
|
||||
message->highlightColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->tabHighlightRequested.invoke(HighlightState::NewMessage);
|
||||
this->tabHighlightRequested.invoke(HighlightState::NewMessage,
|
||||
nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2408,6 +2410,11 @@ void ChannelView::handleMouseClick(QMouseEvent *event,
|
|||
return;
|
||||
}
|
||||
|
||||
if (link.value.startsWith("id:"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Insert @username into split input
|
||||
const bool commaMention =
|
||||
getSettings()->mentionUsersWithComma;
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "widgets/TooltipWidget.hpp"
|
||||
|
||||
#include <pajlada/signals/signal.hpp>
|
||||
#include <QColor>
|
||||
#include <QGestureEvent>
|
||||
#include <QMenu>
|
||||
#include <QPaintEvent>
|
||||
|
@ -21,6 +22,7 @@
|
|||
#include <QWheelEvent>
|
||||
#include <QWidget>
|
||||
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
|
@ -214,7 +216,8 @@ public:
|
|||
|
||||
pajlada::Signals::Signal<QMouseEvent *> mouseDown;
|
||||
pajlada::Signals::NoArgSignal selectionChanged;
|
||||
pajlada::Signals::Signal<HighlightState> tabHighlightRequested;
|
||||
pajlada::Signals::Signal<HighlightState, std::shared_ptr<QColor>>
|
||||
tabHighlightRequested;
|
||||
pajlada::Signals::NoArgSignal liveStatusChanged;
|
||||
pajlada::Signals::Signal<const Link &> linkClicked;
|
||||
pajlada::Signals::Signal<QString, FromTwitchLinkOpenChannelIn>
|
||||
|
|
|
@ -307,6 +307,7 @@ void NotebookTab::setSelected(bool value)
|
|||
this->selected_ = value;
|
||||
|
||||
this->highlightState_ = HighlightState::None;
|
||||
this->highlightColor_ = nullptr;
|
||||
|
||||
this->update();
|
||||
}
|
||||
|
@ -397,6 +398,15 @@ bool NotebookTab::hasHighlightsEnabled() const
|
|||
return this->highlightEnabled_;
|
||||
}
|
||||
|
||||
void NotebookTab::setHighlightColor(std::shared_ptr<QColor> color)
|
||||
{
|
||||
if (this->highlightColor_ != color)
|
||||
{
|
||||
this->highlightColor_ = color;
|
||||
this->update();
|
||||
}
|
||||
}
|
||||
|
||||
QRect NotebookTab::getDesiredRect() const
|
||||
{
|
||||
return QRect(this->positionAnimationDesiredPoint_, size());
|
||||
|
@ -499,6 +509,14 @@ void NotebookTab::paintEvent(QPaintEvent *)
|
|||
: (windowFocused ? colors.line.regular
|
||||
: colors.line.unfocused);
|
||||
|
||||
if (this->highlightState_ == HighlightState::Highlighted &&
|
||||
this->highlightColor_ != nullptr)
|
||||
{
|
||||
QColor col = *this->highlightColor_;
|
||||
col.setAlpha(255);
|
||||
lineColor = col;
|
||||
}
|
||||
|
||||
QRect lineRect;
|
||||
switch (this->tabLocation_)
|
||||
{
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <pajlada/settings/setting.hpp>
|
||||
#include <pajlada/signals/signalholder.hpp>
|
||||
#include <QColor>
|
||||
#include <QMenu>
|
||||
#include <QPropertyAnimation>
|
||||
|
||||
|
@ -64,6 +65,7 @@ public:
|
|||
|
||||
void setHighlightsEnabled(const bool &newVal);
|
||||
bool hasHighlightsEnabled() const;
|
||||
void setHighlightColor(std::shared_ptr<QColor> color);
|
||||
|
||||
void moveAnimated(QPoint targetPos, bool animated = true);
|
||||
|
||||
|
@ -127,6 +129,7 @@ private:
|
|||
HighlightState highlightState_ = HighlightState::None;
|
||||
bool highlightEnabled_ = true;
|
||||
QAction *highlightNewMessagesAction_;
|
||||
std::shared_ptr<QColor> highlightColor_;
|
||||
|
||||
bool isLive_{};
|
||||
bool isRerun_{};
|
||||
|
|
|
@ -213,13 +213,19 @@ void SplitContainer::addSplit(Split *split)
|
|||
|
||||
auto &&conns = this->connectionsPerSplit_[split];
|
||||
|
||||
conns.managedConnect(split->getChannelView().tabHighlightRequested,
|
||||
[this](HighlightState state) {
|
||||
if (this->tab_ != nullptr)
|
||||
{
|
||||
this->tab_->setHighlightState(state);
|
||||
}
|
||||
});
|
||||
conns.managedConnect(
|
||||
split->getChannelView().tabHighlightRequested,
|
||||
[this](HighlightState state, std::shared_ptr<QColor> color) {
|
||||
if (this->tab_ != nullptr)
|
||||
{
|
||||
this->tab_->setHighlightState(state);
|
||||
|
||||
if (color != nullptr)
|
||||
{
|
||||
this->tab_->setHighlightColor(color);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
conns.managedConnect(split->getChannelView().liveStatusChanged, [this]() {
|
||||
this->refreshTabLiveStatus();
|
||||
|
|
|
@ -64,6 +64,24 @@
|
|||
"trailingSpace": true,
|
||||
"type": "TwitchModerationElement"
|
||||
},
|
||||
{
|
||||
"emote": {
|
||||
"homePage": "https://link.twitch.tv/SharedChatViewer",
|
||||
"images": {
|
||||
"1x": ""
|
||||
},
|
||||
"name": "",
|
||||
"tooltip": "Shared Message"
|
||||
},
|
||||
"flags": "BadgeSharedChannel",
|
||||
"link": {
|
||||
"type": "None",
|
||||
"value": ""
|
||||
},
|
||||
"tooltip": "Shared Message",
|
||||
"trailingSpace": true,
|
||||
"type": "BadgeElement"
|
||||
},
|
||||
{
|
||||
"emote": {
|
||||
"homePage": "https://www.twitch.tv/jobs?ref=chat_badge",
|
||||
|
|
|
@ -64,6 +64,24 @@
|
|||
"trailingSpace": true,
|
||||
"type": "TwitchModerationElement"
|
||||
},
|
||||
{
|
||||
"emote": {
|
||||
"homePage": "https://link.twitch.tv/SharedChatViewer",
|
||||
"images": {
|
||||
"1x": ""
|
||||
},
|
||||
"name": "",
|
||||
"tooltip": "Shared Message from twitchdev"
|
||||
},
|
||||
"flags": "BadgeSharedChannel",
|
||||
"link": {
|
||||
"type": "None",
|
||||
"value": ""
|
||||
},
|
||||
"tooltip": "Shared Message from twitchdev",
|
||||
"trailingSpace": true,
|
||||
"type": "BadgeElement"
|
||||
},
|
||||
{
|
||||
"color": "#ffff0000",
|
||||
"flags": "Username",
|
||||
|
|
|
@ -64,6 +64,24 @@
|
|||
"trailingSpace": true,
|
||||
"type": "TwitchModerationElement"
|
||||
},
|
||||
{
|
||||
"emote": {
|
||||
"homePage": "https://link.twitch.tv/SharedChatViewer",
|
||||
"images": {
|
||||
"1x": ""
|
||||
},
|
||||
"name": "",
|
||||
"tooltip": "Shared Message from twitchdev"
|
||||
},
|
||||
"flags": "BadgeSharedChannel",
|
||||
"link": {
|
||||
"type": "None",
|
||||
"value": ""
|
||||
},
|
||||
"tooltip": "Shared Message from twitchdev",
|
||||
"trailingSpace": true,
|
||||
"type": "BadgeElement"
|
||||
},
|
||||
{
|
||||
"emote": {
|
||||
"homePage": "https://www.twitch.tv/jobs?ref=chat_badge",
|
||||
|
|
|
@ -64,6 +64,24 @@
|
|||
"trailingSpace": true,
|
||||
"type": "TwitchModerationElement"
|
||||
},
|
||||
{
|
||||
"emote": {
|
||||
"homePage": "https://link.twitch.tv/SharedChatViewer",
|
||||
"images": {
|
||||
"1x": ""
|
||||
},
|
||||
"name": "",
|
||||
"tooltip": "Shared Message"
|
||||
},
|
||||
"flags": "BadgeSharedChannel",
|
||||
"link": {
|
||||
"type": "None",
|
||||
"value": ""
|
||||
},
|
||||
"tooltip": "Shared Message",
|
||||
"trailingSpace": true,
|
||||
"type": "BadgeElement"
|
||||
},
|
||||
{
|
||||
"emote": {
|
||||
"homePage": "https://www.twitch.tv/jobs?ref=chat_badge",
|
||||
|
|
Loading…
Reference in a new issue