Merge branch 'trojanAO' into 'master'
Added ability to set fonts on widgets. See merge request AttorneyOnline/AO2-Client!76
This commit is contained in:
commit
e5c2898bac
@ -195,6 +195,10 @@ public:
|
|||||||
//Returns the dimensions of widget with specified identifier from p_file
|
//Returns the dimensions of widget with specified identifier from p_file
|
||||||
pos_size_type get_element_dimensions(QString p_identifier, QString p_file);
|
pos_size_type get_element_dimensions(QString p_identifier, QString p_file);
|
||||||
|
|
||||||
|
//Returns the name of the font with p_identifier from p_file
|
||||||
|
QString get_font_name(QString p_identifier, QString p_file);
|
||||||
|
|
||||||
|
|
||||||
//Returns the value of font_size with p_identifier from p_file
|
//Returns the value of font_size with p_identifier from p_file
|
||||||
int get_font_size(QString p_identifier, QString p_file);
|
int get_font_size(QString p_identifier, QString p_file);
|
||||||
|
|
||||||
|
@ -724,7 +724,9 @@ void Courtroom::set_font(QWidget *widget, QString p_identifier)
|
|||||||
int f_weight = ao_app->get_font_size(p_identifier, design_file);
|
int f_weight = ao_app->get_font_size(p_identifier, design_file);
|
||||||
QString class_name = widget->metaObject()->className();
|
QString class_name = widget->metaObject()->className();
|
||||||
|
|
||||||
widget->setFont(QFont("Sans", f_weight));
|
QString fontt = ao_app->get_font_name(p_identifier + "_font", design_file);
|
||||||
|
widget->setFont(QFont(fontt, f_weight));
|
||||||
|
|
||||||
|
|
||||||
QColor f_color = ao_app->get_color(p_identifier + "_color", design_file);
|
QColor f_color = ao_app->get_color(p_identifier + "_color", design_file);
|
||||||
|
|
||||||
|
@ -224,7 +224,17 @@ pos_size_type AOApplication::get_element_dimensions(QString p_identifier, QStrin
|
|||||||
|
|
||||||
return return_value;
|
return return_value;
|
||||||
}
|
}
|
||||||
|
QString AOApplication::get_font_name(QString p_identifier, QString p_file)
|
||||||
|
{
|
||||||
|
QString design_ini_path = get_theme_path(p_file);
|
||||||
|
QString f_result = read_design_ini(p_identifier, design_ini_path);
|
||||||
|
QString default_path = get_default_theme_path(p_file);
|
||||||
|
if(f_result == "")
|
||||||
|
{
|
||||||
|
f_result = read_design_ini(p_identifier, default_path);
|
||||||
|
}
|
||||||
|
return f_result;
|
||||||
|
}
|
||||||
int AOApplication::get_font_size(QString p_identifier, QString p_file)
|
int AOApplication::get_font_size(QString p_identifier, QString p_file)
|
||||||
{
|
{
|
||||||
QString design_ini_path = get_theme_path(p_file);
|
QString design_ini_path = get_theme_path(p_file);
|
||||||
|
Loading…
Reference in New Issue
Block a user