Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
UI: Fix small font size on macOS and fallback font
Qt uses a default font size of 13pt for QWidgets on macOS. By setting
the default font size to 10pt, text becomes too small for comfortable
use on macOS.

This PR patches the font files copied into the macOS bundle to use a
larger font-size of 12pt. It also sets the fallback font to the more
modern SF Display-based `.AppleSystemUIFont` used by default in macOS
if Open Sans is not found.
  • Loading branch information
PatTheMav committed Aug 25, 2022
1 parent 896de39 commit b81ab5a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion UI/data/themes/Acri.qss
Expand Up @@ -82,7 +82,7 @@ QWidget {
selection-background-color: rgb(22,31,65);
selection-color: palette(text);
font-size: 10pt;
font-family: 'Open Sans', Helvetica, Arial, 'MS Shell Dlg', sans-serif
font-family: 'Open Sans', '.AppleSystemUIFont', Helvetica, Arial, 'MS Shell Dlg', sans-serif;
}

QWidget:disabled {
Expand Down
2 changes: 1 addition & 1 deletion UI/data/themes/Grey.qss
Expand Up @@ -82,7 +82,7 @@ QWidget {
selection-background-color: rgb(40,76,184);
selection-color: palette(text);
font-size: 10pt;
font-family: 'Open Sans', Helvetica, Arial, 'MS Shell Dlg', sans-serif
font-family: 'Open Sans', '.AppleSystemUIFont', Helvetica, Arial, 'MS Shell Dlg', sans-serif;
}

QWidget:disabled {
Expand Down
2 changes: 1 addition & 1 deletion UI/data/themes/Light.qss
Expand Up @@ -82,7 +82,7 @@ QWidget {
selection-background-color: rgb(140,181,255);
selection-color: palette(text);
font-size: 10pt;
font-family: 'Open Sans', Helvetica, Arial, 'MS Shell Dlg', sans-serif
font-family: 'Open Sans', '.AppleSystemUIFont', Helvetica, Arial, 'MS Shell Dlg', sans-serif;
}

QWidget:disabled {
Expand Down
2 changes: 1 addition & 1 deletion UI/data/themes/Rachni.qss
Expand Up @@ -84,7 +84,7 @@ QWidget {
selection-background-color: rgb(0,188,212);
selection-color: palette(text);
font-size: 10pt;
font-family: 'Open Sans', Helvetica, Arial, 'MS Shell Dlg', sans-serif
font-family: 'Open Sans', '.AppleSystemUIFont', Helvetica, Arial, 'MS Shell Dlg', sans-serif;
}

QWidget:disabled {
Expand Down
2 changes: 1 addition & 1 deletion UI/data/themes/Yami.qss
Expand Up @@ -82,7 +82,7 @@ QWidget {
selection-background-color: rgb(40,76,184);
selection-color: palette(text);
font-size: 10pt;
font-family: 'Open Sans', Helvetica, Arial, 'MS Shell Dlg', sans-serif
font-family: 'Open Sans', '.AppleSystemUIFont', Helvetica, Arial, 'MS Shell Dlg', sans-serif;
}

QWidget:disabled {
Expand Down
12 changes: 11 additions & 1 deletion cmake/Modules/ObsHelpers_macOS.cmake
Expand Up @@ -355,7 +355,6 @@ function(setup_obs_bundle target)
COMPONENT obs_resources)

if(ENABLE_SPARKLE_UPDATER)

add_custom_command(
TARGET ${target}
POST_BUILD
Expand Down Expand Up @@ -388,6 +387,17 @@ function(setup_obs_bundle target)
COMPONENT obs_frameworks)
endif()

add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND
/usr/bin/sed -i '' 's/font-size: 10pt\;/font-size: 12pt\;/'
"$<TARGET_BUNDLE_CONTENT_DIR:${target}>/Resources/themes/Acri.qss"
"$<TARGET_BUNDLE_CONTENT_DIR:${target}>/Resources/themes/Grey.qss"
"$<TARGET_BUNDLE_CONTENT_DIR:${target}>/Resources/themes/Light.qss"
"$<TARGET_BUNDLE_CONTENT_DIR:${target}>/Resources/themes/Rachni.qss"
"$<TARGET_BUNDLE_CONTENT_DIR:${target}>/Resources/themes/Yami.qss")

install(SCRIPT "${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/bundleutils.cmake"
COMPONENT obs_resources)
endfunction()
Expand Down

0 comments on commit b81ab5a

Please sign in to comment.