diff --git a/CHANGELOG.md b/CHANGELOG.md index 3679a436b..f9bac1953 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unversioned -- Minor: Added placeholder text for message text input box. (#2143) +- Minor: Added placeholder text for message text input box. (#2143, #2149) - Minor: Added support for FrankerFaceZ badges. (#2101, part of #1658) - Minor: Added a navigation list to the settings and reordered them. - Major: Added "Channel Filters". See https://wiki.chatterino.com/Filters/ for how they work or how to configure them. (#1748, #2083) diff --git a/src/BaseTheme.cpp b/src/BaseTheme.cpp index c3179bdb9..4c58ccba2 100644 --- a/src/BaseTheme.cpp +++ b/src/BaseTheme.cpp @@ -156,6 +156,8 @@ void AB_THEME_CLASS::actuallyUpdate(double hue, double multiplier) this->messages.textColors.link = isLight_ ? QColor(66, 134, 244) : QColor(66, 134, 244); this->messages.textColors.system = QColor(140, 127, 127); + this->messages.textColors.chatPlaceholder = + isLight_ ? QColor(175, 159, 159) : QColor(93, 85, 85); this->messages.backgrounds.regular = getColor(0, sat, 1); this->messages.backgrounds.alternate = getColor(0, sat, 0.96); diff --git a/src/BaseTheme.hpp b/src/BaseTheme.hpp index 5b04cf6fe..2d6ee5cdc 100644 --- a/src/BaseTheme.hpp +++ b/src/BaseTheme.hpp @@ -61,6 +61,7 @@ public: QColor caret; QColor link; QColor system; + QColor chatPlaceholder; } textColors; struct { diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index 62323d1a3..2fc2eb012 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -283,6 +283,11 @@ void Split::setContainer(SplitContainer *container) void Split::onAccountSelected() { + if (!this->getChannel()->isTwitchChannel()) + { + return; + } + auto user = getApp()->accounts->twitch.getCurrent(); QString placeholderText; @@ -298,6 +303,19 @@ void Split::onAccountSelected() } this->input_->ui_.textEdit->setPlaceholderText(placeholderText); + + this->updateTooltipColor(); + this->signalHolder_.managedConnect(this->theme->updated, [this]() { + this->updateTooltipColor(); // + }); +} + +void Split::updateTooltipColor() +{ + QPalette dankPalette; + dankPalette.setColor(QPalette::PlaceholderText, + this->theme->messages.textColors.chatPlaceholder); + this->input_->ui_.textEdit->setPalette(dankPalette); } IndirectChannel Split::getIndirectChannel() diff --git a/src/widgets/splits/Split.hpp b/src/widgets/splits/Split.hpp index 491a8eee2..7c60cacd0 100644 --- a/src/widgets/splits/Split.hpp +++ b/src/widgets/splits/Split.hpp @@ -97,6 +97,7 @@ private: void channelNameUpdated(const QString &newChannelName); void handleModifiers(Qt::KeyboardModifiers modifiers); void onAccountSelected(); + void updateTooltipColor(); SplitContainer *container_; IndirectChannel channel_;