refactor app code (#93)

This commit is contained in:
Ken Van Hoeylandt
2024-11-26 22:17:01 +01:00
committed by GitHub
parent a312bd5527
commit d7b151ab88
40 changed files with 367 additions and 439 deletions
@@ -8,7 +8,7 @@ namespace tt::app::imageviewer {
#define TAG "image_viewer"
static void on_show(App app, lv_obj_t* parent) {
static void on_show(App& app, lv_obj_t* parent) {
lv_obj_set_flex_flow(parent, LV_FLEX_FLOW_COLUMN);
lvgl::toolbar_create(parent, app);
@@ -22,7 +22,7 @@ static void on_show(App app, lv_obj_t* parent) {
lv_obj_t* image = lv_img_create(wrapper);
lv_obj_align(image, LV_ALIGN_CENTER, 0, 0);
const Bundle& bundle = tt_app_get_parameters(app);
const Bundle& bundle = app.getParameters();
std::string file_argument;
if (bundle.optString(IMAGE_VIEWER_FILE_ARGUMENT, file_argument)) {
std::string prefixed_path = "A:" + file_argument;
@@ -35,7 +35,7 @@ extern const Manifest manifest = {
.id = "ImageViewer",
.name = "Image Viewer",
.type = TypeHidden,
.on_show = &on_show
.onShow = &on_show
};
} // namespace