Quick Skinning Question - Stacklayout (1 Viewer)

mattsk88

Community Skin Designer
March 27, 2008
363
216
I have a quick (hopefully) question regarding the stacklayout group element. How to you set the color of the list?

Ie I have a list of

Play
Next
Refresh

How do you chose the color for them when they aren't in focus?

<textcolor>colorhere<textcolor> - sets the color defined of whatever is selected

Thanks for any help!
 

Sambal

Portal Pro
February 4, 2008
144
144
Home Country
Netherlands Netherlands
I assume you have Buttons in your group. If not please provide a bit more information.

The Wiki states the following :

ElementName: disabledcolor
Data Type: Long
Description: The color of the text when the button does not have the focus/not selected

You could also work with textures.
<textureFocus>
<textureNoFocus>
 

mattsk88

Community Skin Designer
March 27, 2008
363
216
  • Thread starter
  • Moderator
  • #3
This is my current code at the moment when the texture moves down the list of items the text changes from white to black, I need to change the white to another color!
<control>
<type>group</type>
<description>group element</description>
<id>27</id>
<posX>50</posX>
<posY>300</posY>
<layout>StackLayout</layout>
<onleft>101</onleft>
<onright>101</onright>
<animation effect="slide" time="400" start="-300,0">WindowOpen</animation>
<animation effect="slide" time="400" end="0,-300">WindowClose</animation>
<animation effect="fade" time="500">WindowClose</animation>
<animation effect="fade" time="250">WindowOpen</animation>
<control>

<control>
<type>button</type>
<description>Back</description>
<id>102</id>
<height>30</height>
<width>160</width>
<onup>107</onup>
<ondown>101</ondown>
<onright>7111</onright>
<label>BACK</label>
<textalign>right</textalign>
<textcolor>000000</textcolor>
<textureFocus>menu_focus.png</textureFocus>
<control>
 

Sambal

Portal Pro
February 4, 2008
144
144
Home Country
Netherlands Netherlands
I do think you need to add a <disabledcolor>xxxxxxxx</disabledcolor> to your <button> Control to override defaults.
The naming of this tag is a bit confusing, it doesn't mean the color when the button is disabled but when it has no focus.

You can of course also change the default Control definitions in references.xml, the white color is probably specified there. If the non-white color is default throughout your skin it is best to change it there. Easier to make global changes to your skin later on.
 

mattsk88

Community Skin Designer
March 27, 2008
363
216
  • Thread starter
  • Moderator
  • #6
OT, but does anyone have an idea how to have the group stack horizontally as opposed to vertically?

Use Grid layout ie
<type>group</type>
<description>group element</description>
<id>123</id>
<layout>GridLayout(3,0,0,0)</layout>
<height>60</height>
<width>400</width>
<posX>715</posX>
<posY>715</posY>

Will give you a layout with 3 cells across ie change the value 3 to however many cells you want.

I hope this is what you meant?

BTW disabled color isn't working so frustrating
 

Sambal

Portal Pro
February 4, 2008
144
144
Home Country
Netherlands Netherlands
It is possible to have the StackLayout stack the controls horizontal.

You can use the following syntax:

<layout>StackLayout(5,Horizontal)</layout>

Where 5 is spacing between items and Horizontal tells the StackLayout to layout the controls horizontal
 

Psycho Reptile

Retired Team Member
  • Premium Supporter
  • April 19, 2006
    1,316
    787
    Cambridge, England
    Home Country
    United Kingdom United Kingdom
    I do think you need to add a <disabledcolor>xxxxxxxx</disabledcolor> to your <button> Control to override defaults.
    The naming of this tag is a bit confusing, it doesn't mean the color when the button is disabled but when it has no focus.

    I found this: <textcolorNoFocus>xxxxxxxx</textcolorNoFocus>, in the souce code and it works well ;)
    Added it to buttons in the references.xml and they all use the tag, now if only listcontrols would support this to :)
     

    Sambal

    Portal Pro
    February 4, 2008
    144
    144
    Home Country
    Netherlands Netherlands
    You are right, if you look at sources it sets the colors like you say.

    Code:
    _labelControl.TextColor = Disabled ? _disabledColor : Focus ? _textColor : _textColorNoFocus;

    But if you look at the manual this page. It says that disabledcolor is the color of the text when the button does not have the focus/not selected.

    I guess the manual is wrong about it. Thank you for clearing this up :)
     

    Users who are viewing this thread

    Top Bottom