Merge pull request #828 from pedrocr/fix-multiline-labels

Prevent line breaks in ellipsized labels
This commit is contained in:
Alex 2020-08-20 08:57:54 +02:00 committed by GitHub
commit 3c5fd4ba84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -22,8 +22,10 @@ ALabel::ALabel(const Json::Value& config, const std::string& name, const std::st
if (config_["max-length"].isUInt()) {
label_.set_max_width_chars(config_["max-length"].asUInt());
label_.set_ellipsize(Pango::EllipsizeMode::ELLIPSIZE_END);
label_.set_single_line_mode(true);
} else if (ellipsize && label_.get_max_width_chars() == -1) {
label_.set_ellipsize(Pango::EllipsizeMode::ELLIPSIZE_END);
label_.set_single_line_mode(true);
}
if (config_["rotate"].isUInt()) {