summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2021-01-13 23:16:02 -0500
committerouwou <26526779+ouwou@users.noreply.github.com>2021-01-13 23:16:02 -0500
commitf51ab48009e7fcfafee1d09800764fcbd5d36bf5 (patch)
treed2156ddbe2367a096c58682704cdcb369eb694a5
parent6c4bdb51a3d35542efe377bafb817f9231822d97 (diff)
downloadabaddon-portaudio-f51ab48009e7fcfafee1d09800764fcbd5d36bf5.tar.gz
abaddon-portaudio-f51ab48009e7fcfafee1d09800764fcbd5d36bf5.zip
add css selectors to nsfw channels and add color style
-rw-r--r--README.md1
-rw-r--r--components/channels.cpp4
-rw-r--r--css/main.css4
3 files changed, 9 insertions, 0 deletions
diff --git a/README.md b/README.md
index e340093..b7b6add 100644
--- a/README.md
+++ b/README.md
@@ -65,6 +65,7 @@ Make sure you start from the directory where `css` and `res` are
.channel-row-category - Only rows containing a category
.channel-row-guild - Only rows containing a guild
.channel-row-label - All labels within the channel container
+.nsfw - Applied to channel row label's and their container for NSFW channels
.messages - Container of user messages
.message-container - The container which holds a user's messages
diff --git a/components/channels.cpp b/components/channels.cpp
index 667e138..64613a4 100644
--- a/components/channels.cpp
+++ b/components/channels.cpp
@@ -245,6 +245,10 @@ ChannelListRowChannel::ChannelListRowChannel(const ChannelData *data) {
m_lbl->get_style_context()->add_class("channel-row-label");
auto buf = m_lbl->get_buffer();
+ if (data->IsNSFW.has_value() && *data->IsNSFW) {
+ get_style_context()->add_class("nsfw");
+ m_lbl->get_style_context()->add_class("nsfw");
+ }
buf->set_text("#" + *data->Name);
Abaddon::Get().GetEmojis().ReplaceEmojis(buf, ChannelEmojiSize);
m_box->set_halign(Gtk::ALIGN_START);
diff --git a/css/main.css b/css/main.css
index f4bfec2..d7d4108 100644
--- a/css/main.css
+++ b/css/main.css
@@ -32,6 +32,10 @@
background: rgba(0, 0, 0, 0);
}
+.channel-row-label.nsfw text {
+ color: #ed6666;
+}
+
.channel-row:focus {
background-color: #34495e;
}