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] 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 315104c..cbbc57f 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));