Showing posts with label widgets. Show all posts
Showing posts with label widgets. Show all posts

Tuesday, 28 July 2009

Nodoka Widget Drawing - Starting From Scratch

I know everyone will hate me now, but I've decided to break my current development of gtk-nodoka-engine-0.8.x and start working on it from scratch. I don't know what was the real push to do that, but I felt I needed to support wider configurations in the engine (with future in mind), develop more consistent, usable and pleasing look and feel and write the drawing code in a way that would be independent on the toolkit. As for the design itself as inspiration serves basically the widget design on iPhone (and OSX in general), current nodoka, the 0.8.x sketches and existing implementation, Chromium and much more.

For faster tuning of the gradients I've wrote a simple GTK application filled with sliders... And I later extended it for showcasing and testing drawing code of the widget. Forgive me for not publishing the source code, because it's total mess. The widget drawing code will eventually go to gtk-nodoka-engine, so I try to keep that part less messy, but creating the gui, writing event handlers, ... has been made in way that it just works (TM)...

I have to say that it's pretty interesting to write GTK applications using all the GObject and GtkWidget magic, and I've come to a deep understanding of why it's mostly inevitable to use tools like Glade to design more complex GUIs. The app currently looks like this:

The top left image serves for tuning the fill gradient settings, with the four sliders right of it I can control the base color and transparency, the other five sliders are for the actual gradients settings. With this I've finally came up with something I was satisfied with for button and added entry (because it often combines with button). The result is such:

Now, even though current GTK (AFAIK) does not directly support button groupings, it is possible that in the future such feature will be there, so I decided to have the drawing code prepared. Since the drawing code is independent on widget toolkit, I can simulate everything I want in my small app, which is why the bottom part of the app was added. It has an drawing area in which I draw the widgets (currently buttons only) and a button which serves as a reference for testing various states. You can notice, that I have grouped the buttons by three – that's to test all the various cases that can happen: button is first in group, button is last in group and button is in group but is neither first nor last.

Next feature not implemented AFAIK anywhere else than pango (and perhaps other text rendering libraries) is complete writing style support. That means not only the left to right, then top to bottom (used e.g. in Latin, English, ...) and right to left, then top to bottom (used e.g. in Arabic) cases covered by CSS, GTK, ... but also top to bottom, then right to left (used e.g. in East Asian scripts) and top to bottom, then left to right (used e.g. in Mongolian). At one point this was part of CSS3 specification, but for some reason it has been dropped. Anyway, because in code it means only implementing two new cases which basically means only using different transformation matrix, and thus should not affect speed of the rendering, I decided to implement it.

Thus in the preview in the app, there are actually four button groups – the top one is usual LTR, with the left button being treated as first, the one bellow is usual RTL, with the right button being treated as first, and bellow the left one is top to bottom, then left to right case, with the top button being treated as first and the remaining is top to bottom, then right to left case, again with top button being treated as first.

The lighting follows "paragraphs flow" – meaning that for horizontal text the light shines from mostly from top, and in vertical text depending on the flow either from left (Mongolian) or from right (Japanese). Now it would be even greater if I could add some text to the buttons to test how it would look with it included, but I don't know how (or rather I am too lazy to study pango from scratch and quick google search does not seem to reveal any nice pango tutorials)...

And now some video of the buttons "in work".

Download

Thursday, 31 July 2008

Nodoka GTK Engine 0.8.x - continuation

So, I successfully passed through the exam, "enjoyed" the vacations (I caught some sort of flu, it only lasted for 2 or 3 days however) and did some more work on the design for the next nodoka stable branch. I also started writing the documentation for it, which can be found on my Fedora People page.

As mentioned in the documentation, I'll introduce new configuration options among which there is one called style. It will have three different values to choose from. The first one is CLASSIC, which is basically a continuation of the current design and will mostly contain small adjustments or fixes, plus it will most likely will be able to cope with the new configuration options. I made a fake screenshot in inkscape of The Widget Factory window to outline what the small changes will most likely be in the near future. These changes will also get backported to the 0.7.x branch and will most likely be present in Fedora 10. Here's the image:



The second one is MODERN and is an evolution of the CLASSIC one, but features more drastic changes, like theming previously "non-themed" widgets, introducing gradinents where previously weren't, etc. It will most likely be default in Fedora 11. See for yourself:



The last choice is GLOSSY and is actually being designed by Andy Fitzsimon. It won't be default in Fedora (or at least next two releases), but available via the gtk-engine-nodoka-extras package ;-) The widget factory mockup is not complete yet, but here's the WIP:



Most of the stuff I posted here is also at the 0.8.x Brainstorming wiki, the GLOSSY one will be added there as soon as it's finished. Until then you can follow the thread that started it on the fedora-art-list.

[sarcasm_mode=ON] BTW. I write the documentation in Plain TeX and I think that Plain is the only true God of typesetting and that all LaTeX-ists are heretics and need to be exterminated :-D [/sarcasm_mode] Hehe, just joking, I really write it in Plain, but the rest is just a big fat lie :-p

As usual I am greatful for any kind of (constructive) feedback. You can leave it either here in the comments, or in the fedora-art-list. Or, if you happen to see me on IRC on #fedora-art we can discuss it there as well, my nick is msourada.

Monday, 21 July 2008

Nodoka GTK Engine - towards next big release

Well, I've got some time and ideas how to improve the nodoka gtk2 engine and started working on the new branch (0.8.x), though only in inkscape and in wiki so far... It's a little sad that I have to wait a little more to do more work since in Thursday I've got exams from Classical Electrodynamic (though Special Solutions to Maxwell Equations would be more fitting because most of the time we did electrostatics and magnetics :-D) and after that I'll go on a short vacation. If I wasn't a lazy bum I would have done it a month ago already... Anyway, back to the topic. What's big on the next release?

The next branch of nodoka will recive something what you might call face-lift. I started redesigning the gradients, though in a evolution-like way. Also I made designs for previously 'unthemed' things, like arrows, radio/check buttons, etc. The goal of this release is to complete consistent and complete engine+set of themes that will be natural evolvement of the previous releases and at the some making itself distinguishable from other big players like Clearlooks, Murrine or Aurora. Another goal is to make the engine highly customizable, while maintaining the over speed - we like both speed and configurability, after all :-)

As I've already created a bunch of designs, I think the vacation might come handy - after then I'll check your reactions, suggestions, comments, ... and see which way I'll eventually take. So if you have some ideas, comments, suggestions, ... feel free to either add a comment here or drop a mail at the fedora-art-list.

In my initial mail to the art list I mentioned Fedora 10 release, but when I started designing I came with a lot of ideas and it seems more realistic to make it in time for Fedora 11. The reasons are obvious - it'll take some time to finish the art designs, given the current state of things the code, mostly the drawing functions, will need a major rewrite and extensions and I'll need to think how to make the code effective. It'll take a long time before I'll be able to build something consistent enough to push it even to rawhide, and I don't wan't to start testing just weeks before final release.

So, as the things are now, I think the most possible scenario is early branching of nodoka for F-10 which will make the new packages appear in Rawhide just after the release. Then we'll have the full release cycle to fine-tune the design, perhaps make a Qt4 port, and sort out most bugs.

And now some teasers:




More stuff can be found on the wiki page I created as a "container" for all 0.8.x branch related info.

And the future? Well, now I have a feeling like the 0.8.x branch could be the last pre-1 release. And what would be in the 1.0.0? Perhaps finally support for RGBA, more widgets animation (optional), perhaps some dynamic widgets stuff (optional) and of course it should definitely work well :-D Well, it would be great if the 1.0.0 release was released about the time GTK 3.0 will be out, since it seems like GTK 3.0 will be the first gtk+ version to sort out the problems with theming entries and progress bars and it also looks like GTK 3.0 would also be RGBA enabled. Well, we'll see what the future brings :-D