implemented basic desktop

This commit is contained in:
Ken Van Hoeylandt
2024-01-03 14:13:13 +01:00
parent f6c547ad45
commit 48d2fd6c2d
19 changed files with 241 additions and 219 deletions
+1 -15
View File
@@ -3,14 +3,6 @@
#include "apps/services/gui/gui.h"
#include "apps/services/loader/loader.h"
static void on_button_click(lv_event_t _Nonnull* event) {
UNUSED(event);
FURI_RECORD_TRANSACTION(RECORD_LOADER, Loader*, loader, {
loader_start_app_nonblocking(loader, "systeminfo", NULL);
})
}
static void app_show(lv_obj_t* parent, void* context) {
UNUSED(context);
@@ -19,13 +11,7 @@ static void app_show(lv_obj_t* parent, void* context) {
lv_obj_set_width(label, 200);
lv_obj_set_style_text_align(label, LV_TEXT_ALIGN_CENTER, 0);
lv_label_set_text(label, "Hello, world!");
lv_obj_align(label, LV_ALIGN_CENTER, 0, -30);
lv_obj_t* btn = lv_btn_create(parent);
label = lv_label_create(btn);
lv_label_set_text_static(label, "System Info");
lv_obj_align(btn, LV_ALIGN_CENTER, 0, 30);
lv_obj_add_event_cb(btn, on_button_click, LV_EVENT_CLICKED, NULL);
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);
}
const AppManifest hello_world_app = {
+7 -7
View File
@@ -20,11 +20,11 @@ __attribute__((unused)) void app_main(void) {
nanobake_start(&config);
FURI_RECORD_TRANSACTION(RECORD_LOADER, Loader*, loader, {
FuriString* error_message = furi_string_alloc();
if (loader_start_app(loader, hello_world_app.id, NULL, error_message) != LoaderStatusOk) {
FURI_LOG_E(hello_world_app.id, "%s\r\n", furi_string_get_cstr(error_message));
}
furi_string_free(error_message);
});
// FURI_RECORD_TRANSACTION(RECORD_LOADER, Loader*, loader, {
// FuriString* error_message = furi_string_alloc();
// if (loader_start_app(loader, hello_world_app.id, NULL, error_message) != LoaderStatusOk) {
// FURI_LOG_E(hello_world_app.id, "%s\r\n", furi_string_get_cstr(error_message));
// }
// furi_string_free(error_message);
// });
}