From 07d8dfb3d68b95d46641c57559a3baeb433d6c2c Mon Sep 17 00:00:00 2001 From: Alexis Date: Fri, 26 Oct 2018 12:08:50 +0200 Subject: [PATCH] feat(tray): spacing config --- resources/config | 3 +++ resources/style.css | 2 +- src/modules/sni/tray.cpp | 7 ++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/resources/config b/resources/config index 45b6a0af..b953858c 100644 --- a/resources/config +++ b/resources/config @@ -26,6 +26,9 @@ "sway/window": { "max-length": 50 }, + "tray": { + "spacing": 10 + }, "clock": { "format-alt": "{:%Y-%m-%d}" }, diff --git a/resources/style.css b/resources/style.css index d15c8947..0eb1680d 100644 --- a/resources/style.css +++ b/resources/style.css @@ -93,4 +93,4 @@ window#waybar { #tray { background-color: #2980b9; -} +} \ No newline at end of file diff --git a/src/modules/sni/tray.cpp b/src/modules/sni/tray.cpp index 92d2b189..c29ad9d4 100644 --- a/src/modules/sni/tray.cpp +++ b/src/modules/sni/tray.cpp @@ -3,7 +3,12 @@ #include waybar::modules::SNI::Tray::Tray(const Json::Value &config) - : config_(config), watcher_(), host_(&dp) {} + : config_(config), watcher_(), host_(&dp) +{ + if (config_["spacing"].isUInt()) { + box_.set_spacing(config_["spacing"].asUInt()); + } +} auto waybar::modules::SNI::Tray::update() -> void { for (auto &item : host_.items) {