Skip to content

Commit

Permalink
Merge branch 'master' into feature/clickable-raid-entry-username
Browse files Browse the repository at this point in the history
  • Loading branch information
pajlada authored Oct 19, 2024
2 parents d083c42 + dab97b3 commit 9402284
Show file tree
Hide file tree
Showing 20 changed files with 3,386 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- Major: Add option to show pronouns in user card. (#5442, #5583)
- Major: Release plugins alpha. (#5288)
- Major: Improve high-DPI support on Windows. (#4868, #5391)
- Major: Added transparent overlay window (default keybind: <kbd>CTRL</kbd> + <kbd>ALT</kbd> + <kbd>N</kbd>). (#4746, #5643)
- 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: Moved tab visibility control to a submenu, without any toggle actions. (#5530)
Expand Down Expand Up @@ -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)
- Dev: Added more tests for message building. (#5598, #5654, #5656)
- 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)
Expand Down
1 change: 1 addition & 0 deletions src/singletons/helper/GifTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ void GIFTimer::initialize()

QObject::connect(&this->timer, &QTimer::timeout, [this] {
if (getSettings()->animationsWhenFocused &&
this->openOverlayWindows_ == 0 &&
QApplication::activeWindow() == nullptr)
{
return;
Expand Down
12 changes: 12 additions & 0 deletions src/singletons/helper/GifTimer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,21 @@ class GIFTimer
return this->position_;
}

void registerOpenOverlayWindow()
{
this->openOverlayWindows_++;
}

void unregisterOpenOverlayWindow()
{
assert(this->openOverlayWindows_ >= 1);
this->openOverlayWindows_--;
}

private:
QTimer timer;
long unsigned position_{};
size_t openOverlayWindows_ = 0;
};

} // namespace chatterino
3 changes: 3 additions & 0 deletions src/widgets/OverlayWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "common/FlagsEnum.hpp"
#include "common/Literals.hpp"
#include "controllers/hotkeys/HotkeyController.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/Settings.hpp"
#include "singletons/WindowManager.hpp"
#include "widgets/BaseWidget.hpp"
Expand Down Expand Up @@ -166,13 +167,15 @@ OverlayWindow::OverlayWindow(IndirectChannel channel,

this->addShortcuts();
this->triggerFirstActivation();
getApp()->getEmotes()->getGIFTimer().registerOpenOverlayWindow();
}

OverlayWindow::~OverlayWindow()
{
#ifdef Q_OS_WIN
::DestroyCursor(this->sizeAllCursor_);
#endif
getApp()->getEmotes()->getGIFTimer().unregisterOpenOverlayWindow();
}

void OverlayWindow::applyTheme()
Expand Down
255 changes: 255 additions & 0 deletions tests/snapshots/IrcMessageHandler/announcement.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
{
"input": "@badge-info=subscriber/47;badges=broadcaster/1,subscriber/3012,twitchconAmsterdam2020/1;color=#FF0000;display-name=Supinic;emotes=;flags=;id=8c26e1ab-b50c-4d9d-bc11-3fd57a941d90;login=supinic;mod=0;msg-id=announcement;msg-param-color=PRIMARY;room-id=11148817;subscriber=1;system-msg=;tmi-sent-ts=1648762219962;user-id=31400525;user-type= :tmi.twitch.tv USERNOTICE #pajlada :mm test lol",
"output": [
{
"badgeInfos": {
"subscriber": "47"
},
"badges": [
"broadcaster",
"subscriber",
"twitchconAmsterdam2020"
],
"channelName": "pajlada",
"count": 1,
"displayName": "Supinic",
"elements": [
{
"color": "System",
"flags": "ChannelName",
"link": {
"type": "JumpToChannel",
"value": "pajlada"
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"#pajlada"
]
},
{
"element": {
"color": "System",
"flags": "Timestamp",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"21:30"
]
},
"flags": "Timestamp",
"format": "",
"link": {
"type": "None",
"value": ""
},
"time": "21:30:19",
"tooltip": "",
"trailingSpace": true,
"type": "TimestampElement"
},
{
"flags": "ModeratorTools",
"link": {
"type": "None",
"value": ""
},
"tooltip": "",
"trailingSpace": true,
"type": "TwitchModerationElement"
},
{
"emote": {
"images": {
"1x": "https://static-cdn.jtvnw.net/badges/v1/5527c58c-fb7d-422d-b71b-f309dcb85cc1/1",
"2x": "https://static-cdn.jtvnw.net/badges/v1/5527c58c-fb7d-422d-b71b-f309dcb85cc1/2",
"3x": "https://static-cdn.jtvnw.net/badges/v1/5527c58c-fb7d-422d-b71b-f309dcb85cc1/3"
},
"name": "",
"tooltip": "Broadcaster"
},
"flags": "BadgeChannelAuthority",
"link": {
"type": "None",
"value": ""
},
"tooltip": "Broadcaster",
"trailingSpace": true,
"type": "BadgeElement"
},
{
"emote": {
"homePage": "https://www.twitchcon.com/amsterdam/?utm_source=twitch-chat&utm_medium=badge&utm_campaign=tcamsterdam20",
"images": {
"1x": "https://static-cdn.jtvnw.net/badges/v1/ed917c9a-1a45-4340-9c64-ca8be4348c51/1",
"2x": "https://static-cdn.jtvnw.net/badges/v1/ed917c9a-1a45-4340-9c64-ca8be4348c51/2",
"3x": "https://static-cdn.jtvnw.net/badges/v1/ed917c9a-1a45-4340-9c64-ca8be4348c51/3"
},
"name": "",
"tooltip": "TwitchCon 2020 - Amsterdam"
},
"flags": "BadgeVanity",
"link": {
"type": "None",
"value": ""
},
"tooltip": "TwitchCon 2020 - Amsterdam",
"trailingSpace": true,
"type": "BadgeElement"
},
{
"color": "#ffff0000",
"flags": "Username",
"link": {
"type": "UserInfo",
"value": "Supinic"
},
"style": "ChatMediumBold",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"Supinic:"
]
},
{
"color": "Text",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"mm"
]
},
{
"color": "Text",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"test"
]
},
{
"color": "Text",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"lol"
]
},
{
"background": "#ffa0a0a4",
"flags": "ReplyButton",
"link": {
"type": "ReplyToMessage",
"value": "8c26e1ab-b50c-4d9d-bc11-3fd57a941d90"
},
"padding": 2,
"tooltip": "",
"trailingSpace": true,
"type": "CircularImageElement",
"url": ""
}
],
"flags": "Collapsed|Subscription",
"id": "8c26e1ab-b50c-4d9d-bc11-3fd57a941d90",
"localizedName": "",
"loginName": "supinic",
"messageText": "mm test lol",
"searchText": "supinic supinic: mm test lol ",
"serverReceivedTime": "2022-03-31T21:30:19Z",
"timeoutUser": "",
"usernameColor": "#ffff0000"
},
{
"badgeInfos": {
},
"badges": [
],
"channelName": "",
"count": 1,
"displayName": "",
"elements": [
{
"element": {
"color": "System",
"flags": "Timestamp",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"21:30"
]
},
"flags": "Timestamp",
"format": "",
"link": {
"type": "None",
"value": ""
},
"time": "21:30:19",
"tooltip": "",
"trailingSpace": true,
"type": "TimestampElement"
},
{
"color": "System",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"Announcement"
]
}
],
"flags": "System|DoNotTriggerNotification|Subscription",
"id": "",
"localizedName": "",
"loginName": "",
"messageText": "Announcement",
"searchText": "Announcement",
"serverReceivedTime": "",
"timeoutUser": "",
"usernameColor": "#ff000000"
}
]
}
Loading

0 comments on commit 9402284

Please sign in to comment.