mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-03 07:56:03 +00:00
Load and use Segoe UI [Semibold] if no Open Sans.
Sometimes Open Sans Semibold fails to load properly on the latest Windows Creators Update. In that case try to load Segoe UI instead. An attempt to fix #3276.
This commit is contained in:
@@ -1043,7 +1043,7 @@ MainWindow::~MainWindow() {
|
||||
PreLaunchWindow *PreLaunchWindowInstance = 0;
|
||||
|
||||
PreLaunchWindow::PreLaunchWindow(QString title) : TWidget(0) {
|
||||
Fonts::start();
|
||||
Fonts::Start();
|
||||
|
||||
QIcon icon(App::pixmapFromImageInPlace(QImage(cPlatform() == dbipMac ? qsl(":/gui/art/iconbig256.png") : qsl(":/gui/art/icon256.png"))));
|
||||
if (cPlatform() == dbipLinux32 || cPlatform() == dbipLinux64) {
|
||||
@@ -1090,7 +1090,7 @@ PreLaunchWindow::~PreLaunchWindow() {
|
||||
|
||||
PreLaunchLabel::PreLaunchLabel(QWidget *parent) : QLabel(parent) {
|
||||
QFont labelFont(font());
|
||||
labelFont.setFamily(qsl("Open Sans Semibold"));
|
||||
labelFont.setFamily(Fonts::GetOverride(qsl("Open Sans Semibold")));
|
||||
labelFont.setPixelSize(static_cast<PreLaunchWindow*>(parent)->basicSize());
|
||||
setFont(labelFont);
|
||||
|
||||
@@ -1108,7 +1108,7 @@ void PreLaunchLabel::setText(const QString &text) {
|
||||
|
||||
PreLaunchInput::PreLaunchInput(QWidget *parent, bool password) : QLineEdit(parent) {
|
||||
QFont logFont(font());
|
||||
logFont.setFamily(qsl("Open Sans"));
|
||||
logFont.setFamily(Fonts::GetOverride(qsl("Open Sans")));
|
||||
logFont.setPixelSize(static_cast<PreLaunchWindow*>(parent)->basicSize());
|
||||
setFont(logFont);
|
||||
|
||||
@@ -1126,7 +1126,7 @@ PreLaunchInput::PreLaunchInput(QWidget *parent, bool password) : QLineEdit(paren
|
||||
|
||||
PreLaunchLog::PreLaunchLog(QWidget *parent) : QTextEdit(parent) {
|
||||
QFont logFont(font());
|
||||
logFont.setFamily(qsl("Open Sans"));
|
||||
logFont.setFamily(Fonts::GetOverride(qsl("Open Sans")));
|
||||
logFont.setPixelSize(static_cast<PreLaunchWindow*>(parent)->basicSize());
|
||||
setFont(logFont);
|
||||
|
||||
@@ -1148,7 +1148,7 @@ PreLaunchButton::PreLaunchButton(QWidget *parent, bool confirm) : QPushButton(pa
|
||||
setObjectName(confirm ? "confirm" : "cancel");
|
||||
|
||||
QFont closeFont(font());
|
||||
closeFont.setFamily(qsl("Open Sans Semibold"));
|
||||
closeFont.setFamily(Fonts::GetOverride(qsl("Open Sans Semibold")));
|
||||
closeFont.setPixelSize(static_cast<PreLaunchWindow*>(parent)->basicSize());
|
||||
setFont(closeFont);
|
||||
|
||||
@@ -1167,7 +1167,7 @@ PreLaunchCheckbox::PreLaunchCheckbox(QWidget *parent) : QCheckBox(parent) {
|
||||
setCheckState(Qt::Checked);
|
||||
|
||||
QFont closeFont(font());
|
||||
closeFont.setFamily(qsl("Open Sans Semibold"));
|
||||
closeFont.setFamily(Fonts::GetOverride(qsl("Open Sans Semibold")));
|
||||
closeFont.setPixelSize(static_cast<PreLaunchWindow*>(parent)->basicSize());
|
||||
setFont(closeFont);
|
||||
|
||||
|
Reference in New Issue
Block a user