Jump to content


Photo

Button() and Label(), PLi opinion.


  • Please log in to reply
465 replies to this topic

Re: Button() and Label(), PLi opinion. #241 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 27 January 2018 - 20:04

Direct split when you get the parameter,... when it can be none arrange with a or an empty string

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Button() and Label(), PLi opinion. #242 Huevos

  • PLi® Contributor
  • 4,644 posts

+161
Excellent

Posted 27 January 2018 - 20:50

Direct split when you get the parameter,... when it can be none arrange with a or an empty string

Not sure what you mean. Must have a length >= 2.

 

Show me what you mean. Sometimes examples are simpler than explaining with words.



Re: Button() and Label(), PLi opinion. #243 Huevos

  • PLi® Contributor
  • 4,644 posts

+161
Excellent

Posted 29 January 2018 - 01:03

TBH, I think this solution is the best and clearest, even if it does use a second variable where necessary.

https://github.com/H....py#L1057-L1061



Re: Button() and Label(), PLi opinion. #244 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 29 January 2018 - 07:41

Sorry it take some time...

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Button() and Label(), PLi opinion. #245 Persian Prince

  • Senior Member
  • 1,982 posts

+247
Excellent

Posted 29 January 2018 - 09:29

Solo4K (with updates, feeds and plugins?). Or OS Mega.

osmega is ready (develop branch): http://www.mediafire...-osmega_usb.zip

No feed sorry ...


Open Vision sources: https://github.com/OpenVisionE2


Re: Button() and Label(), PLi opinion. #246 Huevos

  • PLi® Contributor
  • 4,644 posts

+161
Excellent

Posted 29 January 2018 - 10:48

I can't download those. But anyway if there is no feed and they are not updated daily the exercise is pointless.



Re: Button() and Label(), PLi opinion. #247 nautilus7

  • Senior Member
  • 229 posts

+6
Neutral

Posted 30 January 2018 - 14:20

I converted "TimerEntry" buttons to the new style. Does it look ok?

 

https://github.com/O...igma2/pull/1236



Re: Button() and Label(), PLi opinion. #248 nautilus7

  • Senior Member
  • 229 posts

+6
Neutral

Posted 30 January 2018 - 14:45

The "SelectSatsEntryScreen" class (Satconfig.py) buttons should be changed. Should I use Label() or StaticText() for those?

self["key_red"] = Button(_("Cancel"))
self["key_green"] = Button(_("Save"))
self["key_yellow"] = Button(_("Sort by"))
sself["key_blue"] = Button(_("Select all"))


Re: Button() and Label(), PLi opinion. #249 Huevos

  • PLi® Contributor
  • 4,644 posts

+161
Excellent

Posted 30 January 2018 - 17:34

If you want the png to disappear when the button text is empty you need StaticText(), i.e.

self["key_blue"] = StaticText(_("Select all"))

But don't forget changing from Button() to StaticText() will break every skin that does not have auto buttons.



Re: Button() and Label(), PLi opinion. #250 nautilus7

  • Senior Member
  • 229 posts

+6
Neutral

Posted 30 January 2018 - 19:37

Well, isn't that a nice feature to have? Why we wouldn't always want that?

 

I mean, we should give the skin developer the possibility to auto-hide the button png if he likes. If he doesn't he can use a separate <ePixmap> or <eLabel> to always have the colored placeholder displayed.



Re: Button() and Label(), PLi opinion. #251 Huevos

  • PLi® Contributor
  • 4,644 posts

+161
Excellent

Posted 30 January 2018 - 23:04

Well, isn't that a nice feature to have? Why we wouldn't always want that?

 

I mean, we should give the skin developer the possibility to auto-hide the button png if he likes. If he doesn't he can use a separate <ePixmap> or <eLabel> to always have the colored placeholder displayed.

You've always been able to hide/show the PNG. Nothing new about this.



Re: Button() and Label(), PLi opinion. #252 nautilus7

  • Senior Member
  • 229 posts

+6
Neutral

Posted 31 January 2018 - 02:20

Able to hide or auto-hide?


Edited by nautilus, 31 January 2018 - 02:21.


Re: Button() and Label(), PLi opinion. #253 Huevos

  • PLi® Contributor
  • 4,644 posts

+161
Excellent

Posted 31 January 2018 - 05:17

Able to hide or auto-hide?

Both. What is the difference? The new thing is the skin being able to detect the object type.



Re: Button() and Label(), PLi opinion. #254 nautilus7

  • Senior Member
  • 229 posts

+6
Neutral

Posted 31 January 2018 - 10:22

You ask me? This is what you wrote..

 

If you want the png to disappear when the button text is empty you need StaticText(), i.e.

self["key_blue"] = StaticText(_("Select all"))

But don't forget changing from Button() to StaticText() will break every skin that does not have auto buttons.

 

You wrote that with StaticText(), the png can disappear (I suppose automatically) when there is no text. Can Label() do the same?

 

 

Just to be clear, can you explain what is the difference between Label() and StaticText() please?



Re: Button() and Label(), PLi opinion. #255 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 31 January 2018 - 10:57

Label cannot do the same... as you need a source 'class' to couple the button with the text and Label is no source 'class'... 


Edited by littlesat, 31 January 2018 - 10:57.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Button() and Label(), PLi opinion. #256 nautilus7

  • Senior Member
  • 229 posts

+6
Neutral

Posted 31 January 2018 - 12:31

Can this feature be added to Label() as well then?

 

 

In addition, if instead of a png I have a colored "eLabel" that I want to show or hide automatically with the button text, how can I do it? Can this be done with Label() or StaticText() is the only way?



Re: Button() and Label(), PLi opinion. #257 Huevos

  • PLi® Contributor
  • 4,644 posts

+161
Excellent

Posted 31 January 2018 - 12:39

Can this feature be added to Label() as well then?

 

 

In addition, if instead of a png I have a colored "eLabel" that I want to show or hide automatically with the button text, how can I do it? Can this be done with Label() or StaticText() is the only way?

No. You need to read back through the thread. It contains all the details.

 

Also if someone didn't try to convert label/button to have some of the function of StaticText (5 years ago) we wouldn't be in this mess now.


Edited by Huevos, 31 January 2018 - 12:42.


Re: Button() and Label(), PLi opinion. #258 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 31 January 2018 - 12:43

Actually all buttons could be replaced by staticText only.... but the pain is here that it will 'kill' all skins completely at once...


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Button() and Label(), PLi opinion. #259 Huevos

  • PLi® Contributor
  • 4,644 posts

+161
Excellent

Posted 31 January 2018 - 12:56

I think you have to pause and allow people to adapt their skins first. The functionality is already 95% perfect and now you can have a fully automatic button bar. That in itself is a huge step forward in just a couple of weeks.



Re: Button() and Label(), PLi opinion. #260 nautilus7

  • Senior Member
  • 229 posts

+6
Neutral

Posted 31 January 2018 - 13:02

Actually all buttons could be replaced by staticText only.... but the pain is here that it will 'kill' all skins completely at once...

 

 

I understand this, but in order to clear the mess and make some progress, you have to make some sacrifices. By using mixed Label() and StaticText() for buttons, you just forbid skin authors to make pngs auto-hide, because some screens will auto-hide the png and some will not.

 

If you convert all buttons to the same style (StaticText), the skin authors will have to make one button template and add it to their screens. The same template to all screens. Not so much thinking for them.

 

My 2 cents.




10 user(s) are reading this topic

0 members, 10 guests, 0 anonymous users