Some time ago I blogged about a number of improvements which made its way into the GNOME 3.0 theme, thanks to the new GTK3 CSS-powered theming engine.
This cycle, Benjamin and I have been working on making the CSS parser in GTK3 more conforming to the W3C specifications, while adding some cool new features in the meanwhile.
What’s already there
The parser from GTK master will now report errors consistently when it fails to parse the CSS data, including the position in the data where the error occurred. This can be used nicely e.g. to highlight the broken line in an editor, such as Carlos’ nice gedit-cossa plugin (GTK master also recently grew a very simple live-editor too if you feel like toying with this).
It’s really easy to hook up parsing for new properties; CSS features such as inheritance and shorthand properties are now supported natively by GtkThemingEngine. Existing properties have been extended to be shorthands according to the CSS specification (e.g. border-width, padding, border-radius), and the non-shorthand versions have been added too (e.g. setting border-right will now do the right thing).
nth-child structural pseudo-class support have been extended to work for generic containers. GtkBox already supports this, with other popular containers (e.g. GtkToolbar) to follow shortly. This means it’s easy now for themes to visually connect contiguous borders.
We’re adding support for new CSS properties, to allow themes to specify subtle eye-candy directly from the stylesheet. Here’s a list of additions targeting GTK 3.2.
icon-shadow is a custom property which behaves similar to text-shadow for icons. It looks great with symbolic icons. It’s also generic enough to be used with icon-like UI elements such as arrows, spinners and whatnot in the future – git branch
box-shadow allows to render inset and outset frame shadows. Outset box-shadow support is unfortunately really hard to implement within the current GTK drawing process, so it won’t make it in 3.2.
border-image will be expanded to be a shorthand property as well, and match the CSS3 specification for drawing.
CSS is huge and complete property coverage is not interesting for GTK. We plan to incrementally add support for new properties/pseudo-classes based on the requirements of the designs to be implemented; help/feedback is gladly appreciated. If you have a CSS attribute in mind that should be supported at the GTK level, please file a bug, possibly with a patch attached
We’re still carrying over a legacy of many per-widget style properties that specify paddings/borders; I think we should try to get rid of them where possible, and try to use standard CSS and style classes (e.g. to define different areas inside a widget) as much as possible: CSS is documented very well, and we can trust the specification for any semantic of the properties, not reinventing the wheel for every widget. This is a GTK4-ish goal, but I think it’d be great to start soon porting and deprecating.
I also think native theming engines should be as small as possible; ideally they should be able to get any desired effect using the CSS stylesheet only. This means the builtin GTK theming engine should be flexible enough for most of the use cases.
Here is the obligatory screencast of what’s currently in git.
How do I get it?
I didn’t make a release out of it yet, as it still has a few minor bugs, but it’s actually quite usable already, and you can try it by downloading it from here
Quite a lot of things have happened in my life since I last had the occasion to write on this blog…the most important is I moved to Boston last January, to work in the awesome Red Hat Desktop Team. It’s very exciting and inspiring to work togetherwiththisgreatpeople, and it is even more cool these days when we’re all working hard to delivery the best GNOME 3 experience possible; I think it’s going to be great!
Here’s some of the things I’ve been working on in the last month I want to show you.
Allan has been doing a great job showing off the mockups for Nautilus 3.0 by the design team; the good news is that now those mockups are mostly implemented in the latest beta tarballs. Here’s how Nautilus from git master looks like
The most outstanding changes are the new streamlined toolbar, a new sidebar design, and the use of “floating” statusbars to reduce the UI chrome. Another important change is that “spatial” mode is now gone for good; we still allow opening new folders in separate windows, but we use a single UI now.
Adwaita is the GNOME 3 default theme, which include themes for GTK+ applications, the window manager, cursors and the background. In the last week I’ve been implementing the gnomedesignteam mockups for the GTK+ theme, and I must say I’m quite pleased with the result. Here are some screenshots of what you get with the current theme (the Nautilus screenshot above uses the new theme too):
The changes are too many to describe them one by one, but notable improvements include toolbars, checkbuttons, radiobuttons, notebook tabs and treeviews.
We’re almost there, April 2011 is around the corner now…
Hi there! It’s been a long time since I last wrote something on this blog, which reminds me how many things have happened in my life in the last year and a half.
As some of you might know, I’ve been working part-time for Collabora (on Empathy), helping fixing misc bugs and implementing nice things like file transfer, the accounts dialog user interface and the transition to the Mission Control 5 framework.
In the meanwhile I kept myself busy with my university and finally, last week, I took the last exam of my course! This means I’ll hopefully graduate on April Since November, I already started digging into my thesis, which will be aTelepathy implementation of the XTLS protocol, an end to end solution to crypt communication over XMPP.
In order for Telepathy to support channel encryption, some new interfaces need to be written. I drafted someproposals for this on the telepathy mailing list in the last few months, and I’m happy that Eitan Isaacson picked them up and turned them into something more concrete. In order to discuss with him and the rest of Collabora about the proposal, I’ll visit the Cambridge office at the end of the month, right in time to attend FOSDEM and the XMPP summit together with the Collabora gang.
After that, the items on my TODO list include:
draft a proof-of-concept implementation of the XTLS handshake into Wocky(I already started coding for this before I had to stop for my exams).
make sure the new Telepathy interfaces work fine in telepathy-glib
Last week I have been to Istanbul, to attend GUADEC. It has been an amazing time there, and I have been really happy to meet, socialize and share ideas with the other SoC students and some of the GNOME gurus
Together with Bastien, Clemens and Felix, we planned the next final steps for the MediaManager project. Also, it seems that Felix’ project (Cheese integration) will be one of the first clients to use my MediaManager library to expose cool features in the GtkFileChooser!
== Work to be done ==
- Write a set of widgets wrapping around the backend code
- Write a GtkModule that hooks up into the GtkFileChooser to achieve my ultimate SoC goal of integration with it.
== Timeline ==
I don’t know how much work I will be able to do in this following week until the 23rd of July, as I’m having some exams in this timeframe. Anyway, afterwards I’ll be home until the 10th of August at least and working again full-time on the project, so I came up with this plan, which would be perfectly synced with both the SoC timeline and my holidays
- 24th of July to 31st of July, writing of the widgets
- 1st of August to 5th of August, writing of the GtkModule
- 6th of August to 10th of August, final bugfixing & release
Feel free to mail me for any suggestions on the widget part or if you think your application needs some specific widget to use my library. I will start coding them in the next week, so there’s still time for thinking/designing.
It seems that the GNOME community has finally reached the long-awaited wide consensus about the future direction for the project. It’s all about tabs!
We’ve been discussing the issue here at GUADEC and it seems that manyguys really agree this is the path we want to follow. I am pretty sure the guys fromthe release team will just support it as well, as all the community is so excited by the new stuff that is happening that we really don’t want to stop the effort now.
Also, it seems that GTK+ will help us by providing a cool API for that, so let’s just make it happen!
This is the report for my fifth week of work in my SoC project.
This week I managed to dedicate three days of almost full-time hacking
on the project, and I almost completed the DBus interface.
== Work done this week ==
I splitted the MMApplication and MMCategory classes into abstract
interfaces, implemented by MMSoApplication/Category and
MMDBusApplication/Category. This was needed, as the implementation of
the methods which get the categories and the hits are very different. To
pass the objects (i.e. the filters and the hit collection) over the bus,
I serialized their members into a XML tree. So I spent some time
familiarizing with the libxml2 reader/writer API and finally wrote
methods that transform my objects into strings to be sent over DBus.
I also had to refactor some code into the Manager itself to make it more
DBus friendly. In the end, the DBus interface that an app should expose
is very simple:
- GetApplicationInfo, which returns the desktop id and the supported
- GetCategories, which returns two string arrays; one for the names and
the other for icon names
- GetHits, which takes as arguments the category name and a filter, and
returns a hit collection.
I am quite happy with the work so far, and I think I will have finished
a first implementation of the “backend” (i.e. non-UI) part by the next
week, just like I originally planned in my proposal!
== Work for the next week ==
I don’t know if I will be able to do much hacking next week, as on the
next Monday (July 7th) I’ll be leaving for GUADEC, in Istanbul and I
have to prepare many things. Though, there’s some things that I want to
- GErrorize the _unserialize () methods
- Write more tests for the DBus interface
- Re-read the code written so far and look for possible
- (optional) Try to implement the first widgets.
So I’m looking forward to meet everyone of you in Istanbul, I hope we’ll
have a great time!
Hi everyone, this is my report for the fourth week of coding for my SoC
This week hasn’t been as productive as the first three, as I have been
quite busy with some personal things.
== Work done this week ==
I spent quite some time on DBus: first reading the documentation and
learning the basics and then fighting to solve some nasty crashers in
the code I was writing.
In the end, I made a separate executable helper, mm-dbus-manager, whose
activation should be auto-activated on request (i.e. when the library
wants to know the applications registered on the DBus interface or
interact with them). The helper puts a manager on the bus, which takes
care of spawning the application-specific executables, which in turn
register themselves to the manager and should expose and implement the
methods of my interface.
The manager discovers the available application-specific executables by
looking for GKeyFiles installed in a known location.
Apart from setting this up, I spend some other time autofooizing the
whole project in a much nicer way; the test suite is getting better too,
and I also wrote tests for the DBus interface.
== Work for the next week ==
- Keep the work and hopefully finish the DBus parts (i.e. implement the
queriable interface and the serialization and deserialization of library
- (optional) Do the other tasks I had setup for this week and didn’t
have the time to do.
== Resources ==
As usual, you can find my work in my git repo tagged “week4″ now.
It seems this week I had fewer time than last week to work on the project, due to University, personal business and the talk I gave.
Anyway, I managed to complete almost all the tasks I set for this week, finishing a first implementation of the filtering API. The only thing I did not have time to fully write are proper tests for it, so do not expect it to work and shine yet
As always, you can grab a copy of the project from my git repository on repo.or.cz. I am making a tag each week, and tagged versions should be guaranteed to compile and run the included tests.
== Work for the next week ==
- Finish coding the tests and iron out some more the filtering API.
- Take some time to think about how object ownership works in the whole code I wrote and fix some leaks (if any).
- Implement a DBus interface.
- (optional) Try to think about a signal-enabled implementation of the HitCollection.