Insality / druid

Powerful Defold UI component framework
https://insality.github.io/druid/modules/Druid.html
MIT License
276 stars 33 forks source link

Input component and styles bug #239

Open InfinityZxc opened 1 year ago

InfinityZxc commented 1 year ago

In Input init function self.button:set_style is called with argument self.button_style but self doesn't have such element. There is self.style.button_style, but including into account how set_style works, self.style should be passed. Furthermore, table that is passed to set_style should have elements with the same names, as components based on this, so every variable in default style and Input.on_style_change with the name button_style should be renamed into button. Finally Input.on_style_change doesn't pass changes to the button component, something like self.button:set_style(self.style) at the end with relevant checks should fix this.

UPD: default input style already has correct field called button, but it doesn't work without fixing Input.on_style_change