Center align a list container
#1
Question 
I'm trying to center align a horizontal list using the list container.

I'm able to change the alignment using posx, but tried <posx>center</posx>, though this doesn't work.

Is it possible to do this for a list container?
Reply
#2
Gotham lets you do it using <centerleft>50%</centerleft>.
Reply
#3
Thanks, will test it out when I get the chance! Smile
Reply
#4
Tried it, but it won't work for me.

PHP Code:
<control type="list" id="9901">
            <
centerleft>50%</centerleft>
            <
visible>Skin.HasSetting(home.menu2)</visible>
            <include>
home_SubMenuTrigger2</include>        
            <
orientation>horizontal</orientation>
            <
onup>9110</onup>
            <
width>1280</width>
            <
height>50</height>
            <
content>
........ 

Did I missed something?
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#5
It should work. What is the width of the items inside the list?
If the items have a width smaller than the list itself, it might appear that the list isn't centred because the item is align to the left of the list.
Reply
#6
It's a submenu row and yep, the items are smaller.
So, in this case it won't work?
Nevertheless, I got it centered with a combination of focuspostion/movement value and a slide animation.
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#7
So you're actually talking about aligning the items inside the list centrally rather than aligning the whole list itself. Wink
Reply
#8
Sorry, I missed the horizontal orientation in your code. I tried with a vertical list before I asked about the width of the item...
In a horizontal list I don't think the width of the item affects the centring, but the list always begins from left.

Well, at least you fixed it somehow. A wraplist or a fixedlist seems to be the solution, although focusposition doesn't work if you're using a dynamic width for the list (x%), but it shouldn't be a problem in your list.
Reply
#9
Yep, at least it works now Tongue

If somebody is facing the same problem, here is an example how I did it:

PHP Code:
<control type="fixedlist" id="9901">
            <
visible>Skin.HasSetting(home.menu2)</visible>
            <
animation effect="slide" start="0,0" end="-90,0" time="0" condition="StringCompare(Container(9901).NumItems,2) | 
StringCompare(Container(9901).NumItems,4) | StringCompare(Container(9901).NumItems,6)"
>conditional</animation>
            <include>
home_SubMenuTrigger2</include>        
            <
orientation>horizontal</orientation>
            <
onup>9110</onup>
            <
width>1280</width>
            <
height>50</height>
            <
content>plugin://script.skinshortcuts?type=submenu&amp;mainmenuID=9110&amp;group=inprogress,movies,tvshows,music,favourites,pictures,yt,settings,power,custom1,custom2,custom3,power,dvd,videos,weather,programs,addons,livetv,search</content>
            
<focusposition>3</focusposition>
            <
movement>3</movement>
... 
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply

Logout Mark Read Team Forum Stats Members Help
Center align a list container0