From 8025d1075db0779bde635148f6e38303eb29d6c8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 6 Nov 2022 13:54:02 +0100 Subject: Formatted text with color in matrix, monospace for codeblocks --- include/BodyItem.hpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'include/BodyItem.hpp') diff --git a/include/BodyItem.hpp b/include/BodyItem.hpp index 819b730..b7dc48a 100644 --- a/include/BodyItem.hpp +++ b/include/BodyItem.hpp @@ -96,25 +96,28 @@ namespace QuickMedia { dirty_timestamp = true; } - void set_title_color(mgl::Color new_color) { - if(new_color == title_color) + void set_title_color(mgl::Color new_color, bool new_force_color = false) { + if(new_color == title_color && new_force_color == force_description_color) return; title_color = new_color; dirty = true; + force_title_color = new_force_color; } - void set_description_color(mgl::Color new_color) { - if(new_color == description_color) + void set_description_color(mgl::Color new_color, bool new_force_color = false) { + if(new_color == description_color && new_force_color == force_description_color) return; description_color = new_color; dirty_description = true; + force_description_color = new_force_color; } - void set_author_color(mgl::Color new_color) { - if(new_color == author_color) + void set_author_color(mgl::Color new_color, bool new_force_color = false) { + if(new_color == author_color && new_force_color == force_description_color) return; author_color = new_color; dirty_author = true; + force_author_color = new_force_color; } void add_reaction(std::string text, void *userdata, mgl::Color text_color); @@ -145,6 +148,8 @@ namespace QuickMedia { void draw_list(Body *body, mgl::Window &render_target); + // TODO: Bits for bools + // TODO: Use a list of strings instead, not all plugins need all of these fields std::string url; std::string thumbnail_url; @@ -156,6 +161,9 @@ namespace QuickMedia { bool dirty_reactions; // TODO: Remove this and instead if |thumbnail_url| starts with file://, then its a local file bool thumbnail_is_local; + bool force_title_color = false; + bool force_description_color = false; + bool force_author_color = false; std::unique_ptr title_text; std::unique_ptr description_text; std::unique_ptr author_text; -- cgit v1.2.3