forked from LOWPROKB/zmk-config-zen-2
-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
74db197
commit f47f150
Showing
2 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* | ||
* Copyright (c) 2021 Darryl deHaan | ||
* SPDX-License-Identifier: MIT | ||
* | ||
*/ | ||
|
||
#include "widgets/battery_status.h" | ||
#include "widgets/peripheral_status.h" | ||
#include "widgets/output_status.h" | ||
#include "widgets/layer_status.h" | ||
#include "custom_status_screen.h" | ||
|
||
#include <zephyr/logging/log.h> | ||
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); | ||
|
||
LV_IMG_DECLARE(zenlogo); | ||
LV_IMG_DECLARE(layers2); | ||
|
||
#if IS_ENABLED(CONFIG_CUSTOM_WIDGET_BATTERY_STATUS) | ||
static struct zmk_widget_battery_status battery_status_widget; | ||
#endif | ||
|
||
#if IS_ENABLED(CONFIG_CUSTOM_WIDGET_OUTPUT_STATUS) | ||
static struct zmk_widget_output_status output_status_widget; | ||
#endif | ||
|
||
#if IS_ENABLED(CONFIG_CUSTOM_WIDGET_PERIPHERAL_STATUS) | ||
static struct zmk_widget_peripheral_status peripheral_status_widget; | ||
#endif | ||
|
||
#if IS_ENABLED(CONFIG_CUSTOM_WIDGET_LAYER_STATUS) | ||
static struct zmk_widget_layer_status layer_status_widget; | ||
#endif | ||
|
||
lv_obj_t *zmk_display_status_screen() { | ||
|
||
lv_obj_t *screen; | ||
screen = lv_obj_create(NULL); | ||
|
||
#if IS_ENABLED(CONFIG_CUSTOM_WIDGET_BATTERY_STATUS) | ||
zmk_widget_battery_status_init(&battery_status_widget, screen); | ||
lv_obj_align(zmk_widget_battery_status_obj(&battery_status_widget), LV_ALIGN_TOP_MID, 0, 2); | ||
#endif | ||
|
||
#if IS_ENABLED(CONFIG_CUSTOM_WIDGET_OUTPUT_STATUS) | ||
zmk_widget_output_status_init(&output_status_widget, screen); | ||
lv_obj_align(zmk_widget_output_status_obj(&output_status_widget), LV_ALIGN_TOP_MID, 0, 41); | ||
#endif | ||
|
||
#if IS_ENABLED(CONFIG_CUSTOM_WIDGET_PERIPHERAL_STATUS) | ||
zmk_widget_peripheral_status_init(&peripheral_status_widget, screen); | ||
lv_obj_align(zmk_widget_peripheral_status_obj(&peripheral_status_widget), LV_ALIGN_TOP_MID, 0, | ||
41); | ||
#endif | ||
|
||
#if IS_ENABLED(CONFIG_CUSTOM_WIDGET_LAYER_STATUS) | ||
lv_obj_t *LayersHeading; | ||
LayersHeading = lv_img_create(screen); | ||
lv_obj_align(LayersHeading, LV_ALIGN_BOTTOM_MID, 0, -30); | ||
lv_img_set_src(LayersHeading, &layers2); | ||
|
||
zmk_widget_layer_status_init(&layer_status_widget, screen); | ||
lv_obj_set_style_text_font(zmk_widget_layer_status_obj(&layer_status_widget), | ||
&lv_font_montserrat_16, LV_PART_MAIN); | ||
lv_obj_align(zmk_widget_layer_status_obj(&layer_status_widget), LV_ALIGN_BOTTOM_MID, 0, -5); | ||
#endif | ||
|
||
|
||
#if !IS_ENABLED(CONFIG_ZMK_SPLIT_ROLE_CENTRAL) | ||
lv_obj_t *zenlogo_icon; | ||
zenlogo_icon = lv_img_create(screen); | ||
lv_img_set_src(zenlogo_icon, &zenlogo); | ||
lv_obj_align(zenlogo_icon, LV_ALIGN_BOTTOM_MID, 0, -5); | ||
#endif | ||
|
||
return screen; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* | ||
* Copyright (c) 2021 Darryl deHaan | ||
* SPDX-License-Identifier: MIT | ||
* | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <lvgl.h> | ||
|
||
lv_obj_t *zmk_display_status_screen(); |