aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Matrix.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-06-21 06:25:13 +0200
committerdec05eba <dec05eba@protonmail.com>2021-06-21 06:25:17 +0200
commit933ceeabb339cdf0583a8687528941593381a268 (patch)
treee3963cd74eb726a63f6e91f2f22f485fac65084a /src/plugins/Matrix.cpp
parentd137dcfa6dd248ffa94e58e7aef4487682bc12dc (diff)
Add color themeing, (Theme.hpp/Theme.cpp) and the env var QM_THEME
Diffstat (limited to 'src/plugins/Matrix.cpp')
-rw-r--r--src/plugins/Matrix.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index 1e20bf6..9f5faf0 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -8,6 +8,7 @@
#include "../../include/Json.hpp"
#include "../../include/AsyncImageLoader.hpp"
#include "../../include/Utils.hpp"
+#include "../../include/Theme.hpp"
#include <rapidjson/document.h>
#include <rapidjson/writer.h>
#include <rapidjson/stringbuffer.h>
@@ -624,20 +625,20 @@ namespace QuickMedia {
int unread_notification_count = room->unread_notification_count;
if(unread_notification_count > 0 && set_room_as_unread) {
room_desc += "\n** " + std::to_string(unread_notification_count) + " unread mention(s) **"; // TODO: Better notification?
- room->body_item->set_description_color(sf::Color(255, 100, 100));
+ room->body_item->set_description_color(get_current_theme().attention_alert_text_color);
} else {
- room->body_item->set_description_color(sf::Color(179, 179, 179));
+ room->body_item->set_description_color(get_current_theme().faded_text_color);
}
room->body_item->set_description(std::move(room_desc));
if(set_room_as_unread)
- room->body_item->set_title_color(sf::Color(255, 100, 100));
+ room->body_item->set_title_color(get_current_theme().attention_alert_text_color);
room->last_message_read = false;
rooms_page->move_room_to_top(room);
room_tags_page->move_room_to_top(room);
} else if(is_initial_sync) {
room->body_item->set_description(extract_first_line_remove_newline_elipses(matrix->message_get_author_displayname(last_new_message.get()), AUTHOR_MAX_LENGTH) + ": " + message_to_room_description_text(last_new_message.get()));
- room->body_item->set_description_color(sf::Color(179, 179, 179));
+ room->body_item->set_description_color(get_current_theme().faded_text_color);
}
}
@@ -910,7 +911,7 @@ namespace QuickMedia {
body_item->set_author(std::move(display_name));
body_item->set_author_color(user_id_to_color(user_info.user_id));
body_item->set_description(user_info.user_id);
- body_item->set_description_color(sf::Color(179, 179, 179));
+ body_item->set_description_color(get_current_theme().faded_text_color);
if(user_info.avatar_url)
body_item->thumbnail_url = user_info.avatar_url.value();
body_item->thumbnail_mask_type = ThumbnailMaskType::CIRCLE;
@@ -1056,8 +1057,8 @@ namespace QuickMedia {
body_item->url = notification.event_id;
if(!notification.read) {
- body_item->set_author_color(sf::Color(255, 100, 100));
- body_item->set_description_color(sf::Color(255, 100, 100));
+ body_item->set_author_color(get_current_theme().attention_alert_text_color);
+ body_item->set_description_color(get_current_theme().attention_alert_text_color);
}
body_item->thumbnail_mask_type = ThumbnailMaskType::CIRCLE;
@@ -1116,8 +1117,8 @@ namespace QuickMedia {
NotificationsExtraData *extra_data = static_cast<NotificationsExtraData*>(body_item->extra.get());
if(!extra_data->read && extra_data->room == room) {
extra_data->read = true;
- body_item->set_author_color(sf::Color::White);
- body_item->set_description_color(sf::Color::White);
+ body_item->set_author_color(get_current_theme().text_color);
+ body_item->set_description_color(get_current_theme().text_color);
}
}
}