Migrate cpu, cpu_usage, cpu_frequency and memory to the generic
updateLabelAndTooltip/ForState helper so label and tooltip rendering go
through the dedup-aware setters and shared tooltip-format resolution.
Add store-accepting overloads of the helper to ALabel for modules that
build a dynamic fmt argument store (per-core cpu stats). cpu keeps its
tooltip-format-<state> selection via the state overload; the others keep
their existing tooltip-format-only behavior.
Modules duplicated the same boilerplate to format their label and tooltip
(read tooltip-format, fmt::format, set_tooltip_markup) across ~29 modules.
Add updateLabelAndTooltip(labelFormat, tooltipDefault, args...) and its
state-aware variant updateLabelAndTooltipForState(state, ...) to ALabel: they
build a single fmt arg store, render the label and the resolved tooltip format
(tooltip-format[-state] or default) through the dedup-aware setters, honoring
the tooltip toggle. resolveTooltipFormat() centralizes the format resolution.
Migrate temperature and disk as the first adopters.
- Declare event handler in ALabel virtual so the idle_inhibitor can
overriding them
- Handle the right click event in idle_inhibitor and call ALabel handler if needed
This patch adds 3 new configuration options applicable for
subclasses of ALabel. The options can be used to execute
user defined code in response to the 3 mouse events:
* on-click: The left mouse button click
* on-scroll-up
* on-scroll-down
This patch also modifies the behaviour of the format-alt toggle
such that when the on-click event is configured, format-alt is
toggled on any mouse click other than left click. When on-click
is not defined, any mouse button would toggle format-alt.
Signed-off-by: Harish Krupo <harishkrupo@gmail.com>