mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Improve macOS title bar font and rounding.
This commit is contained in:
parent
0954b04f24
commit
1f194da2f0
6 changed files with 14 additions and 8 deletions
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, st::titleBgActive[palette]);
|
||||||
p.fillRect(titleRect.x(), titleRect.y() + titleRect.height() - st::lineWidth, titleRect.width(), st::lineWidth, st::titleShadow[palette]);
|
p.fillRect(titleRect.x(), titleRect.y() + titleRect.height() - st::lineWidth, titleRect.width(), st::lineWidth, st::titleShadow[palette]);
|
||||||
|
|
||||||
auto useSystemFont = false;
|
|
||||||
QFont font;
|
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) {
|
for (auto family : families) {
|
||||||
font.setFamily(family);
|
font.setFamily(family);
|
||||||
if (QFontInfo(font).family() == font.family()) {
|
if (QFontInfo(font).family() == font.family()) {
|
||||||
useSystemFont = true;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useSystemFont) {
|
if (QFontInfo(font).family() != font.family()) {
|
||||||
font.setPixelSize((titleHeight * 15) / 24);
|
font = st::semiboldFont;
|
||||||
|
font.setPixelSize(13);
|
||||||
|
} else if (font.family() == u".AppleSystemUIFont"_q) {
|
||||||
|
font.setBold(true);
|
||||||
|
font.setPixelSize(13);
|
||||||
} else {
|
} else {
|
||||||
font = st::normalFont;
|
font.setPixelSize((titleHeight * 15) / 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
p.setPen(st::titleFgActive[palette]);
|
p.setPen(st::titleFgActive[palette]);
|
||||||
|
|
|
@ -351,6 +351,6 @@ macAlwaysThisAppTop: 4;
|
||||||
macAppHintTop: 8;
|
macAppHintTop: 8;
|
||||||
macCautionIconSize: 16;
|
macCautionIconSize: 16;
|
||||||
|
|
||||||
macWindowRoundRadius: 5;
|
macWindowRoundRadius: 10;
|
||||||
macWindowShadowTopLeft: icon {{ "mac_window_shadow_top_left", windowShadowFg }};
|
macWindowShadowTopLeft: icon {{ "mac_window_shadow_top_left", windowShadowFg }};
|
||||||
macTrayIcon: icon {{ "mac_tray_icon", windowFg }};
|
macTrayIcon: icon {{ "mac_tray_icon", windowFg }};
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 220d6835283c51c6e529ad5ef2f100703098e270
|
Subproject commit 79d2052a8323b374b9c60ef3f4baaad9084aff3b
|
Loading…
Add table
Reference in a new issue