My first (major) GTK+ patch

Matthias Clasen cleaned up and pushed my first major patch to GTK+ yesterday. It allows the underlines on menus and buttons to be hidden until the alt key is pressed, similar to behaviour seen on recent versions of Windows. It is configurable via GtkSettings and off by default.

I’d like to thank Matthias and Emmanuele Bassi for their help reviewing the patch and to Intel for allowing me to develop it at work (it was a requirement for Moblin from our illustrious interaction designer, Nick Richards).

The final menu behaviour is a little different from my original idea and I’ve attached a patch to the bug that implements my preferred behaviour. You can try out the new setting by grabbing GTK+ from git and adding gtk-auto-mnemonics=1 into your ~/.gtkrc-2.0 file.

Moblin UI Toolkit 0.3.0

A little bit earlier than previously advertised, today I have made version 0.3.0 of the Moblin UI Toolkit available.

Disclaimer

This is a development release. API and ABI are very likely to change. Compatibility with future and previous versions is not guaranteed. It has had only limited testing and there are unfinished features and plenty of bugs in this release. It should definitively not be used in production environments.

Changes

Here is the least of new features and fixes, from the NEWS file:

0.3.0

Changes since 0.2.0

  • New toolbar widget
  • Convert MxBin to abstract class
  • Add MxFrame as a drop-in replacement for plain instances of MxBin
  • Use the i-beam insertion mouse cursor in MxEntry
  • Clean up MxGrid API to be more consistent with other widgets
  • Add support for font-weight property to buttons and labels
  • Add animation layout support to MxBoxLayout
  • Add special styling for ComboBoxes inside a toolbar
  • Implement font styling in ComboBox
  • Fix expander label visibility
  • Add missing public headers and single include guards (Bastian Winkler)
  • Clean up various references to removed functions (Bastian Winkler)
  • Documentation improvements (Elliot Smith)

Sources

Sources are available from download.moblin.org:

http://download.moblin.org/sources/mx/0.3/

or from git:

http://git.moblin.org/cgit.cgi/mx/

git clone git://git.moblin.org/mx

Layout Animations in Clutter

I’ve been playing around with layout animations in Clutter recently and made a video of what I have achieved. Currently, Clutter has very good and understood support for animations using fixed positioning, but I wanted to experiment with animations inside a layout manager. After a lot of thought, the solution was simpler than I had imagined. In its current form, it involves storing the child allocations at the start of the animation and then simply calculating the children’s positions between the start and final destinations based on the alpha value from the timeline. Animation is disabled for most allocations, but is started by certain events such as changing child properties or orientation. The add and remove animations required some additional logic to make sure the new actor faded in once the animation had finished.

I made a video of MxBoxLayout that shows changing packing options (expand, fill and alignment) as well as adding and removing children, and changing orientation (the layout children are just ClutterRectangles):

The work is currently in a branch of the Moblin UI Toolkit repository (animated-box-layout) which I will merge once I have added an enable-animations property to the actor.

In other news, there is now a page on Moblin.org for the Moblin UI Toolkit, and I expect API reference documentation to be available on-line soon too. There is also a new component in Moblin bugzilla specifically for the new toolkit (under “Moblin Distribution”).

Festive Beers

With the festive season fast approaching, Hylke and I realised that we hadn’t had a GNOME beer event recently and that if we wanted to do one before the end of the year, it would have to be pretty soon. So, a little on the short notice side, is anyone up for beers in London next Friday (11th)? If so, drop your name onto the wiki page and we’ll see you then!

Moblin Toolkit 0.2.0

Yesterday I announced a new development snapshot of the Moblin Toolkit, along with a preliminary schedule. I’m hoping to be API and ABI stable by February and have the first stable release at the beginning of March.

We’re working on the bugzilla component, but for the moment issues should be reported in the “nbtk” component of bugzilla.moblin.org.

Quite a few people asked before about language bindings. I don’t anticipate supporting a lot of language bindings, but I will be ensuring GObject introspection works well. I hope that will help people generate any bindings they wish to use and keep them up to date with relative ease. Personally, I have already been using Javascript (via Gjs) to test some aspects of the project.

The interesting features in this release are:

  • “long-press” signal added to MxButton (inspired by the “touch-and-hold” discussion in Gnome bugzilla)
  • Added an “always-on-top” base class, which helps in creating the always-on-top actors such as tooltips and menus.
  • Improved error reporting and various other bug fixes

art.gnome.org updates

I poked around with art.gnome.org recently and added support for sorting backgrounds and themes by popularity. This throws up some interesting results, such as showing the XP look-a-like theme being the fourth most popular on the site.

Even more interestingly still, I hacked up support to allow most themes (gtk, metacity and icon themes) to be installed directly from the web page. This is achieved by setting the content-type to application/x-gnome-theme-package and allowing Firefox (or, I assume, any other web browser) to open the download with the default handler for this type, which is the Theme Installer. This ties in with the longer term plan we’re thinking of, which is to remove the extra themes from gnome-themes and place them (and more) on the website. Users would then install the themes straight from the theme manager or from a browser. Hylke’s already posted some mockups to the control center mailing list on what the new theme manager may look like.

Now, if only there was a nice way to set your desktop background from the browser, without going through right click menus…

A new Clutter Widget Toolkit

If you’ve been following Moblin development closely, you’ll know that we have been using a library called “Nbtk” (netbook toolkit) to implement the common user interface elements. People have been quite interested in this, since it is based on Clutter. However, Nbtk was developed with very short term goals, so that we could accomplish the Moblin 2.0 UI as quickly as possible. Now that Moblin 2.0 (and indeed, 2.1) is out, we have some time before 2.2 to start thinking about a more serious toolkit.

The Moblin Toolkit

The first goal was to rename the library to something less specific to the “netbook” platform. We chose ‘mx’ as the name space, because the goal of toolkit is to support the Moblin User Experience. Mx provides a set of standard user interface elements, including buttons, progress bars, tooltips, scroll bars and others. It also implements some standard layout managers, although some of these will be available in Clutter itself when Clutter 1.2 is available. One other interesting feature is the possibility of setting style properties from a css-like file.

What’s New

Followers of Nbtk will be interested to know what’s new compared to Nbtk. The latest additions include:

  • notebook – a multi-child container that shows only one child at a time (similar to a slide show). The notebook widget itself does not implement tabs, but these can easily be added by hooking it up to the new button-group widget.
  • button group – allows buttons to be grouped so that the toggle state can be mutually exclusive across the buttons in the group (e.g. such as a group of radio buttons might behave.). Also features a property to allow no buttons to be toggled if desired.
  • toggle widget – a widget that implements a boolean state and looks similar to a light switch or slider switch. This is a Clutter version of the MxGtkLightSwitch already available. The advantages of the Clutter version are that it provides better animated feedback on user interaction.

There have also been some behind the scenes clean ups, including:

  • re-written table layout algorithm – this had much better support for correct minimum and preferred sizes, especially related to columns spanning.
  • the stylable interface is now much simpler and has less dependencies
  • the Widget base class implements hover and active states (if the actor is reactive)
  • all constructors return ClutterActor, since this is the most useful base type.

Try It

Although the new project started as a branch in the Nbtk source code repository, it now has it’s own git repository at git.moblin.org. I am also making tarball releases on the brand new download.moblin.org. I have released a first version for testing purposes and it is important to note that the project is not API stable yet.

Fedora 12 Beta – First Impressions

A lot of blog posts about Fedora 12 recently. It’s been a while since I last tried Fedora, so I thought I’d try it out and post some of my thoughts.

Likes

  • Sweet KMS enabled boot screen – very nice
  • Yum is fast enough to be usable (but maybe that’s because of my quad core now?)
  • Custom icons for Documents/Downloads/Music/Videos etc
  • Installer re-assigned ownership attributes for old home directory. Very handy.
  • Clearlooks is the default theme (not Nodoka)
  • Control Center (Preferences) menu is no longer grouped by categories

Dislikes

  • Notifications (what is that horrible massive black square on my screen)
  • Package manager UI (often just too confusing, too animated, or too awkward)
  • Bluetooth keyboard didn’t work in the final setup screens (setting up username etc…)
  • Every other folder in Nautilus tells me I can share it using Personal File Sharing (well, at least $HOME and $HOME/Downloads – why would I want to share $HOME and why do I have to see this notice all the time?)
  • Doesn’t remember my preferred language (en_GB)

All in all, looking good apart from the few niggles I’m sure will be fixed before release. If anyone knows whether there is a meta-package to install enough packages to allow GNOME development (e.g. including gcc, intltool, libtool, gtk-doc, etc), that would be awesome.

Update: I just found sudo yum install @gnome-devel @development-tools via the Jhbuild page. It’s a start, but doesn’t include everything needed to build GTK+ for example. Shame the package manager UI doesn’t make this more obvious.

Unfortunately, I’m not going to file bugs just yet, because these are just my first impressions, and I’m not yet a Fedora user!

GNOME Beers/London

Luis Villa let us know he was in London this week and asked if anyone was up for a beer (a trick question perhaps?). More than happy to oblige, we’re going to meet up at our traditional haunt of Ye Olde Cheshire Cheese and then go on for pizza. I’ve put up the wiki page to let us know if you’re coming. All GNOME hackers/contributers/hangers-on welcome.

Toolbar Styles

We’ve been discussing the future of the Interface tab in the Appearance capplet, and we’d like to “fix” the default toolbar style before we consider any changes. It seems not many people are aware of what these styles actually look like, so to help I’ve done some screenshots:

Text Beside Icons (the proposed new default)
text-beside-icons

Text Below Icons (the current default)
text-below-icons

Icons Only
icons-only

Text Only
text-only

A trial switch to the text-beside-icons style is underway, so that we can test applications to make sure they work properly with this style. Discussion on any issues can be reported in bug 590143.

Personally, I think there are several advantages to the text-beside-icons mode:

* Increased hit area (fitts law) for important buttons
* Reduced vertical space usage (compared to text-below-icons)
* Reduced horizontal space usage in some applications (as compared to text-below-icons in e.g. Nautilus, Evolution)
* Aesthetically nicer than having text for every item