convert title.max parameter to int

This commit is contained in:
Stepan Kurennykh 2019-05-20 21:33:19 +03:00
parent 9d9bf0fa8e
commit c5c0fc40b6

View file

@ -47,10 +47,11 @@ class Module(bumblebee.engine.Module):
return self.focused_title(widget) return self.focused_title(widget)
def focused_title(self, widget): def focused_title(self, widget):
title = self._full_title[0:self.parameter("max", 64)] max = int(self.parameter("max", 64))
title = self._full_title[0:max]
placeholder = self.parameter("placeholder", "...") placeholder = self.parameter("placeholder", "...")
if title != self._full_title: if title != self._full_title:
title = self._full_title[0:self.parameter("max", 64) - len(placeholder)] title = self._full_title[0:max - len(placeholder)]
title = "{}{}".format(title, placeholder) title = "{}{}".format(title, placeholder)
return title return title