From 466807352289e32cea7b028f10444a47020ca74f Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Wed, 6 Sep 2023 01:06:27 +0200 Subject: [PATCH] Word-wrap buttons pages Taking advantage of the algorithm created for notifications. --- nspanel_esphome.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index f79c4d8..0e5fd81 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -7,8 +7,6 @@ substitutions: - notification_line_length_limit: "39" - ##### DON'T CHANGE THIS ##### version: "4.0dev" ############################# @@ -375,7 +373,8 @@ api: //id(disp1).set_component_font_color(btntext.c_str(), btn_txt_font); //id(disp1).set_component_font_color(btnbri.c_str(), btn_bri_font); id(disp1).set_component_text_printf(btnicon.c_str(), "%s", btn_icon.c_str()); - id(disp1).set_component_text_printf(btntext.c_str(), "%s", btn_label.c_str()); + //id(disp1).set_component_text_printf(btntext.c_str(), "%s", btn_label.c_str()); + id(display_wrapped_text).execute(btntext.c_str(), btn_label.c_str(), 10); // id(disp1).set_component_text_printf(btnbri.c_str(), "%s", btn_bri_txt.c_str()); if (strcmp(btn_bri_txt.c_str(), "0") != 0) { id(disp1).set_component_text_printf(btnbri.c_str(), "%s", btn_bri_txt.c_str());