Emmanuel Lepage Vallee
3765efaccc
wibox.template: Remove the `args` in favor of passing the template directly.
...
It didn't do much and I wanted to make the syntax a drop-in replacement
of `wibox.widget {}`.
2022-10-23 19:04:28 -07:00
Emmanuel Lepage Vallee
67b2b26683
template: Bring to feature parity with the awful.widget.common implementation.
...
`awful.widget.common` has the ability to set "roles" and apply properties
to the entire widget tree. This was missing from the previous commit.
2022-10-23 19:04:28 -07:00
Aire-One
a7932b127f
add(w.w.template) template can't be a callback
...
Containers and layouts don't allow to build a widget from a callback, so
there is no reason to have this feature here.
2022-10-22 15:44:35 -07:00
Aire-One
2dab6c336c
add(w.w.template) set_template check widget
2022-10-22 15:44:35 -07:00
Aire-One
2542c3b04a
add(w.w.template) constructor accepts widget props
2022-10-22 15:44:35 -07:00
Aire-One
8803878e1f
doc(w.w.template) 3rd party lib usage example
2022-10-22 15:44:34 -07:00
Aire-One
bfe4832c63
doc(w.w.template) current methods
2022-10-22 15:44:34 -07:00
Aire-One
45a458a2b7
doc(w.w.template) module description
2022-10-22 15:44:34 -07:00
Aire-One
aaec225545
fix(w.w.template) free queued_updates array
...
This is a small cleanup to not keep in memory a value we don't need.
After the update_callback callback is called, we don't need to remember
it happens this callback was queued before. (It also prevents a
possible memory leak (of a boolean value) when widgets are destroyed)
2022-10-22 15:44:34 -07:00
Aire-One
cd5dda385e
fix(w.w.template) draw
...
The draw method exists only for widgets. When dealing with more complex
widget, this method is not necessary implemented (i.e. with layouts).
We need to check the method is defined by the child before calling it.
2022-10-22 15:44:34 -07:00
Aire-One
f12bb57c66
fix(w.w.template) fit and layout methods
...
The previous implementation for these methods was a naive attempt at
making the base widget working. We need to make sure computing the
widget's sizes is more robust for complex widget_template definition.
2022-10-22 15:44:34 -07:00
Aire-One
33d5de52c6
add(w.w.template) constructor `buttons` param
2022-10-22 15:44:34 -07:00
Aire-One
086eb146f6
add(w.w.template) implement widget as child
2022-10-22 15:44:34 -07:00
Aire-One
e7db5e3049
fix: format
2022-10-22 15:44:34 -07:00
Aire-One
f4088ca4e1
fix: rename parameter
2022-10-22 15:44:34 -07:00
Aire-One
b824d99c05
fix(update_args) move to _private property
...
Suggested by @sclu1034
2022-10-22 15:44:34 -07:00
Aire-One
2f2beb69cb
add: natural management of update arguments
2022-10-22 15:44:34 -07:00
Aire-One
a005967191
fix: variable declaration
...
Suggested by @sclu1034
2022-10-22 15:44:34 -07:00
Aire-One
d5dbb9d32e
add(update_callback) allow nil callback
...
Suggested by @sclu1034
2022-10-22 15:44:34 -07:00
Aire-One
08109a6d60
add(w.w.template) template widget
2022-10-22 15:44:34 -07:00