Use Roboto as UI font

This commit is contained in:
Alex Spataru 2021-09-16 20:27:01 -05:00
parent 4106127929
commit 12960bef26
7 changed files with 86 additions and 6 deletions

View File

@ -32,7 +32,52 @@ RESOURCES += \
$$PWD/fonts/rcc_fonts.qrc \
$$PWD/instruments/rcc_instruments.qrc \
$$PWD/messages/rcc_messages.qrc \
$$PWD/messages/rcc_messages.qrc \
$$PWD/qml/rcc_qml.qrc \
$$PWD/themes/rcc_themes.qrc \
$$PWD/themes/rcc_themes.qrc \
$$PWD/mac-icons/rcc_mac-icons.qrc \
$$PWD/translations/rcc_translations.qrc
OTHER_FILES += \
$$PWD/messages/Acknowledgements.txt \
$$PWD/messages/Welcome_DE.txt \
$$PWD/messages/Welcome_EN.txt \
$$PWD/messages/Welcome_ES.txt \
$$PWD/messages/Welcome_ZH.txt \
$$PWD/qml/Application.qml \
$$PWD/qml/PlatformDependent/DecentMenuItem.qml \
$$PWD/qml/PlatformDependent/Menubar.qml \
$$PWD/qml/PlatformDependent/MenubarMacOS.qml \
$$PWD/qml/README.md \
$$PWD/qml/SetupPanes/MQTT.qml \
$$PWD/qml/SetupPanes/Network.qml \
$$PWD/qml/SetupPanes/Serial.qml \
$$PWD/qml/SetupPanes/Settings.qml \
$$PWD/qml/Widgets/AccelerometerDelegate.qml \
$$PWD/qml/Widgets/AccelerometerGaugeDelegate.qml \
$$PWD/qml/Widgets/ArtificialHorizonDelegate.qml \
$$PWD/qml/Widgets/BarDelegate.qml \
$$PWD/qml/Widgets/CompassDelegate.qml \
$$PWD/qml/Widgets/DataDelegate.qml \
$$PWD/qml/Widgets/GaugeDelegate.qml \
$$PWD/qml/Widgets/GraphDelegate.qml \
$$PWD/qml/Widgets/GroupDelegate.qml \
$$PWD/qml/Widgets/GyroDelegate.qml \
$$PWD/qml/Widgets/LED.qml \
$$PWD/qml/Widgets/MapDelegate.qml \
$$PWD/qml/Widgets/SimpleDial.qml \
$$PWD/qml/Widgets/Window.qml \
$$PWD/qml/Windows/About.qml \
$$PWD/qml/Windows/Acknowledgements.qml \
$$PWD/qml/Windows/Console.qml \
$$PWD/qml/Windows/CsvPlayer.qml \
$$PWD/qml/Windows/DataGrid.qml \
$$PWD/qml/Windows/Donate.qml \
$$PWD/qml/Windows/Setup.qml \
$$PWD/qml/Windows/Toolbar.qml \
$$PWD/qml/Windows/Widgets.qml \
$$PWD/qml/main.qml \
$$PWD/themes/0_Dark.json \
$$PWD/themes/1_Light.json

View File

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

View File

@ -201,6 +201,11 @@ ApplicationWindow {
minimumWidth: 1100
title: Cpp_AppName
minimumHeight: Qt.platform.os == "osx" ? 720 : 740
//
// Set user interface font
//
font.family: qmlMain.uiFont
//
// Define default window size to avoid issues with

View File

@ -24,11 +24,22 @@ import QtQuick 2.12
Item {
id: qmlMain
readonly property string monoFont: fontLoader.name
readonly property string uiFont: uiFontLoader.name
readonly property string monoFont: monoFontLoader.name
FontLoader {
id: fontLoader
source: "qrc:/fonts/NotoSansMono-Regular.ttf"
id: uiFontLoader
source: "qrc:/fonts/Roboto-Regular.ttf"
}
FontLoader {
id: uiFontLoaderBold
source: "qrc:/fonts/Roboto-Bold.ttf"
}
FontLoader {
id: monoFontLoader
source: "qrc:/fonts/RobotoMono-Regular.ttf"
}
Loader {

View File

@ -52,6 +52,12 @@ MacExtras::MacExtras()
m_widgetsAction.setCheckable(true);
m_dashboardAction.setCheckable(true);
// Set initial button status(es)
m_setupAction.setChecked(true);
m_consoleAction.setChecked(true);
m_widgetsAction.setEnabled(false);
m_dashboardAction.setEnabled(false);
// Configure signals
connect(&m_setupAction, SIGNAL(triggered()), this, SIGNAL(setupClicked()));
connect(&m_consoleAction, SIGNAL(triggered()), this, SIGNAL(consoleClicked()));

View File

@ -586,7 +586,7 @@ void QmlPlainTextEdit::scrollToBottom(const bool repaint)
// Do not scroll to bottom if all text fits in current window
if (lineCount > visibleLines)
bar->setValue(lineCount - visibleLines + 1);
bar->setValue(lineCount - visibleLines + 2);
else
bar->setValue(0);
@ -912,8 +912,11 @@ QList<FormattedText> AnsiEscapeCodeHandler::parseText(const FormattedText &input
m_pendingText += strippedText.mid(0, escape.length());
strippedText.remove(0, escape.length());
// Get stripped text in uppercase
auto upperCase = strippedText.toUpper();
// Clear line
if (strippedText == "2K")
if (upperCase.contains("2K"))
{
textEdit->setFocus();
auto storedCursor = textEdit->textCursor();
@ -923,6 +926,14 @@ QList<FormattedText> AnsiEscapeCodeHandler::parseText(const FormattedText &input
textEdit->textCursor().removeSelectedText();
textEdit->textCursor().deletePreviousChar();
textEdit->setTextCursor(storedCursor);
return outputData;
}
// Clear screen
if (upperCase.contains("2J"))
{
textEdit->clear();
return QList<FormattedText>();
}
// \e[K is not supported. Just strip it.