mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Better algorithm for font choosing
This commit is contained in:
@@ -42,9 +42,7 @@ PreLaunchWindow::PreLaunchWindow(QString title) {
|
||||
p.setColor(QPalette::Background, QColor(255, 255, 255));
|
||||
setPalette(p);
|
||||
|
||||
QLabel tmp(this);
|
||||
tmp.setText(qsl("Tmp"));
|
||||
_size = tmp.sizeHint().height();
|
||||
_size = QFontInfo(QApplication::font()).pixelSize();
|
||||
|
||||
int paddingVertical = (_size / 2);
|
||||
int paddingHorizontal = _size;
|
||||
@@ -74,7 +72,7 @@ PreLaunchWindow::~PreLaunchWindow() {
|
||||
|
||||
PreLaunchLabel::PreLaunchLabel(QWidget *parent) : QLabel(parent) {
|
||||
QFont labelFont(font());
|
||||
labelFont.setFamily(style::internal::GetFontOverride(qsl("Open Sans Semibold")));
|
||||
labelFont.setFamily(style::internal::GetFontOverride(style::internal::FontSemibold));
|
||||
labelFont.setPixelSize(static_cast<PreLaunchWindow*>(parent)->basicSize());
|
||||
setFont(labelFont);
|
||||
|
||||
@@ -92,7 +90,6 @@ void PreLaunchLabel::setText(const QString &text) {
|
||||
|
||||
PreLaunchInput::PreLaunchInput(QWidget *parent, bool password) : QLineEdit(parent) {
|
||||
QFont logFont(font());
|
||||
logFont.setFamily(style::internal::GetFontOverride(qsl("Open Sans")));
|
||||
logFont.setPixelSize(static_cast<PreLaunchWindow*>(parent)->basicSize());
|
||||
setFont(logFont);
|
||||
|
||||
@@ -110,7 +107,6 @@ PreLaunchInput::PreLaunchInput(QWidget *parent, bool password) : QLineEdit(paren
|
||||
|
||||
PreLaunchLog::PreLaunchLog(QWidget *parent) : QTextEdit(parent) {
|
||||
QFont logFont(font());
|
||||
logFont.setFamily(style::internal::GetFontOverride(qsl("Open Sans")));
|
||||
logFont.setPixelSize(static_cast<PreLaunchWindow*>(parent)->basicSize());
|
||||
setFont(logFont);
|
||||
|
||||
@@ -132,7 +128,7 @@ PreLaunchButton::PreLaunchButton(QWidget *parent, bool confirm) : QPushButton(pa
|
||||
setObjectName(confirm ? "confirm" : "cancel");
|
||||
|
||||
QFont closeFont(font());
|
||||
closeFont.setFamily(style::internal::GetFontOverride(qsl("Open Sans Semibold")));
|
||||
closeFont.setFamily(style::internal::GetFontOverride(style::internal::FontSemibold));
|
||||
closeFont.setPixelSize(static_cast<PreLaunchWindow*>(parent)->basicSize());
|
||||
setFont(closeFont);
|
||||
|
||||
@@ -151,7 +147,7 @@ PreLaunchCheckbox::PreLaunchCheckbox(QWidget *parent) : QCheckBox(parent) {
|
||||
setCheckState(Qt::Checked);
|
||||
|
||||
QFont closeFont(font());
|
||||
closeFont.setFamily(style::internal::GetFontOverride(qsl("Open Sans Semibold")));
|
||||
closeFont.setFamily(style::internal::GetFontOverride(style::internal::FontSemibold));
|
||||
closeFont.setPixelSize(static_cast<PreLaunchWindow*>(parent)->basicSize());
|
||||
setFont(closeFont);
|
||||
|
||||
|
Reference in New Issue
Block a user