themes ids and labels
#1
Ok since I asked asked a question here yesterday I resolved my self by trial and error ;( sorry about that
I have spent the night rereading the wikki from start to end as to not make the same mistake again
But I still has questions they might be obivious might now but here goes.
--Theme--
I have been trying to find out how to add themes I have read the wikki and I have followed it but I still cant figure it out, it will not allow me to select another theme
I suspect themes will only work Textures.xbt is this correct ? (In my many searches regarding this I have found many refrences to lookandfeel.xml but cant find it anywhere wikki or folders)
I went through categorysettings.xml but only found alot of button id´s thats just listed as templates on the wikki so that wasent much help.
--color--
which brings me to color themes how is this supposed to be used I was thinking I want a white default and a black theme, so in the black folder the withe color code I would replace with a black code.for simplicity.
------labels------
labels are often just refered to as 2025 or similar I figured It was related to the strings.xml and the localize but I can not find any strings.xml anywhere ?
how do that work its not very well documented but I enter a label in strings.xml with a free id and I the refrence it with localize ?
---id----
the sidebar menu thats normally on the left side in all views does that has am xml it can be configured in or is it as it looks like and its configured per window ? the reason I ask is I have been going over id´s on the wikki and they seem to be linked to certain windows but could not find anything about the sidebar?

one last thing I have downloaded the xbmc repo and taken the confluence from there to have an up to date skin to work with but I am a little unsure as if it is for gotham ?

well I hope you guys will help yet again ?
Kindly ztrust
Reply
#2
Indeed, themes inside settings only work with textures.xbt. I know you said you read the wiki, so I assume you've already read this bit, but this part of the wiki explains very well how to make a theme: Skin Themes. You've got the steps listed there.

The CategorySettings,xml is basically the place you tell XBMC how you want the buttons in a Settings Category to look like. You define there every type of button that's used in the settings area (radio button, toggle button, ...). So it has nothing to do with themes.


Colours
Again, for colour, there's this wiki page: Colour Themes, I don't know if you've seen it.
To have colour themes, you need another xml file in the Colors folder, similar to defaults.xml. There you can define your colour for the second theme.
When you make your second colour theme, you can copy-paste what's in your defaults.xml and only change the hex code.
If XBMC can't find a colour name in your second xml, it will use the colour with that name in defaults.xml.

Note that some skinners don't use only colour names to define their colours. You can name your colour however you want, for example <color name="disabled">40696969</color> instead of "grey" so you can use them easier later. So instead of remembering what colour you chose for disabled buttons, you can write <disabledcolor>disabled</disabledcolor>.


Labels and Strings
Yes, you got it right, you use $LOCALIZE[number] to display a string in the strings file.

If you open the Language folder in the XBMC folder, you should see that there's a folder for each language supported by XBMC. Each folder contains a file called strings.po. This is the file that contains all the "numbers" you see inside labels. Each number is attached to a string (a piece of text). Depending on the language used by user, XBMC displays the string attached to a certain number. I think it searches in the language chosen by the user first and if it doesn't find a string with that number, it will display the one in English.

You can use actual text inside a label, but if the user changes the language, that text won't be translated. So, for example, if you want to display "Artist", you can have inside a label tag <label>$LOCALIZE[557]</label>. This means that it will display "Artist" in the language chosen by the user. If you simply write <label>Artist</label>, it will display Artist (in English), no matter what language has chosen the user.

I suggest keeping the strings.po open and use the Finding function to search for a label and use the $LOCALIZE[number] inside label tags. If you want to create your own strings.xml, read the Language Support page in the wiki. Just remember to only use numbers between 31000 and 32000 for skins in your strings.xml.


IDs...
I assume you're talking about the ids found in the List of Built-in Controls page. Those are indeed the ones you configure for your skin.

You can find the sidebar usually in the navigation xml files: MyMusicNav.xml contains the buttons you find in the music sidebar, MyVideoNav the buttons you find in the video navigation and so on.

It's not necessary to display them as a sidebar if you don't want to. Maybe you want to display those buttons in a different place, in a different way. But the IDs in a certain xml file tell XBMC what that certain button do. As you can see in the MyMusicNav.xml, the button with id="2" tells XBMC to change the view type.
For my skin, I'm using a button (with no id) for each view, so I don't need the button with id="2".


Alternative to textures.xbt
Eventually there is a trick to avoid themes with textures.xbt. If you only want to change the colours, you can use white (or very light) textures with colordiffuse and visibility condition and then allow the user to choose a colour.

Right now I'm using this method with the selected color in a label. Instead of using a specific color, I use a variable: <selectedcolor>$VAR[selected]</selectedcolor>.
In a separated xml file, the one I use for variables I have this code:

PHP Code:
<variable name="selected">
    <
value condition="StringCompare(Skin.String(SelectedColor),Red)">red</value>
    <
value condition="StringCompare(Skin.String(SelectedColor),Orange)">orange</value>
    <
value condition="StringCompare(Skin.String(SelectedColor),Yellow)">yellow</value>
    <
value condition="StringCompare(Skin.String(SelectedColor),Green)">green</value>
    <
value condition="StringCompare(Skin.String(SelectedColor),Blue)">blue</value>
    <
value condition="StringCompare(Skin.String(SelectedColor),DarkBlue)">darkblue</value>
    <
value condition="StringCompare(Skin.String(SelectedColor),Purple)">purple</value>        
    <
value condition="StringCompare(Skin.String(SelectedColor),Lavender)">lavender</value>
    <
value condition="StringCompare(Skin.String(SelectedColor),Pink)">pink</value>
    <
value>selected</value>
</
variable

The values (red, orange, yellow,...) are defined in the default.xml file inside the Colors folder.

You can try a similar method. As I said, use very light, close to white textures, then inside the <texture> tag use (for example) colordiffuse="$VAR[themecolour]". Then create some options for colours inside SkinSettings.xml. Then the user can choose a colour.

It's doable, yet it's definitely more complicated then the texture.xbt method.


I suggest you read the wiki when you're searching for a certain type of information, otherwise it's overwhelming you and you might forget some things you've read. Better to go back again and read a page then read the manual "from cover to cover" and forget most of it Smile
Reply
#3
On strings: Not all strings come from the strings.po file. And if the string is available in xbmc itself, it is already in all languages.
https://github.com/xbmc/xbmc/blob/master...strings.po


[edit]
strings.xml is old, it has been replaced by strings.po
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#4
hey Alex
sorry for the late reply
had a little bit of a family crisis
thank you for the well explained answer, but I think you misunderstood me but I think that was my fault for not explaining better. had been up all night reading the wikki and just wanted some answers I will try to correct that
Quote:Indeed, themes inside settings only work with textures.xbt. I know you said you read the wiki, so I assume you've already read this bit, but this part of the wiki explains very well how to make a theme: Skin Themes. You've got the steps listed there.
I thought the themes might work without the xbt file since the media folder works without.
The reason I looked in category settings was because I thought I had to enable the swirth between themes
and when I looked up some of the id´s in the categorysettings they are just listed as button template and dont seem to have a function this is what confuses me?

Quote:Colours
Again, for colour, there's this wiki page: Colour Themes, I don't know if you've seen it.
To have colour themes, you need another xml file in the Colors folder, similar to defaults.xml. There you can define your colour for the second theme.
When you make your second colour theme, you can copy-paste what's in your defaults.xml and only change the hex code.
If XBMC can't find a colour name in your second xml, it will use the colour with that name in defaults.xml.
ohh yes I have read it but I just dont understand how to propperly implement it I have a white theme and a label text with black color. so it looks in defaults and get the black text when i switch to the black theme it looks in black.xml and get black text and dont switch colors to white as I want
colors
defaults.xml
<color name="white">FFF1F1F1</color>
<color name="black">FF000000</color>
black.xml
<color name="white">FFF1F1F1</color>
<color name="black">FF000000</color>
where I would do like this to make it switch the colors with the theme but it just seems more like a hack then how its supposed to work
colors
defaults.xml
<color name="white">FFF1F1F1</color>
<color name="black">FF000000</color>
black.xml
<color name="white">FF000000</color> (color code for black)
<color name="black">FFF1F1F1</color> (color code for white)
Quote:Labels and Strings
Yes, you got it right, you use $LOCALIZE[number] to display a string in the strings file.

If you open the Language folder in the XBMC folder, you should see that there's a folder for each language supported by XBMC. Each folder contains a file called strings.po. This is the file that contains all the "numbers" you see inside labels. Each number is attached to a string (a piece of text). Depending on the language used by user, XBMC displays the string attached to a certain number. I think it searches in the language chosen by the user first and if it doesn't find a string with that number, it will display the one in English.

You can use actual text inside a label, but if the user changes the language, that text won't be translated. So, for example, if you want to display "Artist", you can have inside a label tag <label>$LOCALIZE[557]</label>. This means that it will display "Artist" in the language chosen by the user. If you simply write <label>Artist</label>, it will display Artist (in English), no matter what language has chosen the user.

I suggest keeping the strings.po open and use the Finding function to search for a label and use the $LOCALIZE[number] inside label tags. If you want to create your own strings.xml, read the Language Support page in the wiki. Just remember to only use numbers between 31000 and 32000 for skins in your strings.xml.
still a little confused regarding this!
I have read this page over and over again but I have no strings.xml anywhere not in my theme folder or in my xbmc folder ?
but I gues its not that importent its one of the last things for me to do, but just figured I would do it right from the start if I could
so in my skins folder I go to "language\English and use the strings.po that looks like this
Code:
msgctxt "#31910"
msgid "Map & Alerts"
msgstr ""
#empty strings from id 31911 to 31949
and then use the empty string ?
msgctxt "#31912"
msgid "my localize label"
msgstr ""
and when a label has <label>2595</label> its in the strings.po I can find what it is ?
Thank you for the color code tip I will look to see how I can use this down the line.
Reply
#5
Bookmark this page for access to the English language string.

https://raw.githubusercontent.com/xbmc/x...strings.po

As for your colours issue it might help to rename your colours to avoid confusion.

defaults.xml
Code:
<color name="ThemeColour">FFF1F1F1</color>
<color name="LabelColour">FF000000</color>
black.xml
Code:
<color name="ThemeColour">FF000000</color>
<color name="LabelColour">FFF1F1F1</color>
Reply

Logout Mark Read Team Forum Stats Members Help
themes ids and labels0