Bug in <focusedlayout> only with <left> and <width>auto</width> don't displayed <label>
#1
With the code below :

xml:
    <control type="group">
        <control type="panel" id="50">
            ....
            
            <itemlayout width="1088" height="64">
                <control type="label">
                    <left>90</left>
                    <width>auto</width>
                    <label>$INFO[ListItem.Label]</label>
                    ....
                </control>
            </itemlayout>
            
            <focusedlayout width="1088" height="64">
                <control type="label">
                    <left>90</left>
                    <width>auto</width>
                    <label>$INFO[ListItem.Label]</label>
                    ....
                </control>
            </focusedlayout>
    </control>

for all item unfocus
xml:
<label>$INFO[ListItem.Label]</label>
is displayed

With Item Focused
xml:
<label>$INFO[ListItem.Label]</label>
is not displayed with the same property

Solution :

in <focusedlayout></focusedlayout> :
            
replace
xml:
<left>90</left>
with
xml:
<posx>90</posx>

or 

replace
xml:
<width>auto</width>
with
xml:
<width>500</width>

For me it is strange to not have the same behaviour with "<itemlayout></itemlayout>" and "<focusedlayout></focusedlayout>". 

So I hope you understand that I mean...
The solution is very simple but I'm a bit curious. Is this a known problem or is it normal ?

Anyway thanks for any answers
Reply
#2
Could you please post some screenshots because I don't know what you mean by 'is not displayed with the same property'?
Reply
#3
(2024-05-05, 17:49)Hitcher Wrote: Could you please post some screenshots because I don't know what you mean by 'is not displayed with the same property'?

Thanks for your answer. 

I mean by "the same property" :

xml:
<left>90</left>
<width>auto</width>

works in 
xml:
<itemlayout></itemlayout>
not in 
xml:
<focusedlayout></focusedlayout>
Reply
#4
(2024-05-05, 17:49)Hitcher Wrote: Could you please post some screenshots because I don't know what you mean by 'is not displayed with the same property'?

screenshot where <label> is not displayed on focus item : 

Image
Reply
#5
I tried and did appear after several seconds. Still odd though.

If you need to use auto width then try adding min and max values.

<width min="100" max="500">auto</width>
Reply
#6
(2024-05-05, 18:32)Hitcher Wrote: I tried and did appear after several seconds. Still odd though.

If you need to use auto width then try adding min and max values.

<width min="100" max="500">auto</width>

Indeed with <width min="100" max="500">auto</width> all works fine.

In any case, thank you to have confirming that there is a issue.
Reply
#7
Why are you trying to use auto width in focus/itemlayout anyway?

You may as well just set
Code:
<width>100%</width>
in layout. Auto width is only useful for controls in grouplists or for buttons to match texture size to label.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#8
(2024-05-11, 10:56)jurialmunkey Wrote: Why are you trying to use auto width in focus/itemlayout anyway?

You may as well just set
Code:
<width>100%</width>
in layout. Auto width is only useful for controls in grouplists or for buttons to match texture size to label.

Thanks for your answer.

It is not really my choice. Actually I mod a existing Skin for my need and for understanding codying.

So at beginning <width>100%</width> already exist
But for consytency I would prefer replace all <posx>number value</posx> by <left>number value</left>
and same with <posy>number value</posy> by <top>number value</top>

but combined value <posx>number value</posx> and <width>100%</width> works 
and combined value <left>number value</left> and <width>100%</width> don't works 

There are so many nuance to understand in code in all part.
Eg I don't see any difference between <posx></posx> and <left></left>

So step by step with time all of this become more clear for me ...

<Off topic>
I have replace lot of part with your tools :
 - script.texturemaker
 - script.skinvariables
 - script.wikipedia
 - plugin.video.themoviedb.helper

wow, these tools are amazing. There is no limit
even if you are a skilled developer, the time spent testing all the possibilities must be huge...

Paid you a coffe will be more signifiant.
But I would to say thanks you for all this amazing works sharing with community
<\Off topic>
Reply
#9
(2024-05-11, 12:38)Nanomani Wrote: but combined value <posx>number value</posx> and <width>100%</width> works 
and combined value <left>number value</left> and <width>100%</width> don't works 

Ah I see. For that, you don't need width at all. You can just define a right tag to tell the control how far from the right side it should end e.g.
xml:

<control type="label">
<left>200</left>
<right>100</right>
</control>

So if you layout width is 1088, that control will be 788 wide because it starts 200 pixels from left side and ends 100 pixels before the right side.

(2024-05-11, 12:38)Nanomani Wrote: wow, these tools are amazing. There is no limit

Thanks Big Grin
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply

Logout Mark Read Team Forum Stats Members Help
in <focusedlayout> only with <left> and <width>auto</width> don't displayed <label>0