Commit graph

10 commits

Author SHA1 Message Date
Daniel Eklöf
22507ae26c particle: add utility function to render a particle's decoration 2018-12-29 21:00:03 +01:00
Daniel Eklöf
5fc29f7bbe particles: name private structs and variables consistently 2018-12-29 20:40:25 +01:00
Daniel Eklöf
1f182b862e particle/progress-bar: allow user to configure an on-click handler
Since we're typically interrested in *where* (on the progress-bar) the
user clicked, we need a way to pass the clicked position to the
handler.

Normally, the on-click handler is expanded when a particle
instantiates its exposable. At this point, we (obviously) don't have
the click position.

This is solved by expanding the handler a second time, when the bar is
clicked.

Thus, the user can use the "{where}" tag in the click handler. "where"
will be expanded to a percentage value (0-100).
2018-12-29 17:36:34 +01:00
Daniel Eklöf
5164d1d6ea particle: add an 'on_click_template' to base constructor.
This is intended to be a format-like string, with the possibility to
use tag formatters.

The expanded string will later be passed to the system() call.
2018-12-29 14:36:18 +01:00
Daniel Eklöf
e8d8bf70d3 exposable: add a "common" constructor and default destructor 2018-12-29 12:51:31 +01:00
Daniel Eklöf
f2a3deb362 particle/progress-bar: disable debug logging 2018-12-28 14:14:31 +01:00
Daniel Eklöf
3027b6cd9e particle/progress-bar: add debug log 2018-12-28 14:05:17 +01:00
Daniel Eklöf
13cc11e200 tag: refresh_in() *must* use the realtime unit 2018-12-28 14:04:35 +01:00
Daniel Eklöf
adb70e9f35 particle/progress-bar: force-refresh realtime tags
When we're tracking a realtime tag, calculate the time left until the
next segment in the progress bar will get filled, and schedule a force
refresh.
2018-12-28 12:43:54 +01:00
Daniel Eklöf
8d94202057 particle/progress-bar: renders a progrss-bar-like thingy 2018-12-27 14:22:05 +01:00