Lobby: Change "font_*" config entry to "*_font"
This commit is contained in:
		
							parent
							
								
									a8035542bd
								
							
						
					
					
						commit
						6dde524a16
					
				@ -239,20 +239,18 @@ void Lobby::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();
 | 
				
			||||||
  QString font_name =
 | 
					  QString font_name =
 | 
				
			||||||
      ao_app->get_font_name("font_" + p_identifier, design_file);
 | 
					      ao_app->get_font_name(p_identifier + "_font", design_file);
 | 
				
			||||||
  QFont font(font_name, f_weight);
 | 
					  QFont font(font_name, f_weight);
 | 
				
			||||||
  bool use = ao_app->get_font_size("use_custom_fonts", design_file) == 1;
 | 
					  bool use = ao_app->get_font_size("use_custom_fonts", design_file) == 1;
 | 
				
			||||||
  if (use) {
 | 
					  if (use) {
 | 
				
			||||||
    widget->setFont(font);
 | 
					 | 
				
			||||||
    QColor f_color = ao_app->get_color(p_identifier + "_color", design_file);
 | 
					 | 
				
			||||||
    bool bold = ao_app->get_font_size(p_identifier + "_bold", design_file) ==
 | 
					    bool bold = ao_app->get_font_size(p_identifier + "_bold", design_file) ==
 | 
				
			||||||
                1; // is the font bold or not?
 | 
					                1; // is the font bold or not?
 | 
				
			||||||
 | 
					    font.setBold(bold);
 | 
				
			||||||
 | 
					    widget->setFont(font);
 | 
				
			||||||
 | 
					    QColor f_color = ao_app->get_color(p_identifier + "_color", design_file);
 | 
				
			||||||
    bool center =
 | 
					    bool center =
 | 
				
			||||||
        ao_app->get_font_size(p_identifier + "_center", design_file) ==
 | 
					        ao_app->get_font_size(p_identifier + "_center", design_file) ==
 | 
				
			||||||
        1; // should it be centered?
 | 
					        1; // should it be centered?
 | 
				
			||||||
    QString is_bold = "";
 | 
					 | 
				
			||||||
    if (bold)
 | 
					 | 
				
			||||||
      is_bold = "bold";
 | 
					 | 
				
			||||||
    QString is_center = "";
 | 
					    QString is_center = "";
 | 
				
			||||||
    if (center)
 | 
					    if (center)
 | 
				
			||||||
      is_center = "qproperty-alignment: AlignCenter;";
 | 
					      is_center = "qproperty-alignment: AlignCenter;";
 | 
				
			||||||
@ -260,8 +258,7 @@ void Lobby::set_font(QWidget *widget, QString p_identifier)
 | 
				
			|||||||
        class_name + " { background-color: rgba(0, 0, 0, 0);\n" +
 | 
					        class_name + " { background-color: rgba(0, 0, 0, 0);\n" +
 | 
				
			||||||
        "color: rgba(" + QString::number(f_color.red()) + ", " +
 | 
					        "color: rgba(" + QString::number(f_color.red()) + ", " +
 | 
				
			||||||
        QString::number(f_color.green()) + ", " +
 | 
					        QString::number(f_color.green()) + ", " +
 | 
				
			||||||
        QString::number(f_color.blue()) + ", 255);\n" + is_center + "\n" +
 | 
					        QString::number(f_color.blue()) + ", 255);\n" + is_center + "}";
 | 
				
			||||||
        "font: " + is_bold + "; }";
 | 
					 | 
				
			||||||
    widget->setStyleSheet(style_sheet_string);
 | 
					    widget->setStyleSheet(style_sheet_string);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  return;
 | 
					  return;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user