Combo widgets
Idea It would be great to have the possibility to overlap "widgets". With this, we can create complex displays e.g. text on bar !
What is the current problem with this? Each display (text or bar) is commit at creation using fake transparency. So two "widgets" embed their own background. This prevents overlapping "widgets".
Workaround
When creating a "widget" we can commit changes according to a boolean variable. If set to true, changes are not commit and another "widget" is created overlapping possibly the prior "widget".
AFAIK all themes only use a unique background. So we can use an instance variable (of LCD) for the background.
Each time we want to create overlapping "widgets", we use a copy of this background and create "widgets" on this background.
For example with simple-program.py example and two overlapping widgets:

When overlapping is finished, we commit changes:

In the code Create four instance variables:
-
bg_imagethe background used in the theme -
combothe boolean variable whether a "combowidget" is currently in progress -
combo_imagecopy ofbg_imagewith each "widget" of the "combowidget" -
combo_bboxa list of bbox of each "widget" inside the "combowidget"
A commit display method:
DisplayCommit : it takes the combo_image and the combo_bbox and call DisplayPILImage for each bbox (with crop).
Complexity
As informations to be displayed would be the same, there are no additional drawings. But, as DisplayCommit would work on each bounding boxes, overlapping zones would be drawn several times... unless a smart algorithm identifies common zones.
In the yaml files
We can create a COMBO section in existing sections for example:
...
GPU:
# In seconds. Longer intervals cause this to refresh more slowly.
# Setting to lower values will display near real time data,
# but may cause significant CPU usage or the display not to update properly
INTERVAL: 1
COMBO:
BACKGROUND_IMAGE: background.png
PERCENTAGE:
GRAPH:
SHOW: True
X: 350
Y: 200
WIDTH: 125
HEIGHT: 15
MIN_VALUE: 0
MAX_VALUE: 100
BAR_COLOR: 0, 0, 255
BAR_OUTLINE: False
TEXT:
SHOW: True
SHOW_UNIT: True
X: 360
Y: 200
FONT: jetbrains-mono/JetBrainsMono-Bold.ttf
FONT_SIZE: 40
FONT_COLOR: 255, 255, 255
...
Impact on today's themes
None of the current themes would be impacted.
Default behavior is to have combo boolean to falsy value so that each creation is commit immediately.
On Radial Progress Bar (PR) It would allow to separate the radial bar from the text and users to place text independently of the radial bar.
edit: yaml
I've implemented it. It's globally fine but you have to ensure each bbox's widget not to change its size (especially on texts)... unless background keeps track of former widget and continue to display pieces that does not correspond to current state.
A font using f{my_text:3} is OK:

Unless you have a piece of letter 'C' at the right of the image below (100°C has been previously displayed):

I guess there will be also some issues with fonts other than monospace type.