Springen naar inhoud


Taapat

Lid geworden: 7 jul 2010
Offline Laatste activiteit: Vandaag, 15:09
-----

Berichten die ik gemaakt heb

In Topic:[WIP] PLi-DarkOS Skin

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.

In Topic:[WIP] PLi-DarkOS Skin

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.

In Topic:[WIP] PLi-DarkOS Skin

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.

In Topic:[WIP] PLi-DarkOS Skin

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.


In Topic:[WIP] PLi-DarkOS Skin

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.