neu-rah / ArduinoMenu

Arduino generic menu/interactivity system
GNU Lesser General Public License v2.1
933 stars 189 forks source link

Header text last character lost when entering submenu #323

Open hipotenusa opened 3 years ago

hipotenusa commented 3 years ago

Hello and thanks for sharing this wonderful time saving library!!

In my menu, I have a "Conf. Portal" submenu. Its prompt is displayed Ok while browsing:

image

But when I enter in the Submenu, last character of its prompt is lost, getting a remainder "Conf. Porta":

image

TOGGLE(configPortalRunning,subMenuSetConfigPortal,"",doNothing,noEvent,noStyle//,doExit,enterEvent,noStyle
  ,VALUE("Enabled",HIGH,doConfigPortal,noEvent)
  ,VALUE("Disabled",LOW,doConfigPortal,noEvent)
);

MENU(subMenuConfigPortal,"Conf. Portal",doNothing,noEvent,noStyle
  ,SUBMENU(subMenuSetConfigPortal)
  ,EXIT("<Back")
);

MENU(subMenuWiFi,"WiFi",doNothing,noEvent,noStyle
  ,SUBMENU(subMenuConfigPortal)
  ,EXIT("<Back")
);

MENU(mainMenu,"Main menu",doNothing,noEvent,wrapStyle
  ,SUBMENU(subMenuWiFi)
  ,EXIT("<Back")
);

Does anyone know how to sort it out?

Thanks!

neu-rah commented 3 years ago

Hi, this looks a lot like a bug... I have to do a similar setup to track it down, what display driver are you using?

hipotenusa commented 3 years ago

It´s a ST7735 + TFT_eSPI

hipotenusa commented 3 years ago

Giving text "Conf. Portal" to mainmenu prompt has the same effect: last character is not displayed. This issue may be related with #320. I have 12 characters available on submenus but only 11 on the title header I am at your disposition if I can be of any help

hipotenusa commented 1 year ago

Back to this issue it´s related with the panel definition., specifically with the font width. My original definition was:

#define fontW 12

and changing to:

#define fontW 10

made the title caption to appear completely:

Captura de pantalla 2022-11-01 170209

What is not clear yet to me is if this is a real issue or just a wrong font configuration given that the title was the only trimmed text and I assume the font setting is general for all lines of text.