mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Compare commits
14 commits
f585fd8976
...
69c87652ab
Author | SHA1 | Date | |
---|---|---|---|
69c87652ab | |||
867e3f3ab0 | |||
439d21d009 | |||
8d9617df96 | |||
16042e7f8a | |||
d4c1ef5f80 | |||
5b2341aaa0 | |||
2d93ceed67 | |||
50b2decd1b | |||
2a9b8e15c4 | |||
e9bebfe788 | |||
5e25722d9a | |||
b38bfd4feb | |||
cd2ab5e0cd |
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
- Major: Add option to show pronouns in user card. (#5442, #5583)
|
- Major: Add option to show pronouns in user card. (#5442, #5583)
|
||||||
- Major: Release plugins alpha. (#5288)
|
- Major: Release plugins alpha. (#5288)
|
||||||
- Major: Improve high-DPI support on Windows. (#4868, #5391, #5664)
|
- 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)
|
- 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: 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)
|
||||||
|
|
|
@ -9,6 +9,8 @@ namespace {
|
||||||
|
|
||||||
} // 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_HIGHLIGHT_COLOR = QColor(127, 63, 73, 127);
|
||||||
QColor HighlightPhrase::FALLBACK_SELF_MESSAGE_HIGHLIGHT_COLOR =
|
QColor HighlightPhrase::FALLBACK_SELF_MESSAGE_HIGHLIGHT_COLOR =
|
||||||
QColor(0, 118, 221, 115);
|
QColor(0, 118, 221, 115);
|
||||||
|
|
|
@ -877,10 +877,13 @@ bool BaseWindow::nativeEvent(const QByteArray &eventType, void *message,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_DPICHANGED: {
|
case WM_DPICHANGED: {
|
||||||
// wait for Qt to process this message
|
if (this->flags_.has(ClearBuffersOnDpiChange))
|
||||||
postToThread([] {
|
{
|
||||||
getApp()->getWindows()->invalidateChannelViewBuffers();
|
// wait for Qt to process this message
|
||||||
});
|
postToThread([] {
|
||||||
|
getApp()->getWindows()->invalidateChannelViewBuffers();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ public:
|
||||||
Dialog = 1 << 6,
|
Dialog = 1 << 6,
|
||||||
DisableLayoutSave = 1 << 7,
|
DisableLayoutSave = 1 << 7,
|
||||||
BoundsCheckOnShow = 1 << 8,
|
BoundsCheckOnShow = 1 << 8,
|
||||||
|
ClearBuffersOnDpiChange = 1 << 9,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ActionOnFocusLoss { Nothing, Delete, Close, Hide };
|
enum ActionOnFocusLoss { Nothing, Delete, Close, Hide };
|
||||||
|
|
|
@ -36,9 +36,9 @@ namespace {
|
||||||
|
|
||||||
DraggablePopup::DraggablePopup(bool closeAutomatically, QWidget *parent)
|
DraggablePopup::DraggablePopup(bool closeAutomatically, QWidget *parent)
|
||||||
: BaseWindow(
|
: BaseWindow(
|
||||||
closeAutomatically
|
(closeAutomatically ? popupFlagsCloseAutomatically : popupFlags) |
|
||||||
? popupFlagsCloseAutomatically | BaseWindow::DisableLayoutSave
|
BaseWindow::DisableLayoutSave |
|
||||||
: popupFlags | BaseWindow::DisableLayoutSave,
|
BaseWindow::ClearBuffersOnDpiChange,
|
||||||
parent)
|
parent)
|
||||||
, lifetimeHack_(std::make_shared<bool>(false))
|
, lifetimeHack_(std::make_shared<bool>(false))
|
||||||
, dragTimer_(this)
|
, dragTimer_(this)
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "singletons/Emotes.hpp"
|
#include "singletons/Emotes.hpp"
|
||||||
#include "singletons/Settings.hpp"
|
#include "singletons/Settings.hpp"
|
||||||
#include "singletons/WindowManager.hpp"
|
#include "singletons/WindowManager.hpp"
|
||||||
|
#include "util/PostToThread.hpp"
|
||||||
#include "widgets/BaseWidget.hpp"
|
#include "widgets/BaseWidget.hpp"
|
||||||
#include "widgets/helper/ChannelView.hpp"
|
#include "widgets/helper/ChannelView.hpp"
|
||||||
#include "widgets/helper/InvisibleSizeGrip.hpp"
|
#include "widgets/helper/InvisibleSizeGrip.hpp"
|
||||||
|
@ -312,6 +313,13 @@ bool OverlayWindow::nativeEvent(const QByteArray &eventType, void *message,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
# endif
|
# endif
|
||||||
|
case WM_DPICHANGED: {
|
||||||
|
// wait for Qt to process this message, same as in BaseWindow
|
||||||
|
postToThread([] {
|
||||||
|
getApp()->getWindows()->invalidateChannelViewBuffers();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return QWidget::nativeEvent(eventType, message, result);
|
return QWidget::nativeEvent(eventType, message, result);
|
||||||
|
|
|
@ -52,7 +52,9 @@
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
|
|
||||||
Window::Window(WindowType type, QWidget *parent)
|
Window::Window(WindowType type, QWidget *parent)
|
||||||
: BaseWindow(BaseWindow::EnableCustomFrame, parent)
|
: BaseWindow(
|
||||||
|
{BaseWindow::EnableCustomFrame, BaseWindow::ClearBuffersOnDpiChange},
|
||||||
|
parent)
|
||||||
, type_(type)
|
, type_(type)
|
||||||
, notebook_(new SplitNotebook(this))
|
, notebook_(new SplitNotebook(this))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1190,11 +1190,13 @@ void ChannelView::messageAppended(MessagePtr &message,
|
||||||
(this->channel_->getType() == Channel::Type::TwitchAutomod &&
|
(this->channel_->getType() == Channel::Type::TwitchAutomod &&
|
||||||
getSettings()->enableAutomodHighlight))
|
getSettings()->enableAutomodHighlight))
|
||||||
{
|
{
|
||||||
this->tabHighlightRequested.invoke(HighlightState::Highlighted);
|
this->tabHighlightRequested.invoke(HighlightState::Highlighted,
|
||||||
|
message->highlightColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->tabHighlightRequested.invoke(HighlightState::NewMessage);
|
this->tabHighlightRequested.invoke(HighlightState::NewMessage,
|
||||||
|
nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "widgets/TooltipWidget.hpp"
|
#include "widgets/TooltipWidget.hpp"
|
||||||
|
|
||||||
#include <pajlada/signals/signal.hpp>
|
#include <pajlada/signals/signal.hpp>
|
||||||
|
#include <QColor>
|
||||||
#include <QGestureEvent>
|
#include <QGestureEvent>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QPaintEvent>
|
#include <QPaintEvent>
|
||||||
|
@ -21,6 +22,7 @@
|
||||||
#include <QWheelEvent>
|
#include <QWheelEvent>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
|
@ -214,7 +216,8 @@ public:
|
||||||
|
|
||||||
pajlada::Signals::Signal<QMouseEvent *> mouseDown;
|
pajlada::Signals::Signal<QMouseEvent *> mouseDown;
|
||||||
pajlada::Signals::NoArgSignal selectionChanged;
|
pajlada::Signals::NoArgSignal selectionChanged;
|
||||||
pajlada::Signals::Signal<HighlightState> tabHighlightRequested;
|
pajlada::Signals::Signal<HighlightState, std::shared_ptr<QColor>>
|
||||||
|
tabHighlightRequested;
|
||||||
pajlada::Signals::NoArgSignal liveStatusChanged;
|
pajlada::Signals::NoArgSignal liveStatusChanged;
|
||||||
pajlada::Signals::Signal<const Link &> linkClicked;
|
pajlada::Signals::Signal<const Link &> linkClicked;
|
||||||
pajlada::Signals::Signal<QString, FromTwitchLinkOpenChannelIn>
|
pajlada::Signals::Signal<QString, FromTwitchLinkOpenChannelIn>
|
||||||
|
|
|
@ -307,6 +307,7 @@ void NotebookTab::setSelected(bool value)
|
||||||
this->selected_ = value;
|
this->selected_ = value;
|
||||||
|
|
||||||
this->highlightState_ = HighlightState::None;
|
this->highlightState_ = HighlightState::None;
|
||||||
|
this->highlightColor_ = nullptr;
|
||||||
|
|
||||||
this->update();
|
this->update();
|
||||||
}
|
}
|
||||||
|
@ -397,6 +398,15 @@ bool NotebookTab::hasHighlightsEnabled() const
|
||||||
return this->highlightEnabled_;
|
return this->highlightEnabled_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NotebookTab::setHighlightColor(std::shared_ptr<QColor> color)
|
||||||
|
{
|
||||||
|
if (this->highlightColor_ != color)
|
||||||
|
{
|
||||||
|
this->highlightColor_ = color;
|
||||||
|
this->update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QRect NotebookTab::getDesiredRect() const
|
QRect NotebookTab::getDesiredRect() const
|
||||||
{
|
{
|
||||||
return QRect(this->positionAnimationDesiredPoint_, size());
|
return QRect(this->positionAnimationDesiredPoint_, size());
|
||||||
|
@ -499,6 +509,14 @@ void NotebookTab::paintEvent(QPaintEvent *)
|
||||||
: (windowFocused ? colors.line.regular
|
: (windowFocused ? colors.line.regular
|
||||||
: colors.line.unfocused);
|
: colors.line.unfocused);
|
||||||
|
|
||||||
|
if (this->highlightState_ == HighlightState::Highlighted &&
|
||||||
|
this->highlightColor_ != nullptr)
|
||||||
|
{
|
||||||
|
QColor col = *this->highlightColor_;
|
||||||
|
col.setAlpha(255);
|
||||||
|
lineColor = col;
|
||||||
|
}
|
||||||
|
|
||||||
QRect lineRect;
|
QRect lineRect;
|
||||||
switch (this->tabLocation_)
|
switch (this->tabLocation_)
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#include <pajlada/settings/setting.hpp>
|
#include <pajlada/settings/setting.hpp>
|
||||||
#include <pajlada/signals/signalholder.hpp>
|
#include <pajlada/signals/signalholder.hpp>
|
||||||
|
#include <QColor>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QPropertyAnimation>
|
#include <QPropertyAnimation>
|
||||||
|
|
||||||
|
@ -64,6 +65,7 @@ public:
|
||||||
|
|
||||||
void setHighlightsEnabled(const bool &newVal);
|
void setHighlightsEnabled(const bool &newVal);
|
||||||
bool hasHighlightsEnabled() const;
|
bool hasHighlightsEnabled() const;
|
||||||
|
void setHighlightColor(std::shared_ptr<QColor> color);
|
||||||
|
|
||||||
void moveAnimated(QPoint targetPos, bool animated = true);
|
void moveAnimated(QPoint targetPos, bool animated = true);
|
||||||
|
|
||||||
|
@ -127,6 +129,7 @@ private:
|
||||||
HighlightState highlightState_ = HighlightState::None;
|
HighlightState highlightState_ = HighlightState::None;
|
||||||
bool highlightEnabled_ = true;
|
bool highlightEnabled_ = true;
|
||||||
QAction *highlightNewMessagesAction_;
|
QAction *highlightNewMessagesAction_;
|
||||||
|
std::shared_ptr<QColor> highlightColor_;
|
||||||
|
|
||||||
bool isLive_{};
|
bool isLive_{};
|
||||||
bool isRerun_{};
|
bool isRerun_{};
|
||||||
|
|
|
@ -213,13 +213,19 @@ void SplitContainer::addSplit(Split *split)
|
||||||
|
|
||||||
auto &&conns = this->connectionsPerSplit_[split];
|
auto &&conns = this->connectionsPerSplit_[split];
|
||||||
|
|
||||||
conns.managedConnect(split->getChannelView().tabHighlightRequested,
|
conns.managedConnect(
|
||||||
[this](HighlightState state) {
|
split->getChannelView().tabHighlightRequested,
|
||||||
if (this->tab_ != nullptr)
|
[this](HighlightState state, std::shared_ptr<QColor> color) {
|
||||||
{
|
if (this->tab_ != nullptr)
|
||||||
this->tab_->setHighlightState(state);
|
{
|
||||||
}
|
this->tab_->setHighlightState(state);
|
||||||
});
|
|
||||||
|
if (color != nullptr)
|
||||||
|
{
|
||||||
|
this->tab_->setHighlightColor(color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
conns.managedConnect(split->getChannelView().liveStatusChanged, [this]() {
|
conns.managedConnect(split->getChannelView().liveStatusChanged, [this]() {
|
||||||
this->refreshTabLiveStatus();
|
this->refreshTabLiveStatus();
|
||||||
|
|
Loading…
Reference in a new issue