[core/output] micro-optimization refactoring
If markup isn't pango, skip the add_prefix_colors() call entirely
This commit is contained in:
parent
d1238f9dca
commit
f44d48e7bd
1 changed files with 10 additions and 10 deletions
|
@ -354,10 +354,6 @@ class WidgetDrawer(object):
|
|||
|
||||
def add_prefix_colors(self, widget):
|
||||
"""add custom theme colors for prefix"""
|
||||
if self._markup == "pango":
|
||||
# add prefix/suffix colors
|
||||
self._prefix_fg = self._theme.prefix_fg(widget)
|
||||
self._prefix_bg = self._theme.prefix_bg(widget)
|
||||
self._prefix = "<span {} {}>{}</span>".format(
|
||||
"foreground='{}'".format(self._prefix_fg) if self._prefix_fg else "",
|
||||
"background='{}'".format(self._prefix_bg) if self._prefix_bg else "",
|
||||
|
@ -368,6 +364,10 @@ class WidgetDrawer(object):
|
|||
"""add prefix to full_text"""
|
||||
self._prefix = self._theme.prefix(widget, padding)
|
||||
|
||||
if self._markup == "pango":
|
||||
# add prefix/suffix colors
|
||||
self._prefix_fg = self._theme.prefix_fg(widget)
|
||||
self._prefix_bg = self._theme.prefix_bg(widget)
|
||||
self.add_prefix_colors(widget)
|
||||
|
||||
if self._prefix:
|
||||
|
|
Loading…
Reference in a new issue