summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2023-12-04 20:19:02 -0500
committerouwou <26526779+ouwou@users.noreply.github.com>2023-12-04 20:19:02 -0500
commite21b678220ce6ca7712a46ee9fe674320e148bab (patch)
treee07ca6ea7c0660e92aafe5a33410ed9589ae38f9 /src
parent2625f6e4207d2ec3f45629208181f49564dca9aa (diff)
downloadabaddon-portaudio-e21b678220ce6ca7712a46ee9fe674320e148bab.tar.gz
abaddon-portaudio-e21b678220ce6ca7712a46ee9fe674320e148bab.zip
get link color from theme
Diffstat (limited to 'src')
-rw-r--r--src/components/chatmessage.cpp5
-rw-r--r--src/settings.cpp2
-rw-r--r--src/settings.hpp1
3 files changed, 3 insertions, 5 deletions
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("<b>" + Glib::Markup::escape_text(*embed.Title) + "</b>");
}
@@ -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" };