Skip to content

Commit

Permalink
rock mods
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelscholle committed Nov 23, 2023
1 parent 1de26f7 commit 9e06f4f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/build_package_Rock5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- "2.5-evo"
- "dev-release"
- "release"
- "experiments"
paths-ignore:
- '**.md'
- '**.asciidoc'
Expand Down
4 changes: 3 additions & 1 deletion app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,15 @@ int main(int argc, char *argv[]) {
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(QOpenHD::instance().is_platform_rpi() || QOpenHD::instance().is_platform_rock()){
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 Down
8 changes: 8 additions & 0 deletions app/util/qopenhd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,14 @@ bool QOpenHD::is_platform_rpi()
#endif
}

bool QOpenHD::is_platform_rock()
{
#ifdef IS_PLATFORM_Rock
return true;
#else
return false;
#endif
}

void QOpenHD::keep_screen_on(bool on)
{
Expand Down
1 change: 1 addition & 0 deletions app/util/qopenhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class QOpenHD : public QObject

Q_INVOKABLE bool is_valid_ip(QString ip);
Q_INVOKABLE bool is_platform_rpi();
Q_INVOKABLE bool is_platform_rock();
//
// Tries to mimic android toast as much as possible
//
Expand Down

0 comments on commit 9e06f4f

Please sign in to comment.