Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: tomers on December 05, 2009, 03:09:11 PM

Title: Language aware positioning of WPS elements
Post by: tomers on December 05, 2009, 03:09:11 PM
This is not actually a bug, nor a patch
I would like to have a conditional positioning of an album-art, depending on the #?Sr token. How can I achieve this?

I tried to create a viewport according to two different criteria - whether or not an album-art exist (%?C) and language direction (%?Sr).
Any ideas?

Attached is a work in progress WPS for Cowon-D2, which I try to change into language direction sensitive WPS screen.
Title: Re: Conditional positioning of album art
Post by: tomers on December 05, 2009, 03:24:13 PM
Attaches are screenshots of the expected result (manually made for Cowon D2)
Title: Re: Conditional positioning of album art
Post by: pixelma on December 05, 2009, 06:13:04 PM
You should be able to get this effect with conditional viewports by working with two sets of an album art viewport and a text viewport - both the same size but at different positions.

Code: [Select]
%?C<%?Sr<%Vdb|%Vda>|%Vdc>
P.S.: Just a wish - if you change it for cabbiev2 in SVN, please try to change all versions for targets that use album art (colour and greyscale displays).


Edit:
I just saw your attached .wps file. It looks like there is only one viewport for album art and text (and every case). I would put the album art in an own viewport and the text in a seperate one - the text would be printed across the art and would be displayed in your album art viewport currently if I read things correctly. Then the %Cl can (or should be) before the %Vl tags because it will then be used in the same way, relative to the borders in the two album art viewports which contain the %C. The check for which viewport should be displayed looks correctly I think (with the extra of having left and right aligned versions of the display when there is no album art).
Title: Re: Conditional positioning of album art
Post by: tomers on December 27, 2009, 04:04:50 PM
I've just posted a more elegant solution for this problem:
FS#10882 - RTL aware WPS  (http://www.rockbox.org/tracker/task/10882)

pixelma: I would greatly appreciate if you can review and comment about this patch.
Title: Re: Language aware positioning of WPS elements
Post by: [Saint] on December 27, 2009, 09:21:32 PM
tomers,


Just an opinion, but why not make your own WPS (even if it is just another cabbie variant) as well as the patch?

The theme site isn't as "dangerously underpopulated" as it used to be (depending on the target)...but it could still (and always) use more content. Fresh content with new or interesting uses of code can inspire new authors to make newer/better content.

A great many number of people can access this patch, apply it to their liking, compile a build etc.....but a great many more (potentially) could benefit from the same piece of code when presented as a WPS and uploaded to the Theme Site.

And then, you get to express yourself artistically as well  ;D


Just a thought,
[St.]
Title: Re: Language aware positioning of WPS elements
Post by: tomers on December 28, 2009, 12:40:06 AM
St.,

Thank you for your feedback.

Just an opinion, but why not make your own WPS (even if it is just another cabbie variant) as well as the patch?
The main idea of this patch is to make already existent WPS screens look more naturally when Rockbox interface is set to any RTL language (Hebrew, Arabic).
With my patch applied, the Cabbie theme looks the same (didn't create any regression). But when RTL language is in use, it looks more natural, oriented from right to left. There is no point in creating any new RTL variant of any theme if this patch is used.

Not all themes can be sensitive to language direction, because their orientation is 'hard-coded' in the graphics, so that horizontally mirroring their viewports or album-art location doesn't look well. One example is the iPodWidgets theme (http://themes.rockbox.org/index.php?themeid=10&target=cowond2).

I will try to review all themes in SVN and make them language direction sensitive, if appropriate. I'll add it to the patch, and when we feel it is ready, I'll commit. I'll appreciate if you can test it and report.

A great many number of people can access this patch, apply it to their liking, compile a build etc.....but a great many more (potentially) could benefit from the same piece of code when presented as a WPS and uploaded to the Theme Site.
The patch will hopefully be committed soon, so that everyone will get its functionality, without the need to patch and recompile...

And then, you get to express yourself artistically as well ;D
Unfortunately, I am not that of an artist yet  ;)
Title: Re: Language aware positioning of WPS elements
Post by: [Saint] on December 28, 2009, 03:34:07 AM
Wow cool, I didn't realise it was headed for a commit.

Usually I see an idea and think "hey that's cool..." but it never makes it to the official build.

How did you achieve the effect?

%?C<%?Sr<RTL viewport|LTR viewport>|no AA so center it and who cares>

is probably what I'd of tried...
But I'm interested to know how you've done it.

[St.]


PS:
Unfortunately, I am not that of an artist yet  ;)

If you can use Notepad and MSPaint, you can make a WPS  ;D
Title: Re: Language aware positioning of WPS elements
Post by: tomers on December 28, 2009, 04:12:32 AM
Wow cool, I didn't realize it was headed for a commit.

Usually I see an idea and think "hey that's cool..." but it never makes it to the official build.
All patches are meant to be committed sometime. If they are not appropriate to the official build, they will eventually be closed.

How did you achieve the effect?
May I suggest you read the code? ::)

%?C<%?Sr<RTL viewport|LTR viewport>|no AA so center it and who cares>
is probably what I'd of tried...
I tried using this method, but to code turned out to be awy too complicated. I don't remember exactly what was the exact code (BTW I created the %?Sr directive).
I think the current suggestion is far better, although the letters used quite suck - but that's the ones left >:(

If you can use Notepad and MSPaint, you can make a WPS  ;D
I think this is not a good idea - we will get a bunch of ugly themes created by programmers. This task should be given to artists...
Title: Re: Language aware positioning of WPS elements
Post by: [Saint] on December 28, 2009, 04:52:26 AM
I think this is not a good idea - we will get a bunch of ugly themes created by programmers. This task should be given to artists...

I don't think I've ever really, truly had a moment before now where I could actually type LOL knowing that I actually did "laugh out loud"....my girlfriend came in from the next room to see what was so funny (and was quite dissappointed I might add)

So..(if I read it correctly) upon this patch being committed the prefix to the x co-ord "s" would then horrizontally mirror the viewport?

Well, that's a SHITLOAD easier than getting the WPS to do the legwork via conditionals...well done!