Jump to content


Photo

Skin: all colour buttons in one widget


  • Please log in to reply
55 replies to this topic

#1 Huevos

  • PLi® Contributor
  • 4,247 posts

+158
Excellent

Posted 30 October 2023 - 10:59

To simplify skin.xml there is now a patch so all colour buttons (graphics and text) can be created by one single widget once in the whole skin. No need for all those silly templates. Fully automatic. And backwards compatible. Is PLi interested?



Re: Skin: all colour buttons in one widget #2 Tech

  • Forum Moderator
    PLi® Core member
  • 14,644 posts

+460
Excellent

Posted 30 October 2023 - 12:37

Of course OpenPLi is interested in such additions, especially if they can be added without side effects..


Aan de rand van de afgrond is een stap voorwaarts niet altijd vooruitgang....

 

On the edge of the abyss, a step forward is not always progress....


Re: Skin: all colour buttons in one widget #3 Taapat

  • PLi® Core member
  • 2,343 posts

+120
Excellent

Posted 30 October 2023 - 14:30

Does this widget support:

1. Draw button backgrounds using individual labels instead of images?

2. Auto scale button sizes so they fit in screen?

3. Scaling the font size of the button text if it will not fit in the button?


Edited by Taapat, 30 October 2023 - 14:31.


Re: Skin: all colour buttons in one widget #4 DimitarCC

  • PLi® Contributor
  • 1,333 posts

+46
Good

Posted 30 October 2023 - 14:51

@Taapat

 

1. If you mean drawing colored text and no image - yes it support that.

2. Yes it auto scale to the space given by the widget. But here more or less it plays with the positions of the button made them fit to the width of the buttons widget. Currently scaling of the pixmap is not supported.

3. No. That is not yet supported. But it measures the text width and make space so whole text to be visible.


Vu+DUO4KSE, DM920UHD, Vu+Uno4KSE, SF8008Mini, Vu+Solo2, Dreambox DM500HD, Triax 78 (7E,9E,13E,19.2E,23.5E) & Triax 78 (39E)


Re: Skin: all colour buttons in one widget #5 Huevos

  • PLi® Contributor
  • 4,247 posts

+158
Excellent

Posted 30 October 2023 - 15:16

3, I think that is a misunderstanding. Look at a skin like PLi-HD-Night. You have button graphic then text. That is pretty standard for most skins. But for skins like simple-gray this patch does not support that style. But you could make your own add on for that.



Re: Skin: all colour buttons in one widget #6 Taapat

  • PLi® Core member
  • 2,343 posts

+120
Excellent

Posted 30 October 2023 - 15:22

1. By that I mean using labels instead of images.
2. By that I mean space given by the screen for the buttons. I assume that the space given by the widget could be the same as the space given by the screen, even if the screen size is autoscaled.
3. But it could be insufficient if the screen size does not allow it. I think it would look unusual if the width of the different buttons varied several times.
I think you can find many translations, whose author doesn't pay attention to the fact, that the text is for the button, and it won't even fit in the place of the button in PLi-HD-Night.

Edited by Taapat, 30 October 2023 - 15:22.


Re: Skin: all colour buttons in one widget #7 DimitarCC

  • PLi® Contributor
  • 1,333 posts

+46
Good

Posted 30 October 2023 - 15:33

1. Yes that is supported.

2. Since you render just one widget for all buttons and they are actually drawn inside it there is only the space given by that widget rectangle. If the size is something like size="e-220,36" then the width is dynamic depending on the screen width. But anyway the space for the buttons is limited to the place defined by the widget.

3. Yes there can not be enough space for all the  buttons. For example if screen is too small and translations too long it will not fit. So there are options that you can define for the widget. you can tell the widget to use fluid layout...In this case it will measure the width of the text and will draw the buttons accordingly. So you will end up with different distance between the buttons. But you can define layout to be fixed. In this case it measure minimum distance between the buttons as width // 4. Then it renders the labels and if it detect longer label than minimum distance it expand the distance to the next button so text to fit. If at the end there is no enough width so all things to fit it automatically switches to fluid layout.

Well if there is still no space for all buttons...we do nothing for now.


Vu+DUO4KSE, DM920UHD, Vu+Uno4KSE, SF8008Mini, Vu+Solo2, Dreambox DM500HD, Triax 78 (7E,9E,13E,19.2E,23.5E) & Triax 78 (39E)


Re: Skin: all colour buttons in one widget #8 Taapat

  • PLi® Core member
  • 2,343 posts

+120
Excellent

Posted 30 October 2023 - 15:35

@Huevos of course I can use my widgets or python code in skin as I do now.

I just want to pay attention to the things that are relevant for me.
It is your choice to implement it or not.
 
Personally, I am skeptical about all component and widget updates in enigma.
If someone wants to use them, it means that the skin can only be used on a specific image starting from a specific version.
Therefore, in my opinion, it is better to add such components in the skin, because not all users regularly update enigma, even if they update the skin.
 
But of course, it is good for the development of enigma if such components exist in it, even if they are used only by the person who implements them.

Edited by Taapat, 30 October 2023 - 15:37.


Re: Skin: all colour buttons in one widget #9 DimitarCC

  • PLi® Contributor
  • 1,333 posts

+46
Good

Posted 30 October 2023 - 15:41

 

Personally, I am skeptical about all component and widget updates in enigma.

If someone wants to use them, it means that the skin can only be used on a specific image starting from a specific version.
Therefore, in my opinion, it is better to add such components in the skin, because not all users regularly update enigma, even if they update the skin.
 

 

 

That is true. But the basics can be added to the enigma so to allow someone to write its own widget of that type and then he can include that with his skin.

But anyway there needs a bit extensions in the enigma core so to allow/provide framework for that custom widgets.

 

Ofcource it will be nice if there is such components in enigma itself. So to be possible to be used by skinners out of the box.


Vu+DUO4KSE, DM920UHD, Vu+Uno4KSE, SF8008Mini, Vu+Solo2, Dreambox DM500HD, Triax 78 (7E,9E,13E,19.2E,23.5E) & Triax 78 (39E)


Re: Skin: all colour buttons in one widget #10 littlesat

  • PLi® Core member
  • 56,274 posts

+691
Excellent

Posted 30 October 2023 - 15:43

A long time, years ago, we did create the templates to make it more easier. Later I added the auto hide button stuff... what is this next change?

 

Basically as the whole skin stuff in enigma2 is not a real standard and stuck on the python code and not flexible at all at this moment my personal meaning is not to adapt something at it when it has a big impact and gains a lot of additional work, 

 

When the merge request is straight forward, has a low risk and add value to make skins really more simple... then I would like it very much :D


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


Re: Skin: all colour buttons in one widget #11 littlesat

  • PLi® Core member
  • 56,274 posts

+691
Excellent

Posted 30 October 2023 - 15:45

Is this change meant here?

https://github.com/O...05537e1c1abe669

 

Looks like this is a patch for the 4 color buttons only?.... 


Edited by littlesat, 30 October 2023 - 15:47.

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


Re: Skin: all colour buttons in one widget #12 Taapat

  • PLi® Core member
  • 2,343 posts

+120
Excellent

Posted 30 October 2023 - 15:47

And one more note.
It would be good, if in the commit when new features are introduced, an example of how to use it in the skin was specified.
We, who are now considering this opportunity, may have understood how to use it. And I'm not sure that I understand all offered options.
But if someone looks at this code aftera year, he will definitely not understand how to use it.


Re: Skin: all colour buttons in one widget #13 DimitarCC

  • PLi® Contributor
  • 1,333 posts

+46
Good

Posted 30 October 2023 - 15:48

Is this change meant here?

https://github.com/O...05537e1c1abe669

 

That is part of the changes. But yes that is the widget ColorButtonsSequence.py. It is made on top of already existing GUIAddon widgets (used for the Pager only till now).


Vu+DUO4KSE, DM920UHD, Vu+Uno4KSE, SF8008Mini, Vu+Solo2, Dreambox DM500HD, Triax 78 (7E,9E,13E,19.2E,23.5E) & Triax 78 (39E)


Re: Skin: all colour buttons in one widget #14 littlesat

  • PLi® Core member
  • 56,274 posts

+691
Excellent

Posted 30 October 2023 - 15:49

Can we also get a merge request for this?

 

https://github.com/O...8782c61d88446d4

 

I hate it that good ideas are taken from here, but when something additional is required we do not get a merge request.


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


Re: Skin: all colour buttons in one widget #15 DimitarCC

  • PLi® Contributor
  • 1,333 posts

+46
Good

Posted 30 October 2023 - 15:49

A long time, years ago, we did create the templates to make it more easier. Later I added the auto hide button stuff... what is this next change?

 

Basically as the whole skin stuff in enigma2 is not a real standard and stuck on the python code and not flexible at all at this moment my personal meaning is not to adapt something at it when it has a big impact and gains a lot of additional work, 

 

When the merge request is straight forward, has a low risk and add value to make skins really more simple... then I would like it very much :D

 

The new functionality doesnt break current skins. So you can decide use it or not. So in my opinion the risk is very little.


Vu+DUO4KSE, DM920UHD, Vu+Uno4KSE, SF8008Mini, Vu+Solo2, Dreambox DM500HD, Triax 78 (7E,9E,13E,19.2E,23.5E) & Triax 78 (39E)


Re: Skin: all colour buttons in one widget #16 DimitarCC

  • PLi® Contributor
  • 1,333 posts

+46
Good

Posted 30 October 2023 - 15:50

 

And one more note.
It would be good, if in the commit when new features are introduced, an example of how to use it in the skin was specified.
We, who are now considering this opportunity, may have understood how to use it. And I'm not sure that I understand all offered options.
But if someone looks at this code aftera year, he will definitely not understand how to use it.

 

 

Agreed. For this a manual have to be made.


Vu+DUO4KSE, DM920UHD, Vu+Uno4KSE, SF8008Mini, Vu+Solo2, Dreambox DM500HD, Triax 78 (7E,9E,13E,19.2E,23.5E) & Triax 78 (39E)


Re: Skin: all colour buttons in one widget #17 littlesat

  • PLi® Core member
  • 56,274 posts

+691
Excellent

Posted 30 October 2023 - 15:53


ColorButtonsSequence.py.

Actually somehow it gives me a less good feeling as it is an exception for the color buttons only. And there is more shown here like menu, info, list etc... also sometimes as icons... And it is 'coded' in python and not in the skin. Or do I miss something here. Can you also add the small icons?

 

But it adds a new renderer and is a file a skin can use or not. So as far I can see it is safe to add... :D


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


Re: Skin: all colour buttons in one widget #18 DimitarCC

  • PLi® Contributor
  • 1,333 posts

+46
Good

Posted 30 October 2023 - 15:53

A quick example of skin definition of that widget is this

 

for pixmaps + text

<widget addon="ColorButtonsSequence" connection="key_red,key_green,key_yellow,key_blue" 
			pixmaps="key_red:buttons/key_red.png,key_green:buttons/key_green.png,key_yellow:buttons/key_yellow.png,key_blue:buttons/key_blue.png" 
			position="0,0" size="e,36" font="Regular;26" backgroundColor="background5" alignment="left" zPosition="10" spacingButtons="40" spacingPixmapText="10" />

For only text

<widget addon="ColorButtonsSequence" connection="key_red,key_green,key_yellow,key_blue" 
			textColors="key_red:red,key_green:green,key_yellow:yellow,key_blue:blue" 
			position="0,0" size="e,36" font="Regular;26" backgroundColor="background5" alignment="left" zPosition="10" spacingButtons="40" spacingPixmapText="10" />

Vu+DUO4KSE, DM920UHD, Vu+Uno4KSE, SF8008Mini, Vu+Solo2, Dreambox DM500HD, Triax 78 (7E,9E,13E,19.2E,23.5E) & Triax 78 (39E)


Re: Skin: all colour buttons in one widget #19 littlesat

  • PLi® Core member
  • 56,274 posts

+691
Excellent

Posted 30 October 2023 - 15:55

It is just a new renderer in fact... so no objections from me.

 

And can it also add the (four) 'button' pictures?


Edited by littlesat, 30 October 2023 - 15:55.

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


Re: Skin: all colour buttons in one widget #20 DimitarCC

  • PLi® Contributor
  • 1,333 posts

+46
Good

Posted 30 October 2023 - 15:56

 


ColorButtonsSequence.py.

 

Actually somehow it gives me a less good feeling as it is an exception for the color buttons only. And there is more shown here like menu, info, list etc... also sometimes as icons... And it is 'coded' in python and not in the skin. Or do I miss something here. Can you also add the small icons?

 

But it adds a new renderer and is a file a skin can use or not. So as far I can see it is safe to add... :D

 

 

For the small buttons like menu, info, etc.. there is another widget more simple one. ButtonSequence.py. But the requirement is that buttons to be defined in the screen .py. Otherwise will not know which buttons to render and which are visible.


Vu+DUO4KSE, DM920UHD, Vu+Uno4KSE, SF8008Mini, Vu+Solo2, Dreambox DM500HD, Triax 78 (7E,9E,13E,19.2E,23.5E) & Triax 78 (39E)



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users