Kodi Community Forum
How do I make Text and Image controls appear on the same line? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: How do I make Text and Image controls appear on the same line? (/showthread.php?tid=256073)



How do I make Text and Image controls appear on the same line? - Hustler1337 - 2016-01-11

Hi guys,

I'm trying to make a control which has both text and images on the same line. I thought you can achieve this with a GroupList but my attempt has so far proven unsuccessful. Here's what I have:

PHP Code:
                        <control type="grouplist">
                            <
description>My first group list control</description>
                            <
orientation>horizontal</orientation>
                            <
height>50</height>
                            <
posy>-10</posy>
                            <
control type="label">
                                <
height>36</height>
                                <
font>Mini</font>
                                <
textcolor>Dark2</textcolor>
                                <
label>$INFO[ListItem.RatingAndVotes, ,] • $INFO[ListItem.Year• $INFO[ListItem.MPAA• $INFO[ListItem.Duration,, $LOCALIZE[12391]]</label>
                                <
aligny>center</aligny>
                            </
control>
                            <
control type="image">
                                <
width>150</width>
                                <
texture>$INFO[ListItem.MPAA,flags/mpaa/,.png]</texture>
                            </
control>
                        </
control

Unfortunately, the image control ('MPAA flag') does not appear on the same line. I'm guessing I'm close but I can't figure out what's wrong and would really appreciate some help on where I've gone wrong.

Thank you. Wink


RE: How do I make Text and Image controls appear on the same line? - tomer953 - 2016-01-11

use usecontrolcoords in your grouplist.
Code:
<usecontrolcoords>true</usecontrolcoords>
then you can add posx\posy to your label\image in order to make them aligned.


RE: How do I make Text and Image controls appear on the same line? - Hustler1337 - 2016-01-11

(2016-01-11, 20:44)tomer953 Wrote: use usecontrolcoords in your grouplist.
Code:
<usecontrolcoords>true</usecontrolcoords>
then you can add posx\posy to your label\image in order to make them aligned.

That doesn't seem to work. As the length of the text in the label is dynamic, the width of it can vary. I need the image to be displayed after the label finishes.

Basically, this is what I'm trying to achieve (a horizontal list):

Image


RE: How do I make Text and Image controls appear on the same line? - phil65 - 2016-01-11

you didnt define a width for the label. you probably want <width min="xx" max="xx">auto</width>


RE: How do I make Text and Image controls appear on the same line? - Hustler1337 - 2016-01-11

(2016-01-11, 21:10)phil65 Wrote: you didnt define a width for the label. you probably want <width min="xx" max="xx">auto</width>

You're a gem Phil, <width>auto</width> was exactly what I needed and it works perfectly now.

Thank you so much Wink


RE: How do I make Text and Image controls appear on the same line? - echo - 2016-01-14

(2016-01-11, 20:44)tomer953 Wrote: use usecontrolcoords in your grouplist.
...
then you can add posx\posy to your label\image in order to make them aligned.
Cool, I didnt know about that tag. Thanks.
The method I've been using is the 'static' animation... quite usefull too for conditional positioning.
Code:
<animation effect="slide" end="0,10" time="0" condition="true">Conditional</animation>
I wonder if there is any performance impact though, and if I should change all of these to use 'usecontrolcoords'..