Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create dev release candidate #615

Closed
wants to merge 89 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
a70587a
Fix ui unresponsive after reboot / shutdown command - in the end, the…
Consti10 Oct 4, 2023
a2954b0
move QOpenHD service buttons / dialoque to DEV, tx power - select car…
Consti10 Oct 4, 2023
c646624
add forwarding of user to connect / channel scan when system is not a…
Consti10 Oct 9, 2023
c9266d7
pollution chart improvements
Consti10 Oct 9, 2023
d520434
seperate logging OpenHD ground / air
Consti10 Oct 11, 2023
c464078
wb link settings - better use available space and group things
Consti10 Oct 15, 2023
4d069c2
wb link settings - better use available space and group things
Consti10 Oct 15, 2023
eb72ab7
connection mode auto
Consti10 Oct 17, 2023
3601d65
UI stuff
Consti10 Oct 19, 2023
916e9a7
UI stuff
Consti10 Oct 19, 2023
b56745b
fucking hell, hard code it
Consti10 Oct 19, 2023
32eb5ff
pretty fonts
Consti10 Oct 19, 2023
68fd8ec
pretty fonts
Consti10 Oct 19, 2023
cc6514c
fix tcp
Consti10 Oct 20, 2023
7d3f0d0
Fix betaflight RC channels by uncommenting a couple of lines
peteallenm Oct 20, 2023
199ca0e
Merge pull request #600 from OpenHD/betaflight_rcsticks
peteallenm Oct 20, 2023
ecfd231
reinstate a fix that got lost - 0 is valid sysid that betaflight uses
peteallenm Oct 20, 2023
d055b81
Merge pull request #601 from OpenHD/fix_betaflight
peteallenm Oct 20, 2023
c55d73e
add stbc / ldpc enable popup, improve UI
Consti10 Oct 21, 2023
bbcca38
add stbc / ldpc enable popup, improve UI
Consti10 Oct 26, 2023
a4a7ed6
performancehorizonladder - new simple approach
Consti10 Oct 26, 2023
e90cd94
performancehorizonladder - new simple approach
Consti10 Oct 26, 2023
7e4b785
small ui improvements
Consti10 Oct 26, 2023
ac653fb
accident, was only for debugging
Consti10 Oct 26, 2023
2bfce26
small UI improvements and rename
Consti10 Oct 27, 2023
c2bccc2
Merge pull request #602 from OpenHD/consti-dev
Consti10 Oct 27, 2023
41b571c
terminate properly
Consti10 Oct 27, 2023
e64c397
fix the dialogues
Consti10 Oct 28, 2023
6a3a079
add per QQuickPaintedItem font scale
Consti10 Oct 30, 2023
ef4edef
Improve UI:
Consti10 Oct 31, 2023
2904ff5
changing decode pipelines
raphaelscholle Nov 2, 2023
2145e31
Improve UI:
Consti10 Nov 3, 2023
8226822
Improve UI:
Consti10 Nov 3, 2023
9fc3d34
fix secondary video minimize maximize
Consti10 Nov 6, 2023
ed9ae3c
fix secondary video minimize maximize
Consti10 Nov 6, 2023
76630ed
fix secondary video minimize maximize
Consti10 Nov 6, 2023
4906a66
Flow settings OSD -> Widgets first
Consti10 Nov 6, 2023
c330b72
Flow settings OSD -> Widgets first, remove record widget (merged into…
Consti10 Nov 6, 2023
2254f0f
Flow settings OSD -> Widgets first, remove record widget (merged into…
Consti10 Nov 6, 2023
aea6fdc
for now, just do not show the reboot shutdown actions
Consti10 Nov 6, 2023
7466cf8
less spammy on secondary cam
Consti10 Nov 6, 2023
d249f0f
less spammy on secondary cam
Consti10 Nov 6, 2023
9c4216f
delete unused, add filler
Consti10 Nov 7, 2023
37bf5f4
pack the left bar into a scroll view, such that it is at least naviga…
Consti10 Nov 7, 2023
310b388
pack the left bar into a scroll view, such that it is at least naviga…
Consti10 Nov 7, 2023
a5d79c8
android - log warning if permissions are missing (only)
Consti10 Nov 7, 2023
904203c
slightly bigger param editor
Consti10 Nov 7, 2023
7d71a21
Merge pull request #604 from OpenHD/consti-dev
Consti10 Nov 7, 2023
98824a2
tx power - reset the selection model(s) to fix bug @Ivan
Consti10 Nov 8, 2023
e884881
tx power - whitelist for less confusion, add 720p60 16:9 to drop down…
Consti10 Nov 10, 2023
1725020
Always disable Qt::AA_DisableHighDpiScaling, vertical speed: fix arrow,
Consti10 Nov 13, 2023
6ef7272
status: fill width, openhd quick: center elements (fix usability on l…
Consti10 Nov 14, 2023
92ecd98
finalize: Everything is usable up to minimum resolution (480p 16:9)
Consti10 Nov 14, 2023
9dc6628
exp for android - re-enable high dpi scaling
Consti10 Nov 14, 2023
a66db5b
exp -set before writing the AA flag / screen scale
Consti10 Nov 14, 2023
683bf9e
exp -set before writing the AA flag / screen scale
Consti10 Nov 14, 2023
07fa49d
wb link rate widget - use combobox instead of buttons
Consti10 Nov 14, 2023
54576da
slightly decrease the default size of the artificial horizon
Consti10 Nov 14, 2023
38b3243
horizon ladder - scale home icon, restart qopenhd box - decrease size,
Consti10 Nov 14, 2023
b1fa5e3
make restart dialoque even smaller
Consti10 Nov 15, 2023
69a9de5
fix " "
Consti10 Nov 15, 2023
2a39c43
show restart dialoque when changed
Consti10 Nov 15, 2023
090bdee
debug
raphaelscholle Nov 15, 2023
810447c
Revert "debug"
raphaelscholle Nov 15, 2023
7398f73
Merge pull request #605 from OpenHD/consti-dev
Consti10 Nov 15, 2023
b391a47
status - look less shit on small screens
Consti10 Nov 16, 2023
8502c2f
use DEF als agreed in chat
Consti10 Nov 16, 2023
fd4dae3
use DEF als agreed in chat
Consti10 Nov 16, 2023
ebaf36b
Convert total distance to Coords and bug fixes
Nov 16, 2023
16a7a67
add hide mouse feature
Consti10 Nov 17, 2023
c633fd5
add hide mouse feature
Consti10 Nov 17, 2023
7ef5d54
rename a bit, font select - update on change
Consti10 Nov 18, 2023
94371fa
Merge pull request #610 from OpenHD/consti-dev
Consti10 Nov 19, 2023
148b32f
throttle - more verbose text, rate control widget highlight currentl…
Consti10 Nov 20, 2023
98dd78d
update version to 2.5.2-beta
Consti10 Nov 20, 2023
0a6a741
Merge pull request #612 from OpenHD/consti-dev
Consti10 Nov 20, 2023
5bda407
merge packaging, decode and sidebar changes
raphaelscholle Nov 20, 2023
f23a24a
add sidebar stuff
raphaelscholle Nov 20, 2023
d1bba54
remove spammy log
Consti10 Nov 21, 2023
7b45bba
remove spammy log
Consti10 Nov 21, 2023
64bcd8e
add 640x480@30 since it is the default res for a lot of usb cameras
Consti10 Nov 21, 2023
583e30a
persist connection mode
Consti10 Nov 21, 2023
266ba4b
rpi - default to screen scale 0.7
Consti10 Nov 21, 2023
7a4b890
disable when not usable
Consti10 Nov 21, 2023
aaba432
color and layout changes for the next release
Nov 21, 2023
8a3d886
Merge pull request #613 from OpenHD/consti-dev
Consti10 Nov 21, 2023
f8dd6de
bump version code for play
Consti10 Nov 21, 2023
3c81758
update channel analyzer style
Nov 21, 2023
c859f6f
small changes
Nov 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions QOpenHD.pro
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ LinuxBuild {
SOURCES += \
app/logging/hudlogmessagesmodel.cpp \
app/logging/logmessagesmodel.cpp \
app/util/mousehelper.cpp \
app/util/qopenhd.cpp \
app/util/WorkaroundMessageBox.cpp \
app/util/qrenderstats.cpp \
Expand All @@ -116,6 +117,7 @@ HEADERS += \
app/logging/hudlogmessagesmodel.h \
app/logging/loghelper.h \
app/logging/logmessagesmodel.h \
app/util/mousehelper.h \
app/util/qopenhd.h \
app/util/WorkaroundMessageBox.h \
app/util/qrenderstats.h \
Expand All @@ -134,7 +136,6 @@ SOURCES += \
app/osd/altitudeladder.cpp \
app/osd/flightpathvector.cpp \
app/osd/aoagauge.cpp \
app/osd/performancehorizonladder.cpp \

HEADERS += \
app/osd/headingladder.h \
Expand All @@ -144,7 +145,6 @@ HEADERS += \
app/osd/flightpathvector.h \
app/osd/debug_overdraw.hpp \
app/osd/aoagauge.h \
app/osd/performancehorizonladder.h \


RESOURCES += qml/qml.qrc
Expand Down
2 changes: 1 addition & 1 deletion android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<manifest package="com.openhd.openhd" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="v13" android:versionCode="13" android:installLocation="auto">
<manifest package="com.openhd.openhd" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="v14" android:versionCode="14" android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33"/>

<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
Expand Down
17 changes: 12 additions & 5 deletions app/logging/logmessagesmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,23 @@

#include "hudlogmessagesmodel.h"

LogMessagesModel &LogMessagesModel::instanceOHD()

LogMessagesModel &LogMessagesModel::instanceGround()
{
static LogMessagesModel instance;
return instance;
}

LogMessagesModel &LogMessagesModel::instanceOHDAir()
{
static LogMessagesModel* instance=new LogMessagesModel();
return *instance;
static LogMessagesModel instance;
return instance;
}

LogMessagesModel &LogMessagesModel::instanceFC()
{
static LogMessagesModel* instance_fc=new LogMessagesModel();
return *instance_fc;
static LogMessagesModel instance;
return instance;
}

LogMessagesModel::LogMessagesModel(QObject *parent) :
Expand Down
4 changes: 2 additions & 2 deletions app/logging/logmessagesmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class LogMessagesModel : public QAbstractListModel
{
Q_OBJECT
public:
// Instance for all OpenHD air / ground messages
static LogMessagesModel& instanceOHD();
static LogMessagesModel& instanceGround();
static LogMessagesModel& instanceOHDAir();
// We have a seperate model for the FC log messages
static LogMessagesModel& instanceFC();

Expand Down
95 changes: 59 additions & 36 deletions app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ const QVector<QString> permissions({"android.permission.INTERNET",
#include "telemetry/models/rcchannelsmodel.h"
#include "telemetry/settings/mavlinksettingsmodel.h"
#include "telemetry/settings/wblinksettingshelper.h"
#include "telemetry/settings/frequencyhelper.h"
#include "telemetry/settings/pollutionhelper.h"
#include "osd/speedladder.h"
#include "osd/altitudeladder.h"
#include "osd/headingladder.h"
#include "osd/horizonladder.h"
#include "osd/flightpathvector.h"
#include "osd/aoagauge.h"
#include "osd/performancehorizonladder.h"

// Video - annyoing ifdef crap is needed for all the different platforms / configurations
#include "decodingstatistcs.h"
Expand Down Expand Up @@ -60,6 +61,7 @@ const QVector<QString> permissions({"android.permission.INTERNET",
#include "logging/logmessagesmodel.h"
#include "logging/hudlogmessagesmodel.h"
#include "util/qopenhd.h"
#include "util/mousehelper.h"
#include "util/WorkaroundMessageBox.h"
#include "util/restartqopenhdmessagebox.h"

Expand Down Expand Up @@ -169,15 +171,47 @@ static void write_platform_context_properties(QQmlApplicationEngine& engine){
#endif
}

static void android_check_permissions(){
#if defined(__android__)
qDebug()<<"Android request permissions";
for(const QString &permission : permissions) {
auto result = QtAndroid::checkPermission(permission);
if (result == QtAndroid::PermissionResult::Denied) {
auto resultHash = QtAndroid::requestPermissionsSync(QStringList({permission}));
if (resultHash[permission] == QtAndroid::PermissionResult::Denied) {
LogMessagesModel::instanceGround().add_message_warn("QOpenHD","Android - missing permissions");
return;
}
}
}
#endif
}

int main(int argc, char *argv[]) {

QCoreApplication::setOrganizationName("OpenHD");
QCoreApplication::setOrganizationDomain("openhd");
QCoreApplication::setApplicationName("QOpenHD");
{// Original screen resoluton before setting anything
//QApplication a(argc, argv);
const auto screen=QGuiApplication::primaryScreen();
if(screen){
const auto actual_size=screen->size();
QRenderStats::instance().set_screen_width_height(actual_size.width(),actual_size.height());
}
// a is deleted again
}

QSettings settings;

qDebug()<<"Storing settings at ["<<settings.fileName()<<"]";
// RPI only - set a smaller default screen scale, for whatever reason thats needed
if(QOpenHD::instance().is_platform_rpi()){
if(!settings.value("qopenhd_custom_default_screen_has_been_set",false).toBool()){
qDebug()<<"Setting initial rpi screen scale";
settings.setValue("qopenhd_custom_default_screen_has_been_set",true);
settings.setValue("global_scale",0.7);
}
}
const int screen_custom_font_dpi = settings.value("screen_custom_font_dpi").toInt();
if (screen_custom_font_dpi) {
QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
Expand All @@ -187,22 +221,11 @@ int main(int argc, char *argv[]) {
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
}
//QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);

// From https://stackoverflow.com/questions/63473541/how-to-dynamically-toggle-vsync-in-a-qt-application-at-runtime
// Get rid of VSYNC if possible. Might / might not work. On my ubuntu nvidia & intel laptop, this at least seems to
// result in tripple buffering with unlimited fps, a bit "better" regarding latency than default.
if(settings.value("dev_set_swap_interval_zero",false).toBool()){
qDebug()<<"Request swap interval of 0";
QSurfaceFormat format=QSurfaceFormat::defaultFormat();
format.setSwapInterval(0);
QSurfaceFormat::setDefaultFormat(format);
}

//QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
const double global_scale = settings.value("global_scale", 1.0).toDouble();
const std::string global_scale_s = std::to_string(global_scale);
QByteArray scaleAsQByteArray(global_scale_s.c_str(), global_scale_s.length());
qputenv("QT_SCALE_FACTOR", scaleAsQByteArray);
qDebug()<<"Storing settings at ["<<settings.fileName()<<"]";

// https://doc.qt.io/qt-6/qtquick-visualcanvas-scenegraph-renderer.html
//qputenv("QSG_VISUALIZE", "overdraw");
Expand All @@ -217,10 +240,18 @@ int main(int argc, char *argv[]) {
//QLoggingCategory::setFilterRules("qt.qpa.eglfs.*=true");
//QLoggingCategory::setFilterRules("qt.qpa.egl*=true");

// From https://stackoverflow.com/questions/63473541/how-to-dynamically-toggle-vsync-in-a-qt-application-at-runtime
// Get rid of VSYNC if possible. Might / might not work. On my ubuntu nvidia & intel laptop, this at least seems to
// result in tripple buffering with unlimited fps, a bit "better" regarding latency than default.
if(settings.value("dev_set_swap_interval_zero",false).toBool()){
qDebug()<<"Request swap interval of 0";
QSurfaceFormat format=QSurfaceFormat::defaultFormat();
format.setSwapInterval(0);
QSurfaceFormat::setDefaultFormat(format);
}

QApplication app(argc, argv);
// Customize cursor if needed
QOpenHD::instance().customize_cursor_from_settings();
{
{ // This includes dpi adjustment
QScreen* screen=app.primaryScreen();
if(screen){
QRenderStats::instance().set_display_width_height(screen->size().width(),screen->size().height());
Expand All @@ -234,20 +265,8 @@ int main(int argc, char *argv[]) {
applePlatform->registerNotifications();
#endif

QOpenHD::instance().keep_screen_on(true);
#if defined(__android__)
qDebug()<<"Android request permissions";
for(const QString &permission : permissions) {
auto result = QtAndroid::checkPermission(permission);
if (result == QtAndroid::PermissionResult::Denied) {
auto resultHash = QtAndroid::requestPermissionsSync(QStringList({permission}));
if (resultHash[permission] == QtAndroid::PermissionResult::Denied) {
return 0;
}
}
}
#endif

QOpenHD::instance().keep_screen_on(true);
android_check_permissions();
load_fonts();

qmlRegisterType<SpeedLadder>("OpenHD", 1, 0, "SpeedLadder");
Expand All @@ -256,8 +275,6 @@ int main(int argc, char *argv[]) {
qmlRegisterType<HorizonLadder>("OpenHD", 1, 0, "HorizonLadder");
qmlRegisterType<FlightPathVector>("OpenHD", 1, 0, "FlightPathVector");
qmlRegisterType<AoaGauge>("OpenHD", 1, 0, "AoaGauge");
qmlRegisterType<PerformanceHorizonLadder>("OpenHD", 1, 0, "PerformanceHorizonLadder");


QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("_qopenhd", &QOpenHD::instance());
Expand All @@ -269,11 +286,15 @@ int main(int argc, char *argv[]) {
// Needs to be registered first, otherwise we can have threading issue(s)
engine.rootContext()->setContextProperty("_messageBoxInstance", &WorkaroundMessageBox::instance());
engine.rootContext()->setContextProperty("_restartqopenhdmessagebox", &RestartQOpenHDMessageBox::instance());
engine.rootContext()->setContextProperty("_mouseHelper", &MouseHelper::instance());

engine.rootContext()->setContextProperty("_qrenderstats", &QRenderStats::instance());

engine.rootContext()->setContextProperty("_ohdlogMessagesModel", &LogMessagesModel::instanceOHD());
engine.rootContext()->setContextProperty("_fclogMessagesModel", &LogMessagesModel::instanceFC());
//engine.rootContext()->setContextProperty("_ohdlogMessagesModel", &LogMessagesModel::instanceOHD());
//engine.rootContext()->setContextProperty("_fclogMessagesModel", &LogMessagesModel::instanceFC());
engine.rootContext()->setContextProperty("_logGround", &LogMessagesModel::instanceGround());
engine.rootContext()->setContextProperty("_logOpenhdAir", &LogMessagesModel::instanceOHDAir());
engine.rootContext()->setContextProperty("_logFC", &LogMessagesModel::instanceFC());
engine.rootContext()->setContextProperty("_hudLogMessagesModel", &HUDLogMessagesModel::instance());

// Telemetry - first all the models
Expand All @@ -282,6 +303,8 @@ int main(int argc, char *argv[]) {
engine.rootContext()->setContextProperty("_ohdSystemAirSettingsModel", &MavlinkSettingsModel::instanceAir());
engine.rootContext()->setContextProperty("_ohdSystemGroundSettings", &MavlinkSettingsModel::instanceGround());
engine.rootContext()->setContextProperty("_wbLinkSettingsHelper", &WBLinkSettingsHelper::instance());
engine.rootContext()->setContextProperty("_frequencyHelper", &FrequencyHelper::instance());
engine.rootContext()->setContextProperty("_pollutionHelper", &PollutionHelper::instance());
engine.rootContext()->setContextProperty("_fcMavlinkSystem", &FCMavlinkSystem::instance());
engine.rootContext()->setContextProperty("_fcMavlinkAction", &FCAction::instance());
engine.rootContext()->setContextProperty("_fcMavlinkMissionItemsModel", &FCMavlinkMissionItemsModel::instance());
Expand Down Expand Up @@ -373,7 +396,7 @@ int main(int argc, char *argv[]) {

QRenderStats::instance().register_to_root_window(engine);

LogMessagesModel::instanceOHD().addLogMessage("QOpenHD","running");
LogMessagesModel::instanceGround().addLogMessage("QOpenHD","running");
const int retval = app.exec();

return retval;
Expand Down
13 changes: 10 additions & 3 deletions app/osd/altitudeladder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include "debug_overdraw.hpp"

static constexpr int DEFAULT_FONT_PIXEL_SIZE=11;

AltitudeLadder::AltitudeLadder(QQuickItem *parent): QQuickPaintedItem(parent) {
qDebug() << "AltitudeLadder::AltitudeLadder()";
setRenderTarget(RenderTarget::FramebufferObject);
Expand All @@ -19,8 +21,6 @@ void AltitudeLadder::paint(QPainter* painter) {
setFillColor(QColor::fromRgb(0,255,0,128));
}

QFont font("sans-serif", 10, QFont::Bold, false);

painter->setFont(m_font);

auto alt = m_altitude;
Expand Down Expand Up @@ -121,6 +121,13 @@ void AltitudeLadder::setAltitudeRange(int altitudeRange) {
void AltitudeLadder::setFontFamily(QString fontFamily) {
m_fontFamily = fontFamily;
emit fontFamilyChanged(m_fontFamily);
m_font = QFont(m_fontFamily, 11, QFont::Bold, false);
m_font = QFont(m_fontFamily, DEFAULT_FONT_PIXEL_SIZE*m_custom_font_scale, QFont::Bold, false);
update();
}

void AltitudeLadder::set_custom_font_scale(double custom_font_scale)
{
m_custom_font_scale=custom_font_scale;
m_font.setPointSize(DEFAULT_FONT_PIXEL_SIZE*m_custom_font_scale);
update();
}
8 changes: 7 additions & 1 deletion app/osd/altitudeladder.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include <QQuickPaintedItem>
#include <QPainter>

#include "../../../lib/lqtutils_master/lqtutils_prop.h"

class AltitudeLadder : public QQuickPaintedItem {
Q_OBJECT
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
Expand All @@ -10,7 +12,8 @@ class AltitudeLadder : public QQuickPaintedItem {
// actual altitude, unit - less
Q_PROPERTY(int altitude MEMBER m_altitude WRITE set_altitude NOTIFY altitude_changed)
Q_PROPERTY(QString fontFamily MEMBER m_fontFamily WRITE setFontFamily NOTIFY fontFamilyChanged)

public:
Q_PROPERTY(double custom_font_scale WRITE set_custom_font_scale)
public:
explicit AltitudeLadder(QQuickItem* parent = nullptr);

Expand All @@ -25,6 +28,7 @@ public slots:
void setAltitudeRange(int altitudeRange);
void set_altitude(double alt);
void setFontFamily(QString fontFamily);
void set_custom_font_scale(double custom_font_scale);
signals:
void colorChanged(QColor color);
void glowChanged(QColor glow);
Expand All @@ -43,4 +47,6 @@ public slots:
QString m_fontFamily;
QFont m_font;

double m_custom_font_scale=1.0;

};
1 change: 0 additions & 1 deletion app/osd/aoagauge.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include <QQuickPaintedItem>
#include <QPainter>


class AoaGauge : public QQuickPaintedItem {
Q_OBJECT
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
Expand Down
1 change: 1 addition & 0 deletions app/osd/debug_overdraw.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
// Such that we can enable / disable the "overdraw debugging" with just a single variable change
static constexpr bool ENABLE_DEBUG_OVERDRAW=false;


#endif // DEBUG_OVERDRAW_HPP
1 change: 0 additions & 1 deletion app/osd/flightpathvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include <QQuickPaintedItem>
#include <QPainter>


class FlightPathVector : public QQuickPaintedItem {
Q_OBJECT
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
Expand Down
11 changes: 10 additions & 1 deletion app/osd/headingladder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include "debug_overdraw.hpp"

static constexpr int DEFAULT_FONT_PIXEL_SIZE=11;

HeadingLadder::HeadingLadder(QQuickItem *parent): QQuickPaintedItem(parent) {
qDebug() << "HeadingLadder::HeadingLadder()";
setRenderTarget(RenderTarget::FramebufferObject);
Expand Down Expand Up @@ -235,6 +237,13 @@ void HeadingLadder::setHomeHeading(int homeHeading) {
void HeadingLadder::setFontFamily(QString fontFamily) {
m_fontFamily = fontFamily;
emit fontFamilyChanged(m_fontFamily);
m_font = QFont(m_fontFamily, 11, QFont::Bold, false);
m_font = QFont(m_fontFamily, DEFAULT_FONT_PIXEL_SIZE*m_custom_font_scale, QFont::Bold, false);
update();
}

void HeadingLadder::set_custom_font_scale(double custom_font_scale)
{
m_custom_font_scale=custom_font_scale;
m_font.setPointSize(DEFAULT_FONT_PIXEL_SIZE*m_custom_font_scale);
update();
}
Loading
Loading