StreamController / StreamController

An elegant Linux app for the Elgato Stream Deck with support for plugins
https://core447.com
GNU General Public License v3.0
201 stars 25 forks source link

BUG: set_background not working when action loads/on_update #202

Open G4PLS opened 1 month ago

G4PLS commented 1 month ago

Describe the bug Im using set_background to set the background of a button, this works but only after I press the button once It also does not change the Background color in the Background section of the Action.

def on_ready(self):
    self.load_settings()
    self.set_background_color([101, 124, 194, 255])

def on_update(self):
    self.set_background_color([101, 124, 194, 255])

def on_key_down(self):
    self.on_update()

To Reproduce Steps to reproduce the behavior: The Methods above should be the bare minimum to reproduce this, when this does not work the "RecordChapterAction" of OBSController currently has this behaviour

Expected behavior The Background color should get changed on the Button. It should also update the Background color in the Background section

Screenshots Mismatch between Background section and actual button background image

Directly after the action loads: image

G4PLS commented 1 month ago

When you do set_background color in on_ready or on_update it sets the color correctly, but afterwards it runs code to use the background color selected by the background color selector. So the order of operation is wrong from these functions

This could fix that:

Add a new field to the Actions section of a button to enable background overriding.

The way it is implemented at the moment you cant set the background color programmatically because it gets overriden with the color of the background chooser This would bring the total of buttons up to three but i personally think its worth it

BC stands for Background Color image Only 1 Action should be able to set the background color, by default this should be off When enabled it blocks the use of the normal background color