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