From 9b39b7d6aa2beb8b5496a528c2351adf125c4601 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Mon, 16 Sep 2019 06:09:39 +0300 Subject: Allow char.ini to override the chat font and font size with chat_font = and chat_size = Scream at the coders that decided hard-coding fonts and colors was a good idea (gotta properly let the themes modify that later) Fix a lot of ui elements not properly respecting the themes and their colors add a set_qfont method for those situations that need it Allow the theme to change sender colors for ooc and ms chatlogs rename url parser variable to something more immediately apparent as to what it is for readability's sake --- include/aoapplication.h | 8 +++++++- include/aotextarea.h | 2 +- include/courtroom.h | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index fcee38f..e4a5b7f 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -261,9 +261,15 @@ public: //Returns the showname from the ini of p_char QString get_showname(QString p_char); - //Returns the value of chat from the specific p_char's ini file + //Returns the value of chat image from the specific p_char's ini file QString get_chat(QString p_char); + //Returns the value of chat font from the specific p_char's ini file + QString get_chat_font(QString p_char); + + //Returns the value of chat font size from the specific p_char's ini file + int get_chat_size(QString p_char); + //Returns the value of shouts from the specified p_char's ini file QString get_char_shouts(QString p_char); diff --git a/include/aotextarea.h b/include/aotextarea.h index d44596b..266b722 100644 --- a/include/aotextarea.h +++ b/include/aotextarea.h @@ -16,7 +16,7 @@ public: void append_error(QString p_message); private: - const QRegExp omnis_dank_url_regex = QRegExp("\\b(https?://\\S+\\.\\S+)\\b"); + const QRegExp url_parser_regex = QRegExp("\\b(https?://\\S+\\.\\S+)\\b"); void auto_scroll(QTextCursor old_cursor, int scrollbar_value, bool is_scrolled_down); }; diff --git a/include/courtroom.h b/include/courtroom.h index 9d33a91..304dd64 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -117,8 +117,13 @@ public: //sets position of widgets based on theme ini files void set_widgets(); + //sets font size based on theme ini files void set_font(QWidget *widget, QString p_identifier); + + //actual operation of setting the font on a widget + void set_qfont(QWidget *widget, QFont font, QColor f_color = Qt::black, bool bold = false); + //helper function that calls above function on the relevant widgets void set_fonts(); -- cgit