1
0
mirror of https://github.com/gryf/wmdocklib.git synced 2025-12-19 04:20:17 +01:00

Use fstrings to simplify background build.

This commit is contained in:
2022-05-04 17:03:01 +02:00
parent 434155a340
commit 222301fa93

View File

@@ -129,16 +129,16 @@ class DockApp:
ex = bg_color ex = bg_color
if self.background is None: if self.background is None:
sp = ' '
background = ( background = (
[' ' * self.width for item in range(self.margin)] + [f'{sp:{self.width}}' for _ in range(self.margin)] +
[' ' * self.margin + [f'{sp:{self.margin}}' +
bg_color * (self.width - 2 * self.margin - 1) + bg_color * (self.width - 2 * self.margin - 1) + f'{ex}'
ex + ' ' * (self.margin) f'{sp:{self.margin}}'
for item in range(self.margin, for _ in range(self.margin, self.height - self.margin - 1)] +
self.height - self.margin - 1)] + [f'{sp:{self.margin}}' + ex * (self.width - 2 * self.margin) +
[' ' * self.margin + ex * (self.width - 2 * self.margin) + f'{sp:{self.margin}}'] +
' ' * (self.margin)] + [f'{sp:{self.width}}' for _ in range(self.margin)])
[' ' * self.width for item in range(self.margin)])
charset_start = self.height + len(patterns) charset_start = self.height + len(patterns)
for font in self.fonts: for font in self.fonts: