From a7d22edcdaba208f4bf4115cc012f53ffd90cbbc Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Sat, 29 Feb 2020 20:57:00 +0100 Subject: [PATCH] [core/output] Add prefix/suffix metadata see #561 --- bumblebee/output.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bumblebee/output.py b/bumblebee/output.py index 390e205..10be627 100644 --- a/bumblebee/output.py +++ b/bumblebee/output.py @@ -397,6 +397,7 @@ class WidgetDrawer(object): if self._prefix: self._full_text = u"{}{}".format(self._prefix, self._full_text) + return self._prefix def add_suffix_iconmarkup(self, widget): """add custom Pango markup for suffix""" @@ -412,6 +413,7 @@ class WidgetDrawer(object): if self._suffix: self._full_text = u"{}{}".format(self._full_text, self._suffix) + return self._suffix def escape_amp(self): """escape & in full_text, because pango requires it""" @@ -441,10 +443,8 @@ class WidgetDrawer(object): raw = self._full_text padding = self._theme.padding(widget) - - self.add_prefix(widget, padding) - - self.add_suffix(widget, padding) + prefix = self.add_prefix(widget, padding) + suffix = self.add_suffix(widget, padding) width = self._theme.minwidth(widget) @@ -466,6 +466,8 @@ class WidgetDrawer(object): "name": module.id, "markup": self._markup, "_raw": raw, + "_prefix": prefix, + "_suffix": suffix, }) return self._widgets