These parameters will allow to create a slider which adapts to the display.
width/height parameters will be optional. If set, the initial slider will
be resized to meet these requirements.
A main use case will be the possibility to create a fullscreen timeslider
that automatically spans the whole screen whatever the screen resolution.
e.g syntax would be <Slider width="100%" ....>
Up to now, text control could but be focusable, and this focus was used
to scroll text, should it be too long for full display.
From a user viewpoint, this behavior is often counterintuitive :
- Most of the time, the control is designed to fit the text anyway, and
scrolling is not expected.
- On the other hand, an underlying control may be used to move the window
(for instance, the title bar), and a text control is expected not to
interact in this endeavor. Same goes for popupmenu, that is expected
to work if one happens to right-click on a text control.
This patch adds a 'focus' attribute to the text control, and leave it to the
skins developper to decide which behavior is most desirable on a per-control
basis. focus still defaults to true to maintain skins current behavior.
So far in skins2, all x, y, width and height were given in pixels, and
no reference to the screen resolution could be made.
This patch implements the following :
- all x, y, width, height can be given in pixels or in % of their container.
For windows, the container is the screen. For widgets, it can be the
layout or a panel.
- Five new tags eases up positioning
- position : relative position given as "Center", "West", "NorthWest", ...
- x/y-margin : margins to take into account (in px or %) wrt the borders.
- x/y-offset : additional offset to apply (in px or %).
- the image control can now accept a width and a height parameters.
This patch gives skins developpers the possibility to display the art file
associated to the current input in an image control.
It features the following :
- a new 'art' boolean parameter is added for the Image control (skin.dtd)
- when set to true, the skin engine will reuse this control to display
the current art file
- in addition to 'scale' and 'mosaic', the resize parameter can now accept
a new 'scale2' value, that respects the original aspect ratio of art files
It adds possibility to store IDs for Anchors, Panels and Groups.
This does not change the way skins2 works I believe. It just stops the
XML parser from complaining about non standard skins when they have set
IDs for those elements. And setting IDs for them is vital in the skin
editor, as it differentiates between different elements in the skin just
by their ID.
- New Panel tag, allowing to group the resizing behaviour of controls
- Documentation updated accordingly
- Fixed a memory leak due to CtrlMove/CtrlResize objects
controls. When set to "true", the behaviour of the resizing is changed
(cf. documentation). The main use for these attributes is to keep a
a control centered in the layout (horizontally, vertically or both) without
resizing the control.
- anchors have a new "lefttop" attribute, allowing them to follow the
border of the window when resizing
- the resizing is now handled by the WindowManager class (to enforce the
mediator pattern). This makes it possible to handle tricky cases,
such as:
window B is anchored to window A, and A is resized
==> B moves accordingly, and can still be anchored by other windows
with id "pledit" (defined in the new tag "<IniFile>" contains:
[Text]
Normal=#FFFFFF
it will create a constant "pledit.Text.Normal" with value "#FFFFFF"
* winamp2.xml: use the "pledit.txt" file to have correct playlist colors
is it ok to backport in 0.8.5 ?
XML example:
<PopupMenu id="sample_menu">
<MenuItem label="Play" action="vlc.play()" />
<MenuItem label="Pause" action="vlc.pause()" />
<MenuSeparator />
<MenuItem label="Show playlist" action="playlist_window.show()" />
<MenuItem label="Hide playlist" action="playlist_window.hide()" />
<MenuSeparator />
<MenuItem label="Quick open file" action="dialogs.fileSimple()" />
</PopupMenu>
To call the menu:
<Button action="sample_menu.show()" ... />
Known bug: the popup disappears when the user clicks "too fast" on the
button: the control refreshes itself in an asynchronous way, and the popup
dislikes it... so click slowly :)
"nbFrames" and "fps" in the (Sub)Bitmap elements to set the number
of frames and the frame rate in a bitmap. As in the radialslider,
the different frames are just laid vertically in the bitamp (and
all the frames must have the same size)
At the moment animated bitmaps are only supported in Button controls.
- alignment: possible values are left/right/center (left is the default)
The right and center alignments are computed using the width of the
control (as given by the "width" attribute).
- scrolling: possible values are auto/manual/none (auto is the default)
* auto: same behaviour as before, the text automatically starts
scrolling if it doesn't fit in the width of the control. The user can
still drag it manually.
* manual: only manual scrolling is possible
* none: no scrolling possible
* all: the slider background is now in a dedicaded tag
"SliderBackground". The number of images can now be parametrized
in both directions, and the offset between 2 images (padhoriz and
padvert) is no more hardcoded
depends on the position of the slider. The "Slider" elements now
have optional attributes "background", which the Id of a bitmap,
and "nbimages" which is the number of images in the bitmap (it
is similar to the radialslider). At the moment there is a hack
to support winamp slider bars: the different images must be
separated by 3 rows of unused pixels (well, maybe they are
useful; if someone knows how... ;)
* theme_loader.cpp: convert the file names from zip archives to
lower case, to avoid mixed case issues in some winamp skins
several bitmaps in a skin from regions of the same image file.
Usage is:
<Bitmap id="body" file="main.bmp" alphacolor="#FF0000">
<SubBitmap id="sub1" x="0" y="10" width="100" height="100" />
<SubBitmap id="sub2" x="100" y="10" width="100" height="100" />
</Bitmap>
the method used to resize the image, which can be "mosaic" (the default)
or "scale". Note that the previous behaviour was always "scale" before,
but mosaic is much much faster, so use scale method only for fun ;)
* skins2/*: support of the new mosaic method; playlist resize with this
method is significantly faster!
The XML file must begin with:
<!DOCTYPE Theme PUBLIC "-//VideoLAN//DTD VLC Skins V2.0//EN" "skin.dtd">
(the "skin.dtd" is ignored but should be an URL on the website)
and the DTD is looked up at runtime in the directories of the resource
path (see previous commit), e.g /usr/local/share/vlc/skins2/skin.dtd
-> the DTD doesn't need any more to be shipped with the themes.