mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-25 18:10:35 +00:00
Improve macOS title bar font and rounding.
This commit is contained in:
parent
0954b04f24
commit
1f194da2f0
Binary file not shown.
Before Width: | Height: | Size: 823 B After Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 7.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 11 KiB |
@ -52,21 +52,27 @@ void PreviewWindowTitle(Painter &p, const style::palette &palette, QRect body, i
|
||||
p.fillRect(titleRect, st::titleBgActive[palette]);
|
||||
p.fillRect(titleRect.x(), titleRect.y() + titleRect.height() - st::lineWidth, titleRect.width(), st::lineWidth, st::titleShadow[palette]);
|
||||
|
||||
auto useSystemFont = false;
|
||||
QFont font;
|
||||
QStringList families = { qsl(".SF NS Text"), qsl("Helvetica Neue") };
|
||||
const auto families = QStringList{
|
||||
u".AppleSystemUIFont"_q,
|
||||
u".SF NS Text"_q,
|
||||
u"Helvetica Neue"_q,
|
||||
};
|
||||
for (auto family : families) {
|
||||
font.setFamily(family);
|
||||
if (QFontInfo(font).family() == font.family()) {
|
||||
useSystemFont = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (useSystemFont) {
|
||||
font.setPixelSize((titleHeight * 15) / 24);
|
||||
if (QFontInfo(font).family() != font.family()) {
|
||||
font = st::semiboldFont;
|
||||
font.setPixelSize(13);
|
||||
} else if (font.family() == u".AppleSystemUIFont"_q) {
|
||||
font.setBold(true);
|
||||
font.setPixelSize(13);
|
||||
} else {
|
||||
font = st::normalFont;
|
||||
font.setPixelSize((titleHeight * 15) / 24);
|
||||
}
|
||||
|
||||
p.setPen(st::titleFgActive[palette]);
|
||||
|
@ -351,6 +351,6 @@ macAlwaysThisAppTop: 4;
|
||||
macAppHintTop: 8;
|
||||
macCautionIconSize: 16;
|
||||
|
||||
macWindowRoundRadius: 5;
|
||||
macWindowRoundRadius: 10;
|
||||
macWindowShadowTopLeft: icon {{ "mac_window_shadow_top_left", windowShadowFg }};
|
||||
macTrayIcon: icon {{ "mac_tray_icon", windowFg }};
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 220d6835283c51c6e529ad5ef2f100703098e270
|
||||
Subproject commit 79d2052a8323b374b9c60ef3f4baaad9084aff3b
|
Loading…
Reference in New Issue
Block a user