fix(window): ellipsize

This commit is contained in:
Alexis 2018-11-20 23:24:33 +01:00
parent 69fceb1c92
commit b3559328f1
2 changed files with 4 additions and 3 deletions

View File

@ -26,9 +26,6 @@
"sway/mode": { "sway/mode": {
"format": "{}" "format": "{}"
}, },
"sway/window": {
"max-length": 50
},
"tray": { "tray": {
// "icon-size": 21, // "icon-size": 21,
"spacing": 10 "spacing": 10

View File

@ -4,6 +4,10 @@ waybar::modules::sway::Window::Window(Bar &bar, const Json::Value& config)
: ALabel(config, "{}"), bar_(bar), windowId_(-1) : ALabel(config, "{}"), bar_(bar), windowId_(-1)
{ {
label_.set_name("window"); label_.set_name("window");
if (label_.get_max_width_chars() == -1) {
label_.set_hexpand(true);
label_.set_ellipsize(Pango::EllipsizeMode::ELLIPSIZE_END);
}
ipc_.connect(); ipc_.connect();
ipc_.subscribe("[\"window\",\"workspace\"]"); ipc_.subscribe("[\"window\",\"workspace\"]");
getFocusedWindow(); getFocusedWindow();