Get width of autosized button?
#1
Hi,

Does anyone know how to get the width of a button set to <width>auto</width> ?

I don't mind using python if necessary, though I would prefer an in-skin solution if possible.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#2
Not possible. What are you trying to achieve?
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
#3
In AZ2 and aura, the home menu is a grouplist of buttons with auto width.

Each button is actually two buttons with a visibility condition for whether it is the currently focused item or not.

The focused item uses a bolder and larger font. However, the difference in widths means that the other items get pushed around depending on the character length of the item.

What I want to do is set the width of each unfocused button to be the same as its focused counterpart and then centre the text in that space (thus ensuring equal spacing between items without having the focus item shift positioning of items on its right)

I had a different solution with multiple grouplists where I used multiple transparent bolded buttons to position each unfocused item, but that's still not great because the unfocused items are left justified and so have more spacing on one side of the focused item than the other. Adding padding to the left side of the unfocused items to make up for it results in unequal spacing (thus defeating the purpose of auto width in the first place).
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#4
Ah ok. Sorry, no idea. Was messing around with this "glitching" a view times and I always gave up or used a container instead.
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
Get width of autosized button?0