refactor(AModule): hoist format/tooltip resolution to the base module

Move resolveTooltipFormat() (and add resolveFormat()) from ALabel down into
AModule, and add a generic updateTooltip(Gtk::Widget&, ...) helper. This lets
modules that are not ALabel-derived reuse the shared tooltip logic instead of
re-implementing it. Migrate gamemode (the only non-ALabel module reading
tooltip-format) to updateTooltip(box_, ...). ALabel inherits the resolvers.
This commit is contained in:
Alex
2026-07-04 00:17:14 +02:00
parent f059337beb
commit 003d531701
3 changed files with 41 additions and 16 deletions
+1 -4
View File
@@ -210,10 +210,7 @@ auto Gamemode::update() -> void {
lastStatus = status;
// Tooltip
if (tooltip) {
std::string text = fmt::format(fmt::runtime(tooltip_format), fmt::arg("count", gameCount));
box_.set_tooltip_markup(text);
}
updateTooltip(box_, tooltip_format, fmt::arg("count", gameCount));
// Label format
std::string str = fmt::format(fmt::runtime(showAltText ? format_alt : format),