Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
customization:layouts:latest_version [2010/09/20 11:33] – satoshi | customization:layouts:latest_version [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======= Latest Version Layout Documentation ====== | ||
- | |||
- | |||
- | gmusicbrowser - layout documentation | ||
- | |||
- | This is the documentation for Gmusicbrowser layout system. It tries to follow the latest git version closely, however, since the software is in active development, | ||
- | |||
- | (the syntax is evolving, but I try to support backward compatibility)\\ | ||
- | //Updated on 08-07-2008// | ||
- | //Updated on 06-07-2008// | ||
- | //Updated on 06-05-2008// | ||
- | |||
- | Gmusicbrowser' | ||
- | |||
- | Layouts are found in 2 places: | ||
- | * the default layouts installed with gmusicbrowser are in / | ||
- | * custom layouts can be added by placing them in ~/ | ||
- | |||
- | layout file format : | ||
- | |||
- | [layout id] | ||
- | key1 = value | ||
- | key2 = value | ||
- | ... | ||
- | |||
- | As of version 0.962, layouts file can contain group and column definition for the SongTree widget. See the [[customization: | ||
- | |||
- | long lines can be be splitted in multiple lines by ending them with a backslash | ||
- | |||
- | Very simple example, with 3 buttons (settings, play/pause, and open browser window) and the current song title : | ||
- | |||
- | [very simple] | ||
- | Type = G | ||
- | HBox = Pref Play Playlist _Title | ||
- | |||
- | Type=G (G for generic) is used to make it appear in the player layouts list in the settings dialog. The _ before Title is used to make the Title use all the available space in the horizontal box (HBox) it is packed in. | ||
- | |||
- | Look in the layout file for more examples. | ||
- | |||
- | Keys define either containers or properties.\\ | ||
- | Keys are unique for a layout, duplicate key definitions replace the previous one.\\ | ||
- | There are currently 6 properties keys (Type, Name, Default, Title, KeyBindings, | ||
- | If the name of the key begins with one of: HB, VB, HP, VP, MB, EB, TB the key is the name of a container that will contain widgets (also called layout elements or controls) or other containers.\\ | ||
- | For containers the value is a list of widgets and containers, separated by a space, preceded by optional packing options, the widget names can be followed by a number(to have multiple widgets of the same name) and its options between parentheses. | ||
- | |||
- | There must be one, and only one, container which has no parent, this container will be put in the layout window. | ||
- | |||
- | ===== Normal containers ===== | ||
- | |||
- | |||
- | Containers options can be specified in parenthesis before the child widgets list, example : '' | ||
- | |||
- | **HB/VB** : Horizontal/ | ||
- | |||
- | optional packing options are : (they must be in this order) | ||
- | |||
- | * number | ||
- | * _ : expand (the widget will use all remaining space in the container) | ||
- | * - : right aligned | ||
- | * | ||
- | example : '' | ||
- | |||
- | Cover and ArtistPic widgets are treated specially, they ignore the expand mode, and expand until they reach a square size. example : in a HBox which has a height of 30, a Cover widget will use available space to expand if it has a width less than 30. | ||
- | |||
- | **HP/VP** : Horizontal/ | ||
- | |||
- | Same as HB/VB but they contain only 2 widgets | ||
- | |||
- | And they only have one packing option : '' | ||
- | |||
- | |||
- | **TB** : Notebook (based on [[http:// | ||
- | |||
- | each widget is in a tab, no packing options but the syntax is a bit different, each widget is preceded by the tab title | ||
- | |||
- | the title can have spaces by using quotes | ||
- | |||
- | example : '' | ||
- | |||
- | **EB** : Expander (based on [[http:// | ||
- | |||
- | contains only one widget/ | ||
- | |||
- | option : label : text for the optional widget syntax : '' | ||
- | |||
- | or : '' | ||
- | |||
- | **FB** : Fixed (based on [[http:// | ||
- | |||
- | Each widget is positionned at precise coordinates | ||
- | |||
- | syntax : '' | ||
- | |||
- | The widget is positioned at the x,y coordinate. | ||
- | |||
- | An optional width and height can follow the coordinates, | ||
- | |||
- | x,y,w,h can be relative to the width/ | ||
- | |||
- | x,y can be relative to the right/ | ||
- | |||
- | **MB** : Menus | ||
- | |||
- | They can contain only MenuItem widgets or SM containers, no packing options | ||
- | |||
- | **SM** : Submenu | ||
- | |||
- | They can contain only MenuItem widgets or SM containers, no packing options, label is set with the label container option | ||
- | |||
- | **FR** : Frame (based on [[http:// | ||
- | |||
- | Draw a border around its child, with an optional label. | ||
- | |||
- | shadow none, | ||
- | |||
- | label text of the label | ||
- | |||
- | **SB** : Scrolled window (based on [[http:// | ||
- | |||
- | Adds scrollbars to its child. | ||
- | |||
- | **AB** : Alignment (based on [[http:// | ||
- | |||
- | Controls the alignment and size of its child | ||
- | |||
- | options:\\ | ||
- | '' | ||
- | '' | ||
- | '' | ||
- | '' | ||
- | |||
- | =====Special containers===== | ||
- | |||
- | There is also 2 special containers, widgets in these containers must belong to a normal container, and as the widget is defined elsewhere, widgets options can not be set here. | ||
- | |||
- | **HSize/ | ||
- | Force all widgets to have the same Horizontal/ | ||
- | |||
- | example : '' | ||
- | |||
- | **VolumeScroll**: | ||
- | A unique virtual container (must be the exact name), for all widgets inside, the scroll wheel will modify the volume (unless the scroll event is intercepted, | ||
- | |||
- | |||
- | =====Properties keys===== | ||
- | |||
- | **Title**: | ||
- | Set a title for the window instead of the default : songtitle by artist ('%S by %a') (see %-letters) | ||
- | |||
- | Title = gmusicbrowser playing %S by %a from %l | ||
- | |||
- | **Type**:\\ | ||
- | A String of letters defining the type(s) of a layout, possible types : B(Browser window), T(Tray window), G(Generic or player window), F(Fullscreen), | ||
- | |||
- | **Name**:\\ | ||
- | Set the name of the layout displayed in the settings dialog. The default name is the layout id. Contrary to the layout id, the Name can be changed without losing the layout' | ||
- | |||
- | **Default**: | ||
- | Default options used when the layout has no saved state, contains a space-separated list of keys and values, by pair, | ||
- | |||
- | widget_or_container_name widget_or_container_variable_options | ||
- | |||
- | There is a special key : Window, for the window properties : pos, size (format is numberxnumber for pos and size), sticky, ontop, below, fullscreen (0 or 1 for these) | ||
- | |||
- | example: | ||
- | |||
- | Default = Window size=1120x820, | ||
- | |||
- | **KeyBindings**: | ||
- | Pairs of keys and action, example : | ||
- | |||
- | KeyBindings = Insert OpenSearch c-q EnqueueSelected c-Insert OpenCustom(a layout id) | ||
- | |||
- | key names are as shown in the key binding tab in the settings dialog action names can be found by running gmusicbrowser with command-line option -listcmd | ||
- | |||
- | **DefaultFocus**: | ||
- | Name of a widget in the layout.\\ | ||
- | Set which widget gets the initial focus in the window, will probably only work with very simple widgets and with SongList, SongTree and SimpleSearch for now (let me now if you'd like more) | ||
- | |||
- | **ExtraWidgets**: | ||
- | Allows the addition of extra widgets to the layout (by options or plugin), for each widget types (only button exist now, I expect to add tab or menuitem in the future) a container can be specified where widgets of this type will be added. | ||
- | |||
- | syntax: | ||
- | |||
- | ExraWidgets = button container(option1=value1, | ||
- | |||
- | the option pack contains packing options as defined above for the container (for example ' | ||
- | |||
- | |||
- | |||
- | A layout can be derived from a previously defined layout by adding " based on " followed the name of the reference layout : | ||
- | |||
- | [layout id] based on another layout id | ||
- | |||
- | In this case the layout starts with all the key definitions of the other layout | ||
- | |||
- | each key can be re-defined or deleted (if nothing follow the ' | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | =====Widgets list==== | ||
- | |||
- | Most widget options are optional, %%'' | ||
- | |||
- | All widgets options are using this format : | ||
- | '' | ||
- | |||
- | some still accept the old format: | ||
- | '' | ||
- | |||
- | for backward compatibility | ||
- | |||
- | The widgets are listed with this format : | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | ===widgets related to playing song=== | ||
- | |||
- | |||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | //'' | ||
- | //'' | ||
- | //'' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | ===Options common to the label widgets=== | ||
- | |||
- | |||
- | |||
- | The label widgets include : Album, Artist, Comment, Date, Length, LabelTime, Pos, Title, Title_by and Label | ||
- | |||
- | * ' | ||
- | |||
- | * ' | ||
- | |||
- | * ' | ||
- | |||
- | * ' | ||
- | |||
- | * ' | ||
- | |||
- | |||
- | ===player buttons widgets=== | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | |||
- | |||
- | The BContext, Playlist and OpenQueue buttons accept the option ' | ||
- | |||
- | All buttons can be changed to an indicator(no button border, smaller) with the option button=0 | ||
- | |||
- | Relief can be changed for buttons by using the option relief=none (default), half or normal. | ||
- | |||
- | Size of buttons and indicators can be set to menu, small-toolbar, | ||
- | |||
- | |||
- | ===player indicators widgets=== | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | ''' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | All indicators can be changed to buttons with the option button=1. | ||
- | |||
- | Size can be changed same as buttons, see above. | ||
- | |||
- | |||
- | |||
- | A lot of widgets, in particular labels, indicators and buttons can use the option click1 (or click2 ...) to (re)define the action executed when the widget is clicked with mouse button 1 (or 2 ...). Example : | ||
- | click2=OpenSongProp | ||
- | |||
- | buttons widget also accept the option activate to (re)define the action executed when the button is activated with a mouse click or keyboard | ||
- | |||
- | Also, a lot of widgets, in particular labels, indicators and buttons, can use the option tip, to define a tooltip for the widget. The tip can contains %-letters to display informations on the current song. | ||
- | |||
- | Another common option is cursor, to to change the mouse cursor when it hovers over it (eg : cursor=hand2). See [[http:// | ||
- | |||
- | |||
- | |||
- | A lot of widgets can also use the hover_layout=ALayoutName option, it causes a window using the ALayoutName layout to popup when the mouse hover on the widget (for more than 1000ms, or the value set by the hover_delay option, use 1000ms if set to 0). The popped-up window disappear when the mouse exit the window. | ||
- | |||
- | (This feature is still a bit experimental) | ||
- | |||
- | Simple example of the hover_layout option to popup a big cover when the mouse hover on a Cover widget, by defining the Cover widget with this option : '' | ||
- | |||
- | where CoverPopup is the the layout : | ||
- | |||
- | [CoverPopup] | ||
- | |||
- | VBmain= Cover(minsize=800, | ||
- | |||
- | |||
- | |||
- | To make the layout popup when the Cover widget is clicked rather than hovered, use this option : Cover(click1=PopupCustom(CoverPopup)) | ||
- | |||
- | ===Misc. Widgets=== | ||
- | |||
- | |||
- | |||
- | '' | ||
- | //'' | ||
- | //'' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | //'' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | //'' | ||
- | //'' | ||
- | |||
- | '' | ||
- | //'' | ||
- | //'' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | //'' | ||
- | //'' | ||
- | //'' | ||
- | //'' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | ===Songlist widgets=== | ||
- | |||
- | |||
- | |||
- | When there is more than one SongList/ | ||
- | |||
- | All the other widgets which interact with a SongList/ | ||
- | |||
- | |||
- | |||
- | **QueueList** Display queue (and edit it), accept the same options as SongList | ||
- | |||
- | **SongList**\\ | ||
- | //'' | ||
- | |||
- | //'' | ||
- | |||
- | //'' | ||
- | |||
- | //'' | ||
- | |||
- | //'' | ||
- | activate=play& | ||
- | |||
- | //'' | ||
- | |||
- | //'' | ||
- | |||
- | //'' | ||
- | |||
- | //'' | ||
- | |||
- | **TabbedLists** Songlists in tabs, can contain playlist, static lists and the queue. Experimental feature : layouts of type ' | ||
- | |||
- | **SongTree** Very customizable Songlist replacement. Some things are still not implemented : drag and dropping columns, playlist, queue or static list mode, moving songs using the EditListButtons widget (arrows button) and type-ahead search. See [[customization: | ||
- | |||
- | ===widgets related to songlists=== | ||
- | |||
- | |||
- | |||
- | (filter# is a number between 0-9, 0 is meant for FLock, when a filter is set all filters with a higher number are reset) | ||
- | |||
- | All these widgets accept the option ' | ||
- | |||
- | |||
- | |||
- | '' | ||
- | //'' | ||
- | |||
- | '' | ||
- | //'' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | //'' | ||
- | //'' | ||
- | //'' | ||
- | //'' | ||
- | //'' | ||
- | //'' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | //'' | ||
- | //'' | ||
- | |||
- | ===MenuItem widgets (can only be put in a MB/SM)=== | ||
- | |||
- | |||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | //'' | ||
- | //'' | ||
- | //'' | ||
- | //'' | ||
- | //'' | ||
- | |||
- | PFilterItem playing filter menu | ||
- | |||
- | PSortItem playing sort order | ||
- | |||
- | PlayItem choose a Filter based on playing title/ | ||
- | |||
- | QueueItem queue menu | ||
- | |||
- | SeparatorMenuItem separator | ||
- | |||
- | ====%-letters==== | ||
- | |||
- | |||
- | |||
- | Some options accept %-letters variables that are replaced by a field/ | ||
- | |||
- | For example in "%t by %a", %t is replaced by the song title and %a by the artist name. | ||
- | |||
- | Note that %c and %f are not meant to be used for displaying | ||
- | |||
- | t title | ||
- | |||
- | a artist | ||
- | |||
- | l album | ||
- | |||
- | d disc | ||
- | |||
- | n track | ||
- | |||
- | y year | ||
- | |||
- | C comment | ||
- | |||
- | p play count | ||
- | |||
- | P last play | ||
- | |||
- | k skip count | ||
- | |||
- | K last skip | ||
- | |||
- | g genres | ||
- | |||
- | L labels | ||
- | |||
- | m length | ||
- | |||
- | S title or filename if no title | ||
- | |||
- | f filename (with path) (raw filename, may not display correctly) | ||
- | |||
- | u filename (with path) (in utf8, used for display, might not be convertible back to the real filename) | ||
- | |||
- | c cover file | ||
- | |||
- | Y album year(s) | ||
- | |||
- | A album artist or main artist or various (determined automatically from all the songs of the album, doesn' | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | ===== Hints, Bugs, Workarounds ===== | ||
- | |||
- | |||
- | == Bug: Scrambled font in gmusicbrowser widgets == | ||
- | {{: | ||
- | * Symptom: Font of some widgets (e.g. Title) gets scrambled when song changes | ||
- | * Affects: gmusicbrowser <= 1.0.1 to >= 1.0.2 (fixed in git branch v1.0.x) and <v1.1.4. (only with gtk >= 2.18) | ||
- | * Reason: Apparently this happens when the Title, Artist, Album widgets are packed into vertical size groups (e.g. '' | ||
- | * Workaround: Do not pack those widgets in a vertical size group. Instead you could use a padding ('' | ||