From 7b527c2767decaa9b34b93d5c2306c260be40b9f Mon Sep 17 00:00:00 2001 From: shadow578 <52449218+shadow578@users.noreply.github.com> Date: Thu, 4 Apr 2024 21:28:07 +0200 Subject: [PATCH] add progress bar padding at top --- src/modules/screens/dwin/DwinScreen.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/screens/dwin/DwinScreen.cpp b/src/modules/screens/dwin/DwinScreen.cpp index 00b1318..cdaaa0b 100644 --- a/src/modules/screens/dwin/DwinScreen.cpp +++ b/src/modules/screens/dwin/DwinScreen.cpp @@ -8,6 +8,7 @@ constexpr uint8_t font_height = dwin::font_size::get_character_height(font_size) constexpr uint8_t font_width = dwin::font_size::get_character_width(font_size); constexpr int progress_bar_height = font_height * 2; +constexpr int progress_bar_padding_top = font_height; constexpr dwin::color::color progress_bar_color = dwin::color::green; constexpr dwin::color::color progress_bar_background_color = dwin::color::black; constexpr dwin::color::color progress_bar_outline_color = dwin::color::white; @@ -23,8 +24,8 @@ void DwinScreen::init() flush(); const dwin::rectangle screen_area = dwin::get_screen_area(orientation); - text_area = {0, 0, screen_area.width, screen_area.height - progress_bar_height}; - progress_bar_area = {0, screen_area.height - progress_bar_height, screen_area.width, progress_bar_height - 1}; // -1 to avoid screen overflow + text_area = {0, 0, screen_area.width, screen_area.height - progress_bar_height - progress_bar_padding_top}; + progress_bar_area = {0, screen_area.height - progress_bar_height, screen_area.width, progress_bar_height - 1}; // -1 to avoid screen wrap-around } void DwinScreen::clear()