diff --git a/controldeck.py b/controldeck.py index 45c5ec8..2214105 100755 --- a/controldeck.py +++ b/controldeck.py @@ -199,12 +199,18 @@ class Button(QBtn): self.command = '' # command to run on click self.state = '' # output of the state check command self.state_command = '' # command to check the unclicked state + self.color_bg = kwargs.pop('color_bg', '') + self.color_fg = kwargs.pop('color_fg', '') super().__init__(**kwargs) self.style = "width: 90px;" self.style += "min-height: 77px;" # image + 2 text lines self.style += "border: 1px solid var(--c-blue-grey-8);" # #455a64 blue-grey-8 self.style += "line-height: 1em;" + if self.color_bg: + self.style += f"background-color: {self.color_bg};" + if self.color_fg: + self.style += f"color: {self.color_fg} !important;" # if DEBUG: # print(f'[DEBUG] button: {self.text}; image: {self.image}; exists: {path.exists(self.image)}') diff --git a/example/controldeck.conf b/example/controldeck.conf index 0ad26f4..53dd2cb 100644 --- a/example/controldeck.conf +++ b/example/controldeck.conf @@ -35,8 +35,8 @@ # : N. optional group/row specification # : NAME id, name of the button # text-alt = optional alternative burron text -# color-fg = foreground color as hex color code, e.g. \#ff0000 -# color-bg = background color as hex color code, e.g. \#ff0000 +# color-fg = foreground color as hex color code, e.g. #aa5500 +# color-bg = background color as hex color code, e.g. #0055aa # command = command(s) to run, seperated by new lines: shell command # second command ... # command-alt = optinal back-switch command(s) to run: shell command ...