Use same mono font in all platforms

This commit is contained in:
Alex Spataru 2021-09-12 18:38:07 -05:00
parent 47bc62c40a
commit 633a0905ae
7 changed files with 18 additions and 15 deletions

View File

@ -29,6 +29,7 @@ TRANSLATIONS += \
RESOURCES += \
$$PWD/icons/rcc_icons.qrc \
$$PWD/images/rcc_images.qrc \
$$PWD/fonts/rcc_fonts.qrc \
$$PWD/instruments/rcc_instruments.qrc \
$$PWD/messages/rcc_messages.qrc \
$$PWD/qml/rcc_qml.qrc \

Binary file not shown.

View File

@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/fonts">
<file>NotoSansMono-Regular.ttf</file>
</qresource>
</RCC>

View File

@ -38,16 +38,7 @@ ApplicationWindow {
//
readonly property int spacing: 8
property bool firstValidPacket: false
readonly property string monoFont: {
switch (Qt.platform.os) {
case "osx":
return "Monaco"
case "windows":
return "Consolas"
default:
return "Noto Sans Mono"
}
}
readonly property string monoFont: qmlMain.monoFont
//
// We use this variable to ask the user if he/she wants to enable/disable

View File

@ -23,7 +23,13 @@
import QtQuick 2.12
Item {
id: root
id: qmlMain
readonly property string monoFont: fontLoader.name
FontLoader {
id: fontLoader
source: "qrc:/fonts/NotoSansMono-Regular.ttf"
}
Loader {
asynchronous: true

View File

@ -38,17 +38,17 @@
"datasetTextSecondary":"#666666",
"datasetWindowBackground":"#fafafa",
"datasetWindowBorder":"#336698",
"datagridBackground":"#f4f4f7",
"datagridBackground":"#f1f1f1",
"ledEnabled":"#0072C3",
"ledDisabled":"#686868",
"csvHighlight":"#2e895c",
"widgetBackground":"#f4f4f7",
"widgetBackground":"#f1f1f1",
"widgetForegroundPrimary":"#24476a",
"widgetForegroundSecondary":"#666666",
"widgetIndicator1":"#444444",
"widgetIndicator2":"#f94144",
"widgetIndicator3":"#90be6d",
"widgetAlternativeBackground":"#ededed",
"widgetAlternativeBackground":"#fafafa",
"widgetControlBackground":"#666666",
"gyroSky":"#5c93c5",
"gyroText":"#ffffff",

View File

@ -77,7 +77,7 @@ int ThemeManager::themeId() const
* in order to apply changes.
*
* Unfortunately, an app restart is required because the application
* palette must be set before the GUI is initialized.
* palette must be set before the GUI is initialized.
*/
void ThemeManager::setTheme(const int id)
{