diff --git a/src/components/chatmessage.cpp b/src/components/chatmessage.cpp index d884077..4b195aa 100644 --- a/src/components/chatmessage.cpp +++ b/src/components/chatmessage.cpp @@ -361,7 +361,7 @@ Gtk::Widget *ChatMessageItemContainer::CreateEmbedComponent(const EmbedData &emb } return false; }); - static auto color = Abaddon::Get().GetSettings().LinkColor; + const auto color = title_label->get_style_context()->get_color(Gtk::STATE_FLAG_LINK); title_label->override_color(Gdk::RGBA(color)); title_label->set_markup("" + Glib::Markup::escape_text(*embed.Title) + ""); } @@ -852,7 +852,8 @@ void ChatMessageItemContainer::HandleLinks(Gtk::TextView &tv) { std::string link = match.fetch(0); auto tag = buf->create_tag(); m_link_tagmap[tag] = link; - tag->property_foreground_rgba() = Gdk::RGBA(Abaddon::Get().GetSettings().LinkColor); + const auto color = tv.get_style_context()->get_color(Gtk::STATE_FLAG_LINK); + tag->property_foreground_rgba() = color; tag->set_property("underline", 1); // stupid workaround for vcpkg bug (i think) const auto chars_start = g_utf8_pointer_to_offset(text.c_str(), text.c_str() + mstart); diff --git a/src/settings.cpp b/src/settings.cpp index c824a34..368d5bb 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -68,7 +68,6 @@ void SettingsManager::ReadSettings() { SMINT("http", "concurrent", CacheHTTPConcurrency); SMSTR("http", "user_agent", UserAgent); SMSTR("style", "expandercolor", ChannelsExpanderColor); - SMSTR("style", "linkcolor", LinkColor); SMSTR("style", "nsfwchannelcolor", NSFWChannelColor); SMSTR("style", "channelcolor", ChannelColor); SMSTR("style", "mentionbadgecolor", MentionBadgeColor); @@ -159,7 +158,6 @@ void SettingsManager::Close() { SMINT("http", "concurrent", CacheHTTPConcurrency); SMSTR("http", "user_agent", UserAgent); SMSTR("style", "expandercolor", ChannelsExpanderColor); - SMSTR("style", "linkcolor", LinkColor); SMSTR("style", "nsfwchannelcolor", NSFWChannelColor); SMSTR("style", "channelcolor", ChannelColor); SMSTR("style", "mentionbadgecolor", MentionBadgeColor); diff --git a/src/settings.hpp b/src/settings.hpp index 037233b..67ba515 100644 --- a/src/settings.hpp +++ b/src/settings.hpp @@ -39,7 +39,6 @@ public: // [style] // TODO: convert to StyleProperty... or maybe not? i still cant figure out what the "correct" method is for this - std::string LinkColor { "rgba(40, 200, 180, 255)" }; std::string ChannelsExpanderColor { "rgba(255, 83, 112, 255)" }; std::string NSFWChannelColor { "#ed6666" }; std::string ChannelColor { "#fbfbfb" };