2021-07-30, 22:41
I've been having a heck of a time figuring out how to place the group list control where I want it in this file. This is the first time I've come across a screen where the items are not being placed where I think they should and I'm sure there is something I'm just not understanding.
Ideally I'd like to center it on the screen and thought to use CenterLeft 50% and CenterTop 50%
With the variable height I can understand CenterTop being a problem.
I see no reason why CenterLeft should not be working though.
This screen seems to be very similar to DialogButtonMenu.xml where I had no issues with the horizontal placement.
When I set top and left both to 0 the top left corner was at about (455,520). Why?
When I used CenterLeft 50% the left edge was at about 825 instead of 735 ((1920-450) / 2). Why?
I eventually gave up and approximated the top & left positions via trial and error to get it centered but I'd really like to understand what I'm missing here.
Ideally I'd like to center it on the screen and thought to use CenterLeft 50% and CenterTop 50%
With the variable height I can understand CenterTop being a problem.
I see no reason why CenterLeft should not be working though.
This screen seems to be very similar to DialogButtonMenu.xml where I had no issues with the horizontal placement.
When I set top and left both to 0 the top left corner was at about (455,520). Why?
When I used CenterLeft 50% the left edge was at about 825 instead of 735 ((1920-450) / 2). Why?
I eventually gave up and approximated the top & left positions via trial and error to get it centered but I'd really like to understand what I'm missing here.
xml:
<?xml version="1.0" encoding="UTF-8"?>
<!-------------------------------------------------------------------------------------------------------------------------------->
<!-- -->
<!-------------------------------------------------------------------------------------------------------------------------------->
<window>
<defaultcontrol always="true">996</defaultcontrol>
<include>DialogOpenCloseAnimation</include>
<controls>
<!-- Positioning of this item is not working as I expect it to -->
<!-- With left and top both set to 0 the top left corner starts at roughly (455, 520) -->
<!-- Centerleft 50% puts the left edge at about 825 when it should be 735 -->
<!-- Considering the horizontal issues I have not really tried the verticatal alignment due to the extra complication of the variable height -->
<!-- I've set the position via trial and error / approximation based on 9 items in the list with a max of 11 -->
<control type="grouplist" id="996">
<top>-260</top>
<left>540</left>
<width>450</width>
<height min="70" max="670">auto</height>
<include condition="Window.IsActive(programs) + !String.IsEmpty(Window(Home).Property(Progams.Games))">AdvancedLauncherTrailerButton</include>
<!-- Top Border -->
<control type="image" id="1">
<width>450</width>
<height>5</height>
<texture colordiffuse="labelheader">colors/white.png</texture>
</control>
<!-- Button Template -->
<control type="button" id="1000">
<width>450</width>
<height>60</height>
<font>font14</font>
<textoffsetx>15</textoffsetx>
<texturefocus border="12,0,12,0" colordiffuse="labelheader">list_item_focus.png</texturefocus>
<texturenofocus border="12,0,12,0" colordiffuse="labelheader">list_item_nofocus.png</texturenofocus>
</control>
<!-- Bottom Border -->
<control type="image" id="2">
<width>450</width>
<height>5</height>
<texture colordiffuse="labelheader">colors/white.png</texture>
</control>
</control>
</controls>
</window>