Auto width button, align to the right
#1
Is it possible to have an auto width button that is aligned to the right, so that the right edge is always in the same place and it will stick out further to the left if the label is longer?

My code is..
Code:
<control type="button">
     <right>100</right>
     <width max="500">auto</width>
     <height>100</height>
     <texturenofocus colordiffuse="Music">colors/white.png</texturenofocus>
     <label>$INFO[Player.Title]</label>
     <font>Con.28</font>
    <align>right</align>
    <textoffsetx>25</textoffsetx>
</control>
...but this just displays it with the left edge always in the same place.

If I change the width to fixed number then it works fine but with 'auto' it always reverts back to aligning to the left.

Thanks,
 
Reply
#2
Put it in a right aligned grouplist

e.g.
Code:
<control type="grouplist">
    <align>right</align>
    <right>100</right>
    <width>500</width>
    <height>100</height>
    <control type="button">
        <width max="500">auto</width>
        <height>100</height>
        <texturenofocus colordiffuse="Music">colors/white.png</texturenofocus>
        <label>$INFO[Player.Title]</label>
        <font>Con.28</font>
        <textoffsetx>25</textoffsetx>
    </control>
</control>
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#3
Still isn't working, as before if the width is set to 500 it aligns to the right but if that width is reduced it keeps it's left edge...

Image

Image
 
Reply
#4
Sorry forgot to add that you need to put the orientation in the grouplist

e.g.
Code:
<control type="grouplist">
    <orientation>horizontal</orientation>
    [...]
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#5
(2018-03-09, 23:32)jurialmunkey Wrote: Sorry forgot to add that you need to put the orientation in the grouplist

e.g.
Code:
<control type="grouplist">
<orientation>horizontal</orientation>
[...]
 Thanks, that's working now!
 
Reply
#6
Similar to this, i had a question a long time a go about the button's autowidth not working inside a list container. The same goes and for labels <wrapmultiline />.
 
(2017-02-12, 17:36)nessus Wrote: I've got my hands dirty with the Krypton changes and i come up with a couple questions.

1.The <wrapmultiline /> tag it's not working for labels inside to a list container. Is this valid?
2. When using an autowidth button inside a list container and set the align to right, it aligns to the left. Is this valid?
Any news on these?
Reply
#7
1. I'm pretty sure wrapmultiline is just legacy code and was superseded by textbox. I can't think of any scenario where wrapmultiline would do something a textbox can't. Is there some reason you can't use a textbox?
2. Buttons are technically not valid inside list/panel containers (unsupported control type error). Also, the align tag is for text alignment -- it only aligns text *inside* the button, not the actual position of the button itself. The workaround is to use a grouplist outside the panel and then position it with slide animations (not ideal I know!).
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply

Logout Mark Read Team Forum Stats Members Help
Auto width button, align to the right0