openhab / org.openhab.ui.habpanel

OUTDATED repo - HABPanel has moved to the openhab-webui repo!
https://github.com/openhab/openhab-webui
Eclipse Public License 1.0
97 stars 93 forks source link

Custom widgets - add "default" fields value #73

Closed kubawolanin closed 7 years ago

kubawolanin commented 7 years ago

Hello! I'm creating a new widget that has decent amount of settings. I have two suggestions:

kubawolanin commented 7 years ago

Just FYI - using simple Angular expressions allows you to manage the default state easily :)

nav.directions {
  --bg-color: transparent;
  --btn-color: {{config.btn_color || '#fff'}};
  --btn-active: #eee;
  --text-color: #222;
 ...
}
ghys commented 7 years ago

Yep, the default value is something that was actually there at first but I removed it because reasons, I don't remember why :) But I agree, it should be there.

About the layout changes in the settings list: Keep in mind HABPanel works on phones so the interface should be responsive when on a narrow screen, maybe Boostrap's col-sm-6 is a better option. It would also have to play nicely with the reordering of settings that should/will also be implemented.