Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
customization:songtree [2007/10/10 00:18] – squentin | customization:songtree [2022/05/23 01:30] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | This page describe how to customize the SongTree, a new widget introduced in the ([[http:// | + | This page describe how to customize the SongTree, a new widget introduced in version |
- | An example of a SongTree can be seen in this [[http://squentin.free.fr/ | + | An example of a SongTree can be seen in this [[http://gmusicbrowser.org/ |
Very rough and incomplete draft, better than nothing | Very rough and incomplete draft, better than nothing | ||
Line 25: | Line 25: | ||
object1_name : type(opt1=val1, | object1_name : type(opt1=val1, | ||
object2_name : type(opt1=val1, | object2_name : type(opt1=val1, | ||
+ | option1_name : type(opt1=val1, | ||
or | or | ||
Line 34: | Line 35: | ||
Examples can be seen in the ' | Examples can be seen in the ' | ||
+ | |||
====== Groups ====== | ====== Groups ====== | ||
Line 44: | Line 46: | ||
* vcollapse defines the height that will be given to the group in collapsed mode | * vcollapse defines the height that will be given to the group in collapsed mode | ||
all 6 values default to 0, they are expression evaluated at group initialization | all 6 values default to 0, they are expression evaluated at group initialization | ||
+ | |||
+ | * title : name used in the grouping edition dialog, default to NameOfTheSkin | ||
====== Columns ====== | ====== Columns ====== | ||
Line 92: | Line 96: | ||
* picture : x y w h file resize crop hide xpad ypad pad xalign yalign | * picture : x y w h file resize crop hide xpad ypad pad xalign yalign | ||
* icon : x y w h size icon hide xpad ypad pad xalign yalign | * icon : x y w h size icon hide xpad ypad pad xalign yalign | ||
- | * rect : x y w h color filled hide | + | * rect : x y w h color filled |
- | * line : x1 y1 x2 y2 color hide | + | * line : x1 y1 x2 y2 color width |
common options : | common options : | ||
Line 126: | Line 130: | ||
* icon : icon name, can be an array ref containing multiple icon names (example : '' | * icon : icon name, can be an array ref containing multiple icon names (example : '' | ||
==== rect ==== | ==== rect ==== | ||
- | draws a rectangle at x,y of width w and height h, filled if " | + | draws a rectangle at x,y of width w and height h, filled if " |
==== line ==== | ==== line ==== | ||
draws a line from x1,y1 to x2,y2 with color " | draws a line from x1,y1 to x2,y2 with color " | ||
+ | ===== user-editable group settings ===== | ||
+ | Groups can define some settings that can easily be changed by user, for example for choosing a color, font, text ... | ||
+ | There are different types of settings, the type only affect the interface that the user will use to edit it. | ||
+ | the syntax is : | ||
+ | option1_name : type(default=' | ||
+ | |||
+ | * type is one of OptionText, OptionColor, | ||
+ | * name is the name that will be displayed in the GUI, use option1_name by default. | ||
+ | * OptionNumber needs a few parameters : min, | ||
+ | * OptionCombo possible values are defined by the parameter list, ' | ||
+ | |||
+ | example : | ||
+ | mytext : OptionText(default=' | ||
+ | text1: text(text=mytext) | ||
+ | will allow the user to change the text that the object ' | ||
+ | more complex example : | ||
+ | mytext | ||
+ | mycolor : OptionColor(default=' | ||
+ | myfont | ||
+ | myhide | ||
+ | title: text( markup='< | ||
Line 148: | Line 173: | ||
* not : return the negation of its argument, same as ! | * not : return the negation of its argument, same as ! | ||
* average : return the average of its arguments (not rounded, may change) | * average : return the average of its arguments (not rounded, may change) | ||
+ | * formattime : to format time, the first parameter is the standard time format string, the second parameter is the number of seconds since epoch and the third optional parameter is the value when the number of seconds is 0, which is the value of $lastplay_ when the song has never been played, example : formattime(' | ||
currently allowed perl functions (more to come) : ucfirst uc lc abs int sprintf substr length index join warn \\ | currently allowed perl functions (more to come) : ucfirst uc lc abs int sprintf substr length index join warn \\ | ||
Line 157: | Line 183: | ||
* $name : song/group variables | * $name : song/group variables | ||
- | * for columns : title | + | * for columns : title |
- | * for groups : title year length artist album disc genres labels (more will be added) | + | * for groups : title year length artist album disc genres labels |
Line 169: | Line 195: | ||
* $_odd : true if the row is odd-numbered | * $_odd : true if the row is odd-numbered | ||
- | * name:option : the value of the object option/ | + | * name:option : the value of the object option/ |
- | example : | + | |
* name : options of the column/ | * name : options of the column/ |