Merge pull request #389 from Stoope/fix-title-module-max

convert title.max parameter to int
This commit is contained in:
tobi-wan-kenobi 2019-05-21 18:22:30 +02:00 committed by GitHub
commit 4e854832aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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