[core/output] make prefix bg/fg variables instance variables
There are plans to use them in more than one method
This commit is contained in:
parent
f988be041f
commit
d1238f9dca
1 changed files with 6 additions and 4 deletions
|
@ -337,6 +337,8 @@ class WidgetDrawer(object):
|
||||||
self._markup = None
|
self._markup = None
|
||||||
self._full_text = None
|
self._full_text = None
|
||||||
self._prefix = None
|
self._prefix = None
|
||||||
|
self._prefix_fg = None
|
||||||
|
self._prefix_bg = None
|
||||||
self._suffix = None
|
self._suffix = None
|
||||||
|
|
||||||
def add_separator(self, widget, separator):
|
def add_separator(self, widget, separator):
|
||||||
|
@ -354,11 +356,11 @@ class WidgetDrawer(object):
|
||||||
"""add custom theme colors for prefix"""
|
"""add custom theme colors for prefix"""
|
||||||
if self._markup == "pango":
|
if self._markup == "pango":
|
||||||
# add prefix/suffix colors
|
# add prefix/suffix colors
|
||||||
prefix_fg = self._theme.prefix_fg(widget)
|
self._prefix_fg = self._theme.prefix_fg(widget)
|
||||||
prefix_bg = self._theme.prefix_bg(widget)
|
self._prefix_bg = self._theme.prefix_bg(widget)
|
||||||
self._prefix = "<span {} {}>{}</span>".format(
|
self._prefix = "<span {} {}>{}</span>".format(
|
||||||
"foreground='{}'".format(prefix_fg) if prefix_fg else "",
|
"foreground='{}'".format(self._prefix_fg) if self._prefix_fg else "",
|
||||||
"background='{}'".format(prefix_bg) if prefix_bg else "",
|
"background='{}'".format(self._prefix_bg) if self._prefix_bg else "",
|
||||||
self._prefix
|
self._prefix
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue