Merge pull request #287 from jonvaldes/master

Allow rotating label contents by specifying a new "rotate" property
This commit is contained in:
Alex 2019-04-26 09:39:52 +02:00 committed by GitHub
commit 20cf7592aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -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));