Jump to content


Photo

[WIP] PLi-DarkOS Skin


  • Please log in to reply
2022 replies to this topic

Re: [WIP] PLi-DarkOS Skin #1721 littlesat

  • PLi® Core member
  • 57,062 posts

+698
Excellent

Posted 9 April 2024 - 06:42

It depends on how this is made. When this is made by adding extra lists then I suggest it is not done. But if screens do exist can as far I remember be easily detected. Here you only need to check if the alternative screen does exist…
The parameter section was made originally to drive specific dimensions for sd, hd and fhd skins… especially inside lists… so you do not have to make a lot of static stuff in the code. But it can also be used to avoid complicated stuff to check if something exists in a skin.

Edited by littlesat, 9 April 2024 - 06:45.

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


Re: [WIP] PLi-DarkOS Skin #1722 DimitarCC

  • PLi® Contributor
  • 1,551 posts

+67
Good

Posted 9 April 2024 - 06:56

There is such functionality in PLi

 

in skin.py there is function findSkinScreen. That can be used.

for example

 if findSkinScreen('MovieSelectionSlim'):
    # show the config entry
 else:
    # hide config entry

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


Re: [WIP] PLi-DarkOS Skin #1723 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 9 April 2024 - 06:59

 

 


To be allowed this to be done we have to redesign the menu and how it is formed...

 

Brrr... no other method to derive how wide the list may be....

 

 

I didnt found a reliable way menus to be resized dynamically together with containing elsments :(

Only thing that can be done is the menu width to be extended a bit initially.

 

 
The problem with the menu is that the width of the text depends on the translation.
Many translators will not pay attention where the text is displayed, and therefore two words in English may be translated as a sentence in another language.
This also applies to button translations.
 
In my skin, I use the applet onLayoutFinish and eLabel.calculateTextSize to calculate the text width and scale the menu size.
You have additional elements that make this much more complicated.

Edited by Taapat, 9 April 2024 - 07:02.


Re: [WIP] PLi-DarkOS Skin #1724 DimitarCC

  • PLi® Contributor
  • 1,551 posts

+67
Good

Posted 9 April 2024 - 07:02

Yes that is the problem indeed....but onLayoutFinish is executed once the screen is shown....After that when you navigate throught the menu do the menu resize dynamically?

I can not get that to work since onLayoutFinish is not called.


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


Re: [WIP] PLi-DarkOS Skin #1725 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 9 April 2024 - 07:06

You don't need to change anything after screen creation, because the content of the menu does not change during its use.



Re: [WIP] PLi-DarkOS Skin #1726 DimitarCC

  • PLi® Contributor
  • 1,551 posts

+67
Good

Posted 9 April 2024 - 07:10

OK...will see what can be done...


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


Re: [WIP] PLi-DarkOS Skin #1727 DimitarCC

  • PLi® Contributor
  • 1,551 posts

+67
Good

Posted 9 April 2024 - 07:25

@Taapat Well checking in the code indicates the mainmenu list self["menu"] is replaced when you navigate through the menu so there is no chance that to be handled in applet i think (since we need event)

Or maybe i didnt understood something....


Edited by DimitarCC, 9 April 2024 - 07:26.

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


Re: [WIP] PLi-DarkOS Skin #1728 littlesat

  • PLi® Core member
  • 57,062 posts

+698
Excellent

Posted 9 April 2024 - 11:04


There is such functionality in PLi

 

in skin.py there is function findSkinScreen. That can be used.

Nice!

 

I will consider to adapt it....


Edited by littlesat, 9 April 2024 - 11:19.

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


Re: [WIP] PLi-DarkOS Skin #1729 littlesat

  • PLi® Core member
  • 57,062 posts

+698
Excellent

Posted 9 April 2024 - 11:07


@Taapat Well checking in the code indicates the mainmenu list self["menu"] is replaced when you navigate through the menu so there is no chance that to be handled in applet i think (since we need event)

Or maybe i didnt understood something....

The width as it is now should be the minumum, and then only extend when it is really needed....


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


Re: [WIP] PLi-DarkOS Skin #1730 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 9 April 2024 - 12:44

Maybe I don't understand something because I haven't followed all the latest changes.
 
As I understand, the only thing that can change the size is the text in the title and the texts in the displayed menu lines.
You need to loop through them with checking their width and find out the widest.
After that, you can calculate the required window size.
 
If you choose one of the menus, a new window opens, which size you can adjust again with onLayoutFinish.
 
Here is a very simplified example of how I do it in my skin: https://github.com/T...s.xml#L222-L237
I know that the real size should be checked, not just the longest text, but it is designed to work faster.


Re: [WIP] PLi-DarkOS Skin #1731 littlesat

  • PLi® Core member
  • 57,062 posts

+698
Excellent

Posted 9 April 2024 - 13:19

It is slightly incorrect as you're querying on text length... while when you have a few mmm it could be longer than more iiii :D

 

Threrefore when I consider to code it I would create a list with help from  eLabel.calculateTextSize and then take the max out of this list.... (could actually be a oneliner - LOL)

 

And why is front in the loop.

 

font = 24
width = max([eLabel.calculateTextSize(gFont("Replacement", int(font * f)), entry[0], eSize(int(550 * f), int(40 * f))).width() for entry in self.list])

Edited by littlesat, 9 April 2024 - 13:25.

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


Re: [WIP] PLi-DarkOS Skin #1732 DimitarCC

  • PLi® Contributor
  • 1,551 posts

+67
Good

Posted 9 April 2024 - 14:00

Well my case is much more complicated since i have many dynamic components in the menu....

However i have a solution for it and new addon widget just for the menu that do the job and still you can use the old way of defining the menu....

 

If you want to see a sneak peek of what is the code check https://github.com/O...igma2/pull/1014

 

This still needs some testing... but i hope will be fine. Once it is confirmed working i can push it to PLi too...

 

Or i can push it now (the only problems i expect can be performance related...but maybe there will be no issues)

 

Generally the whole menu is created in the applet and the actual screen is completly empty.

 

Here is how it looks like in my dev version of the skin

<screen name="MenuTemplate">
		<applet type="onContentChanged">
from enigma import ePoint, eSize, getDesktop, gRGB, BT_ALPHABLEND
from Components.Label import Label
from Components.Pixmap import Pixmap
from Components.Addons.Pager import Pager
from Components.Addons.MainMenu import MainMenu as MainMenuAddon
from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN
from Tools.LoadPixmap import LoadPixmap
from skin import parseRadius, parseColor, parseFont
try:
	from Components.Renderer.BoxLogo import setLogo as loadLogo
except:
	loadLogo = None
	
if "menu_list" not in self:
	radiusItem, edgeValueItem = parseRadius("6")
	self["menu_list"] = MainMenuAddon()
	self["menu_list"].connectRelatedElement("menu", self)
	self["menu_list"].GUIcreate(self.instance)
	self["menu_list"].instance.move(ePoint(82, 277))
	self["menu_list"].instance.resize(eSize(544, 522))
	self["menu_list"].setFont("Regular;34")
	self["menu_list"].setMinWidth("544")
	self["menu_list"].setIconSize("48")
	self["menu_list"].setForegroundColorSelected("selectedFG")
	self["menu_list"].setItemHeight("58")
	self["menu_list"].instance.setItemCornerRadius(radiusItem, edgeValueItem)
	self["menu_list"].instance.setWrapAround(True)
	
menu_list_size = self["menu_list"].instance.size()
	
if "logo_sep" not in self:
	self["logo_sep"] = Label("")
	self["logo_sep"].GUIcreate(self.instance)
	self["logo_sep"].instance.setBackgroundColor(gRGB(0x00555556))
	self["logo_sep"].instance.move(ePoint(102, 259))
	self["logo_sep"].setZPosition(-5)

self["logo_sep"].instance.resize(eSize(menu_list_size.width() - 38, 2))

radiusBLayer, edgeValueBLayer = parseRadius("16")
radiusTLayer, edgeValueTLayer = parseRadius("14")

if "blayer" not in self:
	self["blayer"] = Label()
	self["blayer"].GUIcreate(self.instance)
	self["blayer"].instance.setCornerRadius(radiusBLayer, edgeValueBLayer)
	self["blayer"].instance.setBackgroundColor(parseColor("background5"))
	self["blayer"].instance.move(ePoint(70,145))
	self["blayer"].setZPosition(-7)
self["blayer"].instance.resize(eSize(menu_list_size.width() + 26,785))

if "tlayer" not in self:
	self["tlayer"] = Label()
	self["tlayer"].GUIcreate(self.instance)
	self["tlayer"].instance.setCornerRadius(radiusTLayer, edgeValueTLayer)
	self["tlayer"].instance.setBackgroundColor(parseColor("background"))
	self["tlayer"].instance.move(ePoint(72,147))
	self["tlayer"].setZPosition(-6)
self["tlayer"].instance.resize(eSize(menu_list_size.width() + 22,717))

if "pager" not in self:
	self["pager"] = Pager()
	self["pager"].connectRelatedElement("menu", self)
	self["pager"].GUIcreate(self.instance)
	self["pager"].instance.move(ePoint(82, 812))
	
self["pager"].instance.resize(eSize(menu_list_size.width(), 25))

if "logo" not in self:
	self["logo"] = Pixmap()
	self["logo"].GUIcreate(self.instance)
	self["logo"].instance.setAlphatest(BT_ALPHABLEND)
	self["logo"].setZPosition(10)
	self["logo"].instance.move(ePoint(72,175))

logoCurrentSize = self["logo"].instance.size()
if logoCurrentSize.width() != menu_list_size.width() + 20:
	self["logo"].instance.resize(eSize(menu_list_size.width() + 20,64))


if callable(loadLogo):
	loadLogo(self["logo"].instance, "model", menu_list_size.width() + 20, 64, "center")
	
if "title_label" not in self:
	font = parseFont("Regular; 34", ((1, 1), (1, 1)))
	self["title_label"] = Label(self["title"].text)
	self["title_label"].GUIcreate(self.instance)
	self["title_label"].instance.setBackgroundColor(parseColor("background5"))
	self["title_label"].instance.move(ePoint(82,878))
	self["title_label"].instance.setFont(font)
	self["title_label"].instance.setHAlign(self["title_label"].instance.alignRight)
self["title_label"].instance.resize(eSize(menu_list_size.width() - 10,47))

if "screen_path" not in self:
	font = parseFont("Regular; 19", ((1, 1), (1, 1)))
	self["screen_path"] = Label(self["ScreenPath"].text)
	self["screen_path"].GUIcreate(self.instance)
	self["screen_path"].instance.setBackgroundColor(parseColor("background"))
	self["screen_path"].instance.move(ePoint(78,833))
	self["screen_path"].instance.setFont(font)
	self["screen_path"].instance.setHAlign(self["screen_path"].instance.alignRight)
self["screen_path"].instance.resize(eSize(menu_list_size.width(),25))
		</applet>
	</screen>

Here is screenshots:

 

Attached File  mainmenu_1.png   401.74KB   3 downloads

 

Attached File  mainmenu_2.png   276.54KB   3 downloads


Edited by DimitarCC, 9 April 2024 - 14:12.

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


Re: [WIP] PLi-DarkOS Skin #1733 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 9 April 2024 - 14:14

But don't forget to set some size limits.
I think it's better to split one long text instead of showing the menu over all screen.


Re: [WIP] PLi-DarkOS Skin #1734 DimitarCC

  • PLi® Contributor
  • 1,551 posts

+67
Good

Posted 9 April 2024 - 14:16

Yes maybe a max width limit should be added too....But i dont think there is currently menu entries in main menu that long ;)


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


Re: [WIP] PLi-DarkOS Skin #1735 littlesat

  • PLi® Core member
  • 57,062 posts

+698
Excellent

Posted 9 April 2024 - 14:41

Looks strange... but good... And indeed clamp the width between a max and min


Edited by littlesat, 9 April 2024 - 14:44.

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


Re: [WIP] PLi-DarkOS Skin #1736 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 9 April 2024 - 14:48

The length depends on the translation.
When I experimented with my solution, I found some menu entries that spread the menu so wide that I didn't like it.
And there were also menus that seemed too narrow.
Therefore, I think that min and max limits are necessary.


Re: [WIP] PLi-DarkOS Skin #1737 DimitarCC

  • PLi® Contributor
  • 1,551 posts

+67
Good

Posted 9 April 2024 - 15:03

OK i have added max limit too...Maybe later will need some adjustments but first version works fine i think...


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


Re: [WIP] PLi-DarkOS Skin #1738 DimitarCC

  • PLi® Contributor
  • 1,551 posts

+67
Good

Posted 9 April 2024 - 15:06

Looks strange... but good... And indeed clamp the width between a max and min

 

Generally the new addon can be used inline without applet too....For simpler cases.


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


Re: [WIP] PLi-DarkOS Skin #1739 littlesat

  • PLi® Core member
  • 57,062 posts

+698
Excellent

Posted 9 April 2024 - 15:22

Yep I fully understand... and actually I like it as this example makes skinning less depended at the end on the code... And your code is soo clean most times :D

 

Now I can't wait for a merge request...


Edited by littlesat, 9 April 2024 - 15:23.

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


Re: [WIP] PLi-DarkOS Skin #1740 Snoete

  • Senior Member
  • 616 posts

+8
Neutral

Posted 9 April 2024 - 20:18

Sounds we need to add an option for the fallback tuner in case we have an active tuner in a client box. Makes a big sense!!! Please send me an reminder when I do not implement it somewhere next week.

 

and maybe split this out of this tread as it is not related to this skin.

 

Regarding the wrong skinning it could be that oe-a uses a modified version from partnerbox… and then it is not easy to adjust.

 

Off topic:

Wow, that is FAST!

 

Attached File  Fallback timer by Default.jpg   99.08KB   4 downloads

 

Thank you littlesat!

Other oe-a images like openATV are Struggling to adapt Plugins like Partnerbox to Python 3, instead of implementing Fallback tuner in the right way.


-Triax 88cm schotel

-TD 20 flexi-block met 2 Inverto Black Premium Quattro LNB's

- Polytron PSG 908 Q II Multiswitch 8 in / 8 out

- VU+Duo 4K, 2x VU+ Duo2, Zgemma H8.2H en een DM8000 HD PVR

 



32 user(s) are reading this topic

0 members, 31 guests, 0 anonymous users


    Bing (1)