Prevent line breaks in ellipsized labels

If a label is being ellipsized it doesn't make sense to allow it to use
line breaks to have multiple lines.

Fixes #827
This commit is contained in:
Pedro Côrte-Real 2020-08-19 22:11:11 +01:00
parent 447fad34c7
commit 6f7d7e645a

View File

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