Compare commits

...

16 commits

Author SHA1 Message Date
pajlada 0ff71a3a3e
Merge 439d21d009 into 9e8281b75b 2024-10-22 20:43:19 -05:00
dependabot[bot] 9e8281b75b
chore(deps): bump lib/expected-lite from 88ee08e to 5b5caad (#5667) 2024-10-22 22:30:25 +00:00
dependabot[bot] b46a893127
chore(deps): bump lib/settings from c58874c to 4a0a1e5 (#5646) 2024-10-22 21:49:58 +00:00
nerix 55a12fa008
test: add snapshots for raids, timeouts, and notices (#5671) 2024-10-22 21:06:29 +00:00
Rasmus Karlsson 439d21d009
Merge remote-tracking branch 'origin/master' into custom-highlight-color-tabs 2024-08-31 12:52:20 +02:00
Rasmus Karlsson 8d9617df96 Remove unneccesary dereference of the highlightcolor 2022-08-28 12:56:59 +02:00
Rasmus Karlsson 16042e7f8a Change fallback highlight color
This makes the color look almost identical in highlights, but completely identical in tab highlights
2022-08-28 12:56:16 +02:00
Rasmus Karlsson d4c1ef5f80 Merge remote-tracking branch 'origin/master' into custom-highlight-color-tabs 2022-08-28 12:35:20 +02:00
pajlada 5b2341aaa0
Merge branch 'master' into custom-highlight-color-tabs 2020-08-09 06:00:09 -04:00
pajlada 2d93ceed67
Merge branch 'master' into custom-highlight-color-tabs 2020-08-09 05:55:53 -04:00
tuckerrrrrrrrrrrr 50b2decd1b Check tabHighlightRequested color in safer scope
The little bit that set the tab's highlight color never checked whether
the tab was a nullptr or not
i'm a little silly
2020-03-15 07:11:16 -07:00
tuckerrrrrrrrrrrr 2a9b8e15c4 Remove tabHighlightColorRequested signal
Moved the functionality to tabHighlightRequested instead of having two
signals that modify similar things
2020-03-14 09:40:23 -07:00
tuckerrrrrrrrrrrr e9bebfe788 clean up setting tab line color 2020-02-16 10:27:37 -08:00
tuckerrrrrrrrrrrr 5e25722d9a remove pointless condition in setHighlightState
I put it there last night and I think I forgot about it :)
2020-02-16 09:45:11 -08:00
tuckerrrrrrrrrrrr b38bfd4feb fix tab highlighting when focused 2020-02-15 22:40:41 -08:00
tuckerrrrrrrrrrrr cd2ab5e0cd flash highlight color instead of red in channel tab 2020-02-15 21:00:38 -08:00
14 changed files with 598 additions and 13 deletions

View file

@ -104,7 +104,7 @@
- Dev: Added more tests for input completion. (#5604)
- Dev: Refactored legacy Unicode zero-width-joiner replacement. (#5594)
- Dev: The JSON output when copying a message (<kbd>SHIFT</kbd> + right-click) is now more extensive. (#5600)
- Dev: Added more tests for message building. (#5598, #5654, #5656)
- Dev: Added more tests for message building. (#5598, #5654, #5656, #5671)
- Dev: Twitch messages are now sent using Twitch's Helix API instead of IRC by default. (#5607)
- Dev: `GIFTimer` is no longer initialized in tests. (#5608)
- Dev: Emojis now use flags instead of a set of strings for capabilities. (#5616)

@ -1 +1 @@
Subproject commit 88ee08eb3c3f3627ca54b90dafd1d63a6d4da96b
Subproject commit 5b5caad7cd57d5ba3ca796bf1521b131d73ca405

@ -1 +1 @@
Subproject commit c58874c1aa5d0619df2c975bcb87433941b46920
Subproject commit 4a0a1e599377cdcdc91b0fbbefc312936b48730c

View file

@ -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);

View file

@ -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);
}
}

View file

@ -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>

View file

@ -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_)
{

View file

@ -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_{};

View file

@ -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();

View file

@ -0,0 +1,157 @@
{
"input": "@room-id=11148817;rm-received-ts=1729627607652;tmi-sent-ts=1729627607545;historical=1 :tmi.twitch.tv CLEARCHAT #pajlada",
"output": [
{
"badgeInfos": {
},
"badges": [
],
"channelName": "",
"count": 1,
"displayName": "",
"elements": [
{
"element": {
"color": "System",
"flags": "Timestamp",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"20:06"
]
},
"flags": "Timestamp",
"format": "",
"link": {
"type": "None",
"value": ""
},
"time": "20:06:47",
"tooltip": "",
"trailingSpace": true,
"type": "TimestampElement"
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"Chat"
]
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"has"
]
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"been"
]
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"cleared"
]
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"by"
]
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"a"
]
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"moderator."
]
}
],
"flags": "System|DoNotTriggerNotification",
"id": "",
"localizedName": "",
"loginName": "",
"messageText": "Chat has been cleared by a moderator.",
"searchText": "Chat has been cleared by a moderator.",
"serverReceivedTime": "",
"timeoutUser": "",
"usernameColor": "#ff000000"
}
]
}

View file

@ -0,0 +1,157 @@
{
"input": "@historical=1;rm-received-ts=1729627965650;msg-id=emote_only_on :tmi.twitch.tv NOTICE #pajlada :This room is now in emote-only mode.",
"output": [
{
"badgeInfos": {
},
"badges": [
],
"channelName": "",
"count": 1,
"displayName": "",
"elements": [
{
"element": {
"color": "System",
"flags": "Timestamp",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"20:12"
]
},
"flags": "Timestamp",
"format": "",
"link": {
"type": "None",
"value": ""
},
"time": "20:12:45",
"tooltip": "",
"trailingSpace": true,
"type": "TimestampElement"
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"This"
]
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"room"
]
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"is"
]
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"now"
]
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"in"
]
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"emote-only"
]
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"mode."
]
}
],
"flags": "System|DoNotTriggerNotification",
"id": "",
"localizedName": "",
"loginName": "",
"messageText": "This room is now in emote-only mode.",
"searchText": "This room is now in emote-only mode.",
"serverReceivedTime": "",
"timeoutUser": "",
"usernameColor": "#ff000000"
}
]
}

View file

@ -0,0 +1,145 @@
{
"input": "@badges=subscriber/24;login=nerixyz;msg-param-displayName=nerixyz;user-type=;tmi-sent-ts=1729626466361;system-msg=2\\sraiders\\sfrom\\snerixyz\\shave\\sjoined!;room-id=11148817;user-id=129546453;display-name=nerixyz;subscriber=1;historical=1;rm-received-ts=1729626466492;msg-id=raid;vip=0;id=7299b7bc-61ce-423c-85ce-8d651b56cce4;msg-param-login=nerixyz;color=#FF0000;mod=0;msg-param-viewerCount=2;flags=;msg-param-profileImageURL=https://static-cdn.jtvnw.net/jtv_user_pictures/e065218b-49df-459d-afd3-c6557870f551-profile_image-%s.png;emotes=;badge-info=subscriber/28 :tmi.twitch.tv USERNOTICE #pajlada",
"output": [
{
"badgeInfos": {
},
"badges": [
],
"channelName": "",
"count": 1,
"displayName": "",
"elements": [
{
"element": {
"color": "System",
"flags": "Timestamp",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"19:47"
]
},
"flags": "Timestamp",
"format": "",
"link": {
"type": "None",
"value": ""
},
"time": "19:47:46",
"tooltip": "",
"trailingSpace": true,
"type": "TimestampElement"
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"2"
]
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"raiders"
]
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"from"
]
},
{
"color": "Text",
"fallbackColor": "System",
"flags": "Text|Mention",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "MentionElement",
"userColor": "#ffff0000",
"userLoginName": "nerixyz",
"words": [
"nerixyz"
]
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"have"
]
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"joined!"
]
}
],
"flags": "System|DoNotTriggerNotification|Subscription",
"id": "",
"localizedName": "",
"loginName": "",
"messageText": "2 raiders from nerixyz have joined!",
"searchText": "2 raiders from nerixyz have joined!",
"serverReceivedTime": "",
"timeoutUser": "",
"usernameColor": "#ff000000"
}
]
}

View file

@ -0,0 +1,5 @@
{
"input": "@color=#FF0000;emotes=;subscriber=0;msg-id=sharedchatnotice;historical=1;msg-param-profileImageURL=https://static-cdn.jtvnw.net/jtv_user_pictures/e065218b-49df-459d-afd3-c6557870f551-profile_image-%s.png;tmi-sent-ts=1729627237027;rm-received-ts=1729627237138;msg-param-displayName=nerixyz;id=c585cb3e-cb4f-4a48-a251-b568d217587e;display-name=nerixyz;badges=;user-id=129546453;source-id=d86cdfb2-e138-48e2-985f-5b8efb765ba4;source-room-id=955766119;room-id=11148817;user-type=;msg-param-login=nerixyz;flags=;source-badge-info=;mod=0;vip=0;system-msg=2\\sraiders\\sfrom\\snerixyz\\shave\\sjoined!;login=nerixyz;msg-param-viewerCount=2;source-badges=;source-msg-id=raid;badge-info= :tmi.twitch.tv USERNOTICE #pajlada",
"output": [
]
}

View file

@ -0,0 +1,87 @@
{
"input": "@tmi-sent-ts=1729628658012;rm-received-ts=1729628658106;historical=1;ban-duration=1;room-id=11148817;target-user-id=129546453 :tmi.twitch.tv CLEARCHAT #pajlada nerixyz",
"output": [
{
"badgeInfos": {
},
"badges": [
],
"channelName": "",
"count": 1,
"displayName": "",
"elements": [
{
"element": {
"color": "System",
"flags": "Timestamp",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"20:24"
]
},
"flags": "Timestamp",
"format": "",
"link": {
"type": "None",
"value": ""
},
"time": "20:24:18",
"tooltip": "",
"trailingSpace": true,
"type": "TimestampElement"
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "UserInfo",
"value": "nerixyz"
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"nerixyz"
]
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"has",
"been",
"timed",
"out",
"for",
"1s."
]
}
],
"flags": "System|Timeout|DoNotTriggerNotification",
"id": "",
"localizedName": "",
"loginName": "",
"messageText": "nerixyz has been timed out for 1s. ",
"searchText": "nerixyz has been timed out for 1s. ",
"serverReceivedTime": "",
"timeoutUser": "nerixyz",
"usernameColor": "#ff000000"
}
]
}