Widgets don't draw correctly #11

Closed
opened 2022-05-24 13:17:51 +02:00 by CommanderRedYT · 3 comments
CommanderRedYT commented 2022-05-24 13:17:51 +02:00 (Migrated from github.com)

Currently, currentDisplay->start() is called before currentDisplay->initScreen();.
e953ec9216/src/screenmanager.h (L31-L35)

On the other hand, some widgets create a white border when start() is called.
e953ec9216/src/widgets/progressbar.cpp (L15-L19)

currentDisplay->initScreen() just fills the whole Screen with TFT_BLACK.

This means, things like white borders will be overdrawn with TFT_BLACK.

Currently, currentDisplay->start() is called before currentDisplay->initScreen();. https://github.com/0xFEEDC0DE64/esp-gui-lib/blob/e953ec9216f7d8c5fc36592e91406dce557d4268/src/screenmanager.h#L31-L35 On the other hand, some widgets create a white border when start() is called. https://github.com/0xFEEDC0DE64/esp-gui-lib/blob/e953ec9216f7d8c5fc36592e91406dce557d4268/src/widgets/progressbar.cpp#L15-L19 currentDisplay->initScreen() just fills the whole Screen with TFT_BLACK. This means, things like white borders will be overdrawn with TFT_BLACK.
CommanderRedYT commented 2022-05-24 13:21:02 +02:00 (Migrated from github.com)

A valid fix would be to call currentDisplay->initScreen() before currentDisplay->start()

A valid fix would be to call currentDisplay->initScreen() before currentDisplay->start()
0xFEEDC0DE64 commented 2022-05-24 13:23:06 +02:00 (Migrated from github.com)

Widget::start should only be called from Display::initScreen

Widget::start should only be called from Display::initScreen
CommanderRedYT commented 2022-05-24 13:25:00 +02:00 (Migrated from github.com)

Oh okay, but still, currentDisplay->initScreen() only fills the screen black.

Also, the start functions of the widgets get called in the Displays start function. This would mean that refactoring would be needed to move the widget.start() functions to initScreen

Oh okay, but still, currentDisplay->initScreen() only fills the screen black. Also, the start functions of the widgets get called in the Displays start function. This would mean that refactoring would be needed to move the widget.start() functions to initScreen
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: feedc0de/esp-gui-lib#11
No description provided.