align buttons in grouplist
#1
I'm trying to align buttons and images in a horizontal grouplist. The items are centered horizontally (on the x axis) but I also want them to be centered on the y-axis. Therefore I tried  <aligny>center</aligny> within in the grouplist and with each item separately. No luck. Any ideas?

xml:
 <control type="grouplist" id="9005">
                    <orientation>horizontal</orientation>
                    <itemgap>120</itemgap>
                    <posx>40</posx>
                    <posy>1220</posy>
                    <height>124</height>
                    
                    <align>center</align>
                    <aligny>center</aligny>
                   
                    <control type="button">
                        <height>79</height>
                        <width>59</width>
                        <font />
                        <texturefocus colordiffuse="$VAR[HighlightColor]">VW/source.png</texturefocus>
                        <texturenofocus colordiffuse="LineLabel">VW/source.png</texturenofocus>
                        <onclick>ActivateWindow(Music)</onclick>
                    </control>
                    <control type="image">
                        <height>124</height>
                        <width>11</width>
                        <aspectratio>keep</aspectratio>
                        <texture>VW/seperator.png</texture>  
                    </control>
                    <control type="button">
                        <height>60</height>
                        <width>101</width>
                        <font />
                        <texturefocus colordiffuse="$VAR[HighlightColor]">VW/selection.png</texturefocus>
                        <texturenofocus colordiffuse="LineLabel">VW/selection.png</texturenofocus>
                        <onclick>ActivateWindow(MusicPlaylist)</onclick>
                    </control>
                    <control type="image">
                        <height>124</height>
                        <width>11</width>
                        <aspectratio>keep</aspectratio>
                        <texture>VW/seperator.png</texture>
                    </control>
                    <control type="button" id="12">
                        <description>Skip Back</description>
                        <width>40</width>
                        <height>40</height>
                        <label></label>
                        <font />
                        <texturefocus colordiffuse="$VAR[HighlightColor]">VW/previous.png</texturefocus>
                        <texturenofocus colordiffuse="LineLabel">VW/previous.png</texturenofocus>
                        <onclick>PlayerControl(Previous)</onclick>
                    </control>
                    <control type="image">
                        <height>124</height>
                        <width>11</width>
                        <aspectratio>keep</aspectratio>
                        <texture>VW/seperator.png</texture>   
                    </control>
                    <control type="togglebutton" id="14">
                        <description>Play/Pause</description>
                        <width>40</width>
                        <height>40</height>
                        <label></label>
                        <altlabel></altlabel>
                        <font />
                        <texturefocus colordiffuse="$VAR[HighlightColor]">VW/pause.png</texturefocus>
                        <texturenofocus colordiffuse="LineLabel">VW/pause.png</texturenofocus>
                        <usealttexture>Player.Paused | Player.Forwarding | Player.Rewinding</usealttexture>
                        <alttexturefocus colordiffuse="$VAR[HighlightColor]">VW/play.png</alttexturefocus>
                        <alttexturenofocus colordiffuse="LineLabel">VW/play.png</alttexturenofocus>
                        <onclick>PlayerControl(Play)</onclick>
                    </control>  
                    <control type="image">
                        <height>124</height>
                        <width>11</width>
                        <aspectratio>keep</aspectratio>
                        <texture>VW/seperator.png</texture>   
                    </control>
                    <control type="button" id="17">
                        <description>Next</description>
                        <width>40</width>
                        <height>40</height>
                        <label></label>
                        <font />
                        <texturefocus colordiffuse="$VAR[HighlightColor]">VW/next.png</texturefocus>
                        <texturenofocus colordiffuse="LineLabel">VW/next.png</texturenofocus>
                        <onclick>PlayerControl(Next)</onclick>
                    </control>
                    <control type="image">
                        <height>124</height>
                        <width>11</width>
                        <aspectratio>keep</aspectratio>
                        <texture>VW/seperator.png</texture>   
                    </control>
                    <control type="button">
                        <height>87</height>
                        <width>115</width>
                        <font />
                        <texturefocus colordiffuse="$VAR[HighlightColor]">VW/setup.png</texturefocus>
                        <texturenofocus colordiffuse="LineLabel">VW/setup.png</texturenofocus>
                        <onclick></onclick>
                    </control>
                </control>
Reply
#2
The align value only applies to the orientation in a grouplist so you'll have to add <top>n</top> values to each control separately.
Reply
#3
(2019-07-17, 18:44)Hitcher Wrote: The align value only applies to the orientation in a grouplist so you'll have to add <top>n</top> values to each control separately.

Well I forgot to mention that I already tried to apply <top></top> to each control to get all items in line, but it has no affect at all. All controls are placed at the top.
Reply
#4
Sorry, forgot that you also need to add <aligny>bottom</aligny> to them for top to work.
Reply
#5
(2019-07-17, 20:39)Hitcher Wrote: Sorry, forgot that you also need to add <aligny>bottom</aligny> to them for top to work.

I applied it to the group list: no effect. I applied it to each control separately: no effect.
I doubt aligny will work. Otherwise  <aligny>center</aligny> would habe done yet what I was tried to achieve.
Reply
#6
all items should line up on the green line.

Image
Reply
#7
Sorry again, forgot you need to add <usecontrolcoords>true</usecontrolcoords> to the grouplist so the controls use their own coordinates.

Example here - https://github.com/HitcherUK/skin.ftv/bl...ml#L37-L84
Reply
#8
With <usecontrolcoords>true</usecontrolcoords> enabled in the grouplist, you can then use <centertop>50%</centertop> in each control
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#9
(2019-07-18, 10:49)jurialmunkey Wrote: With <usecontrolcoords>true</usecontrolcoords> enabled in the grouplist, you can then use <centertop>50%</centertop> in each control

Awesome!
Thanks to all.
Reply

Logout Mark Read Team Forum Stats Members Help
align buttons in grouplist0