New attributes for controls: xkeepratio and ykeepratio

About usage, announcement and development of skins for VLC
ipkiss
Big Cone-huna
Big Cone-huna
Posts: 695
Joined: 23 Nov 2003 01:49

New attributes for controls: xkeepratio and ykeepratio

Postby ipkiss » 05 Aug 2006 15:53

Hello,

I have just added 2 new attributes for all the controls: xkeepratio and ykeepratio. They are false by default (which keeps the current behaviour), but when set to "true", the behaviour of resizing changes: the size of the control is constant (horizontally if xkeepratio is true and vertically if ykeepratio is true), and the position of the control inside the layout is computed in such a way that the ratio between the space to the left on the control and the space to its right is constant (for xkeepratio). Said more clearly: if initially there is twice as much space on the left as on the right (the ratio is then 2), this will remain constant when resizing the window.
In particular, a control initially centered will remain centered.

This is more powerful than a mere "center" attribute (which was requested several times, in particular by @$im in this thread), i just hope this isn't too complex to understand :)

The feature will be available in the next nightly build, and the documentation will be updated by tomorrow as well (it is refreshed every night).

Asim
Cone that earned his stripes
Cone that earned his stripes
Posts: 151
Joined: 30 Mar 2005 05:58
Contact:

Postby Asim » 09 Aug 2006 13:38

hmmph... interesting...

so do these controls take precedence over the righttop & leftbottom controls?

- Asim

ipkiss
Big Cone-huna
Big Cone-huna
Posts: 695
Joined: 23 Nov 2003 01:49

Postby ipkiss » 09 Aug 2006 17:05

so do these controls take precedence over the righttop & leftbottom controls?
Yes they do, but only in their respective direction.
So if you have xkeepratio="true" and ykeepratio="false", the lefftop and rightbottom attributes will be ignored horizontally, but they will still be used to compute the vertical resizing (or moving) of the control.

Asim
Cone that earned his stripes
Cone that earned his stripes
Posts: 151
Joined: 30 Mar 2005 05:58
Contact:

Postby Asim » 23 Aug 2006 16:45

here's a copy/paste of a message i wrote to ipkiss...

i've tried out the xkeepratio and ykeepratio... things to note: first of all... seems to be some sort of bug w/ the bitrate being displayed... from what i could see from my code...

and w/ the xkeep & ykeep i noticed that when u resize the stuff everything gets streched... e.g. the stop button moves to far left... and the "open file" button moves to far right... i think it's because of the fact that everythign is dynamically positioned... in terms of percentages? what i require though is that they be dead in center... and not moved off to the extremes. there also seem to be bugs with the video not being able to be stopped (unless a new theme is opened)... Otherwise... the slider not going horribly wrong seems to be working great... :D (note: im using nightly from 23rd aug 06)

perhaps an idea would be to have xkeepratio and ykeepratio for the group element?
__________________________________________________________
end of copy/paste....


otherwise... there is an alternative... but that would be a last ditch effort...

and that would be to make all buttons the same size... positioning the "pressing" part of the button in the desired position and keeping the background transparent... this will obviously work...


e.g.

-------------------------------
| |X| |
| |X| |
-------------------------------

instead of:


|X|
|X|


anyone get my idea?

ipkiss
Big Cone-huna
Big Cone-huna
Posts: 695
Joined: 23 Nov 2003 01:49

Postby ipkiss » 23 Aug 2006 19:32

and w/ the xkeep & ykeep i noticed that when u resize the stuff everything gets streched... e.g. the stop button moves to far left... and the "open file" button moves to far right... i think it's because of the fact that everythign is dynamically positioned... in terms of percentages? what i require though is that they be dead in center... and not moved off to the extremes.
I see what you mean, but it is not possible. The only way to group the controls is with a Group tag, but it is not really grouping them internally (it is only for the XML). Changing this will require quite a lot of changes i think...
there also seem to be bugs with the video not being able to be stopped (unless a new theme is opened)
The code handling the Video control is currently quite buggy. I will try to improve that in the following days.
anyone get my idea?
Not me :)

Asim
Cone that earned his stripes
Cone that earned his stripes
Posts: 151
Joined: 30 Mar 2005 05:58
Contact:

Postby Asim » 24 Aug 2006 02:02

hmm what i mean is...

if we make all buttons the same size (the backgrounds that is)... e.g. play and stop and next/previous... and have the background transparent... then position all the images in the same place... but keep in mind in the image... the button part of it is in the place u put it... the rest of the image is blank... then it will all be perfectly centered... it'll take me a while to do this on my skin... but it can be done

- Asim

ipkiss
Big Cone-huna
Big Cone-huna
Posts: 695
Joined: 23 Nov 2003 01:49

Postby ipkiss » 24 Aug 2006 08:54

I still don't see how you will prevent the buttons to move away from each other...

Asim
Cone that earned his stripes
Cone that earned his stripes
Posts: 151
Joined: 30 Mar 2005 05:58
Contact:

Postby Asim » 24 Aug 2006 13:08

well if every image is the same size... when u resize... the images are all the same... hence they'll be in the center... but most of the image is transparent apart from a small part of it...


e.g.


|<------- 20px ------->|

8px
<->
--------------------------
xxx<*xxxxxxxxxxxxx
--------------------------

--------------------------
xxxxxxxxxxxxx*>xxx
--------------------------

--------------------------
xxxxxxxxOxxxxxxxxx
--------------------------

where x = transparency

ipkiss
Big Cone-huna
Big Cone-huna
Posts: 695
Joined: 23 Nov 2003 01:49

Postby ipkiss » 24 Aug 2006 14:59

Ah yes, that's a good idea. It should indeed work.


Return to “Skins”

Who is online

Users browsing this forum: No registered users and 78 guests