Various improvements (#204)
- Fixed crash in logging app when not selecting filter - Cleanup of unused code - Cleanup of app code
This commit is contained in:
committed by
GitHub
parent
5ec96f60f1
commit
68e34ca740
@@ -106,30 +106,30 @@ class DisplayApp : public App {
|
||||
|
||||
lvgl::toolbar_create(parent, app);
|
||||
|
||||
lv_obj_t* main_wrapper = lv_obj_create(parent);
|
||||
auto* main_wrapper = lv_obj_create(parent);
|
||||
lv_obj_set_flex_flow(main_wrapper, LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_width(main_wrapper, LV_PCT(100));
|
||||
lv_obj_set_flex_grow(main_wrapper, 1);
|
||||
|
||||
lv_obj_t* wrapper = lv_obj_create(main_wrapper);
|
||||
auto* wrapper = lv_obj_create(main_wrapper);
|
||||
lv_obj_set_width(wrapper, LV_PCT(100));
|
||||
lv_obj_set_style_pad_all(wrapper, 8, 0);
|
||||
lv_obj_set_style_border_width(wrapper, 0, 0);
|
||||
|
||||
lv_obj_t* brightness_label = lv_label_create(wrapper);
|
||||
auto* brightness_label = lv_label_create(wrapper);
|
||||
lv_label_set_text(brightness_label, "Brightness");
|
||||
|
||||
lv_obj_t* brightness_slider = lv_slider_create(wrapper);
|
||||
auto* brightness_slider = lv_slider_create(wrapper);
|
||||
lv_obj_set_width(brightness_slider, LV_PCT(50));
|
||||
lv_obj_align(brightness_slider, LV_ALIGN_TOP_RIGHT, -8, 0);
|
||||
lv_slider_set_range(brightness_slider, 0, 255);
|
||||
lv_obj_add_event_cb(brightness_slider, onBacklightSliderEvent, LV_EVENT_VALUE_CHANGED, nullptr);
|
||||
|
||||
lv_obj_t* gamma_label = lv_label_create(wrapper);
|
||||
auto* gamma_label = lv_label_create(wrapper);
|
||||
lv_label_set_text(gamma_label, "Gamma");
|
||||
lv_obj_set_y(gamma_label, 40);
|
||||
|
||||
lv_obj_t* gamma_slider = lv_slider_create(wrapper);
|
||||
auto* gamma_slider = lv_slider_create(wrapper);
|
||||
lv_obj_set_width(gamma_slider, LV_PCT(50));
|
||||
lv_obj_align(gamma_slider, LV_ALIGN_TOP_RIGHT, -8, 40);
|
||||
lv_slider_set_range(gamma_slider, 0, hal_display->getGammaCurveCount());
|
||||
@@ -145,7 +145,7 @@ class DisplayApp : public App {
|
||||
|
||||
lv_slider_set_value(gamma_slider, 128, LV_ANIM_OFF);
|
||||
|
||||
lv_obj_t* orientation_label = lv_label_create(wrapper);
|
||||
auto* orientation_label = lv_label_create(wrapper);
|
||||
lv_label_set_text(orientation_label, "Orientation");
|
||||
lv_obj_align(orientation_label, LV_ALIGN_TOP_LEFT, 0, 80);
|
||||
|
||||
@@ -154,7 +154,7 @@ class DisplayApp : public App {
|
||||
auto vertical_px = lv_display_get_vertical_resolution(lvgl_display);
|
||||
bool is_landscape_display = horizontal_px > vertical_px;
|
||||
|
||||
lv_obj_t* orientation_dropdown = lv_dropdown_create(wrapper);
|
||||
auto* orientation_dropdown = lv_dropdown_create(wrapper);
|
||||
if (is_landscape_display) {
|
||||
lv_dropdown_set_options(orientation_dropdown, "Landscape\nLandscape (flipped)\nPortrait Left\nPortrait Right");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user