Make CssReloadHelper watch CSS new style on appearance change

If you have reload_style_on_change enabled, and use dynamic appearance
styling (style-dark.css and style-light.css), then changing the
appearance doesn't update the files that are being watched for reload.

Add a method to CssReloadHelper to change the CSS file being watched,
and also provide the CSS file as a parameter to the callback so setupCss
can be called on the right file when the file watcher triggers.
This commit is contained in:
BBaoVanC
2026-02-21 21:42:34 -06:00
parent 54e7451cf0
commit 55fa8cf185
4 changed files with 16 additions and 6 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
class CssReloadHelperTest : public waybar::CssReloadHelper {
public:
CssReloadHelperTest() : CssReloadHelper("/tmp/waybar_test.css", [this]() { callback(); }) {}
CssReloadHelperTest() : CssReloadHelper("/tmp/waybar_test.css", [this](const std::string&) { callback(); }) {}
void callback() { m_callbackCounter++; }