Cleanup and improvements (#194)
- Lots of changes for migrating C code to C++ - Improved `Lockable` in several ways like adding `withLock()` (+ tests) - Improved `Semaphore` a bit for improved readability, and also added some tests - Upgrade Linux machine in GitHub Actions so that we can compile with a newer GCC - Simplification of WiFi connection - Updated funding options - (and more)
This commit is contained in:
committed by
GitHub
parent
1bb1260ea0
commit
6c67845645
@@ -1,9 +1,12 @@
|
||||
#include "Check.h"
|
||||
#include "Tactility.h"
|
||||
#include "app/AppContext.h"
|
||||
#include "app/ManifestRegistry.h"
|
||||
#include "Check.h"
|
||||
#include "lvgl.h"
|
||||
#include "service/loader/Loader.h"
|
||||
|
||||
#define TAG "launcher"
|
||||
|
||||
namespace tt::app::launcher {
|
||||
|
||||
static void onAppPressed(TT_UNUSED lv_event_t* e) {
|
||||
@@ -44,6 +47,14 @@ static lv_obj_t* createAppButton(lv_obj_t* parent, const char* title, const char
|
||||
|
||||
class LauncherApp : public App {
|
||||
|
||||
void onStart(TT_UNUSED AppContext& app) override {
|
||||
auto* config = tt::getConfiguration();
|
||||
if (!config->autoStartAppId.empty()) {
|
||||
TT_LOG_I(TAG, "auto-starting %s", config->autoStartAppId.c_str());
|
||||
tt::service::loader::startApp(config->autoStartAppId);
|
||||
}
|
||||
}
|
||||
|
||||
void onShow(TT_UNUSED AppContext& app, lv_obj_t* parent) override {
|
||||
auto* wrapper = lv_obj_create(parent);
|
||||
|
||||
@@ -64,7 +75,7 @@ class LauncherApp : public App {
|
||||
}
|
||||
|
||||
int32_t available_width = lv_display_get_horizontal_resolution(display) - (3 * 80);
|
||||
int32_t padding = is_landscape_display ? TT_MIN(available_width / 4, 64) : 0;
|
||||
int32_t padding = is_landscape_display ? std::min(available_width / 4, (int32_t)64) : 0;
|
||||
|
||||
auto paths = app.getPaths();
|
||||
auto apps_icon_path = paths->getSystemPathLvgl("icon_apps.png");
|
||||
|
||||
Reference in New Issue
Block a user