From f8ae1534db98c8f7c1138e4f93da63fd37de8b39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Vald=C3=A9s?= Date: Thu, 25 Apr 2019 22:47:58 +0200 Subject: [PATCH 1/2] Allow rotating label contents by specifying a new "rotate" property in the label config --- src/ALabel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ALabel.cpp b/src/ALabel.cpp index 315104c3..cbbc57f8 100644 --- a/src/ALabel.cpp +++ b/src/ALabel.cpp @@ -16,6 +16,11 @@ waybar::ALabel::ALabel(const Json::Value& config, const std::string& format, uin label_.set_max_width_chars(config_["max-length"].asUInt()); label_.set_ellipsize(Pango::EllipsizeMode::ELLIPSIZE_END); } + + if (config_["rotate"].isUInt()) { + label_.set_angle(config["rotate"].asUInt()); + } + if (config_["format-alt"].isString()) { event_box_.add_events(Gdk::BUTTON_PRESS_MASK); event_box_.signal_button_press_event().connect(sigc::mem_fun(*this, &ALabel::handleToggle)); From 9fe29c37b409d20730e8f3af645a15c9b3a6ac47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Vald=C3=A9s?= Date: Thu, 25 Apr 2019 22:56:14 +0200 Subject: [PATCH 2/2] Fix indentation --- src/ALabel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ALabel.cpp b/src/ALabel.cpp index cbbc57f8..1aee1bb7 100644 --- a/src/ALabel.cpp +++ b/src/ALabel.cpp @@ -18,7 +18,7 @@ waybar::ALabel::ALabel(const Json::Value& config, const std::string& format, uin } if (config_["rotate"].isUInt()) { - label_.set_angle(config["rotate"].asUInt()); + label_.set_angle(config["rotate"].asUInt()); } if (config_["format-alt"].isString()) {