forked from kofal.net/zmk
Add uppermost, current layer status widget to oled (#493)
* Add uppermost, current layer status widget to oled * Run clang format * Fixup display widget source includes in CMakeLists * Update layer widget to only be enabled on primary half of a split keyboard and shuffle some of the options specific to the widget to be enabled via the widget * Update to latest lvgl/zmk/zephyr ; remove version text from oled per PR * Fixup file names * Remove last remenants of the version display text from the oled * Fixup clang-format Co-authored-by: KemoNine <mcrosson@kemonine.info>
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <zmk/display/widgets/output_status.h>
|
||||
#include <zmk/display/widgets/battery_status.h>
|
||||
#include <zmk/display/widgets/layer_status.h>
|
||||
#include <zmk/display/status_screen.h>
|
||||
|
||||
#include <logging/log.h>
|
||||
@@ -19,14 +20,15 @@ static struct zmk_widget_battery_status battery_status_widget;
|
||||
static struct zmk_widget_output_status output_status_widget;
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_ZMK_WIDGET_LAYER_STATUS)
|
||||
static struct zmk_widget_layer_status layer_status_widget;
|
||||
#endif
|
||||
|
||||
lv_obj_t *zmk_display_status_screen() {
|
||||
lv_obj_t *screen;
|
||||
lv_obj_t *zmk_version_label;
|
||||
|
||||
screen = lv_obj_create(NULL, NULL);
|
||||
|
||||
zmk_version_label = lv_label_create(screen, NULL);
|
||||
|
||||
#if IS_ENABLED(CONFIG_ZMK_WIDGET_BATTERY_STATUS)
|
||||
zmk_widget_battery_status_init(&battery_status_widget, screen);
|
||||
lv_obj_align(zmk_widget_battery_status_obj(&battery_status_widget), NULL, LV_ALIGN_IN_TOP_RIGHT,
|
||||
@@ -39,8 +41,11 @@ lv_obj_t *zmk_display_status_screen() {
|
||||
0);
|
||||
#endif
|
||||
|
||||
lv_label_set_text(zmk_version_label, "ZMK v0.1.0");
|
||||
lv_obj_align(zmk_version_label, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
|
||||
#if IS_ENABLED(CONFIG_ZMK_WIDGET_LAYER_STATUS)
|
||||
zmk_widget_layer_status_init(&layer_status_widget, screen);
|
||||
lv_obj_align(zmk_widget_layer_status_obj(&layer_status_widget), NULL, LV_ALIGN_IN_BOTTOM_LEFT,
|
||||
0, 0);
|
||||
#endif
|
||||
|
||||
return screen;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user