SpitAndPolish

Differences between revisions 29 and 30
Revision 29 as of 2008-06-18 14:21:52
Size: 11698
Editor: dslb-084-063-099-193
Comment:
Revision 30 as of 2008-08-06 16:40:29
Size: 11800
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
screenshot A (GTK+-theme-engine murrine with RGBA-support)[[BR]]
[http://people.ubuntu.com/~mmueller/spit-and-polish/murrine-rgba.jpg http://people.ubuntu.com/~mmueller/spit-and-polish/small_murrine-rgba.png]
screenshot A (GTK+-theme-engine murrine with RGBA-support)<<BR>>
[[http://people.ubuntu.com/~mmueller/spit-and-polish/murrine-rgba.jpg|{{http://people.ubuntu.com/~mmueller/spit-and-polish/small_murrine-rgba.png}}]]
Line 8: Line 8:
screenshot B (top-level window composited against desktop)[[BR]]
[http://people.ubuntu.com/~mmueller/spit-and-polish/authenticate-rgba.png http://people.ubuntu.com/~mmueller/spit-and-polish/small_authenticate-rgba.png]
screenshot B (top-level window composited against desktop)<<BR>>
[[http://people.ubuntu.com/~mmueller/spit-and-polish/authenticate-rgba.png|{{http://people.ubuntu.com/~mmueller/spit-and-polish/small_authenticate-rgba.png}}]]
Line 11: Line 11:
screenshot C (top-level window composited against desktop)[[BR]]
[http://people.ubuntu.com/~mmueller/spit-and-polish/logout-rgba.png http://people.ubuntu.com/~mmueller/spit-and-polish/small_logout-rgba.png]
screenshot C (top-level window composited against desktop)<<BR>>
[[http://people.ubuntu.com/~mmueller/spit-and-polish/logout-rgba.png|{{http://people.ubuntu.com/~mmueller/spit-and-polish/small_logout-rgba.png}}]]
Line 14: Line 14:
screenshot D (buttons composited against window-background)[[BR]]
[http://people.ubuntu.com/~mmueller/spit-and-polish/brasero-rgba.png http://people.ubuntu.com/~mmueller/spit-and-polish/small_brasero-rgba.png]
screenshot D (buttons composited against window-background)<<BR>>
[[http://people.ubuntu.com/~mmueller/spit-and-polish/brasero-rgba.png|{{http://people.ubuntu.com/~mmueller/spit-and-polish/small_brasero-rgba.png}}]]
Line 31: Line 31:
mockup of gnome-screensaver's unlock-dialog (already partly implemented)[[BR]]
[http://people.ubuntu.com/~mmueller/spit-and-polish/unlock-mockup.png http://people.ubuntu.com/~mmueller/spit-and-polish/small_unlock-mockup.png]
mockup of gnome-screensaver's unlock-dialog (already partly implemented)<<BR>>
[[http://people.ubuntu.com/~mmueller/spit-and-polish/unlock-mockup.png|{{http://people.ubuntu.com/~mmueller/spit-and-polish/small_unlock-mockup.png}}]]
Line 34: Line 34:
mockup of GTK+-widget menu[[BR]]
[http://people.ubuntu.com/~mmueller/spit-and-polish/menu-mockup.png http://people.ubuntu.com/~mmueller/spit-and-polish/small_menu-mockup.png]
mockup of GTK+-widget menu<<BR>>
[[http://people.ubuntu.com/~mmueller/spit-and-polish/menu-mockup.png|{{http://people.ubuntu.com/~mmueller/spit-and-polish/small_menu-mockup.png}}]]
Line 37: Line 37:
mockup of GTK+-widget combobox[[BR]]
[http://people.ubuntu.com/~mmueller/spit-and-polish/combobox-mockup.png http://people.ubuntu.com/~mmueller/spit-and-polish/small_combobox-mockup.png]
mockup of GTK+-widget combobox<<BR>>
[[http://people.ubuntu.com/~mmueller/spit-and-polish/combobox-mockup.png|{{http://people.ubuntu.com/~mmueller/spit-and-polish/small_combobox-mockup.png}}]]
Line 40: Line 40:
mockup of libgksu's authenticate-dialog (already implemented)[[BR]]
[http://people.ubuntu.com/~mmueller/spit-and-polish/authenticate-mockup.png http://people.ubuntu.com/~mmueller/spit-and-polish/small_authenticate-mockup.png]
mockup of libgksu's authenticate-dialog (already implemented)<<BR>>
[[http://people.ubuntu.com/~mmueller/spit-and-polish/authenticate-mockup.png|{{http://people.ubuntu.com/~mmueller/spit-and-polish/small_authenticate-mockup.png}}]]
Line 43: Line 43:
mockup of gnome-session's logout-dialog (already implemented)[[BR]]
[http://people.ubuntu.com/~mmueller/spit-and-polish/logout-mockup.png http://people.ubuntu.com/~mmueller/spit-and-polish/small_logout-mockup.png]
mockup of gnome-session's logout-dialog (already implemented)<<BR>>
[[http://people.ubuntu.com/~mmueller/spit-and-polish/logout-mockup.png|{{http://people.ubuntu.com/~mmueller/spit-and-polish/small_logout-mockup.png}}]]
Line 70: Line 70:
The most complete (only) RGBA-enabled GTK+-theme-engine at the time of this writing is murrine (see [http://people.ubuntu.com/~mmueller/spit-and-polish/murrine-rgba.jpg screenshot A]). While murrine itself does not need much more work, a freedesktop specification and a related tool need to be addressed before an engine like murrine can use RGBA-colormaps by default without any issues. The most complete (only) RGBA-enabled GTK+-theme-engine at the time of this writing is murrine (see [[http://people.ubuntu.com/~mmueller/spit-and-polish/murrine-rgba.jpg|screenshot A]]). While murrine itself does not need much more work, a freedesktop specification and a related tool need to be addressed before an engine like murrine can use RGBA-colormaps by default without any issues.
Line 72: Line 72:
The [http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.2.html freedesktop-specification for tray-icons] needs to be updated according to the proposal published [http://lists.freedesktop.org/archives/xdg/2007-March/007866.html here]. The [[http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.2.html|freedesktop-specification for tray-icons]] needs to be updated according to the proposal published [[http://lists.freedesktop.org/archives/xdg/2007-March/007866.html|here]].
Line 74: Line 74:
Once that's in place the GTK+-widget [http://library.gnome.org/devel/gtk/stable/GtkStatusIcon.html GtkStatusIcon] has to be updated to reflect those changes in the updated freedesktop-specification for tray-icons. Once that's in place the GTK+-widget [[http://library.gnome.org/devel/gtk/stable/GtkStatusIcon.html|GtkStatusIcon]] has to be updated to reflect those changes in the updated freedesktop-specification for tray-icons.
Line 76: Line 76:
The second issue needing attention is a graphical configuration tool for all the options and features murrine offers. Editing gtkrc files by hand isn't a very creative way for theme-authors and artist to create new looks for theme-engines. Therefore a solid GUI frontend with decent preview-functionality has to be written. There is a first effort going in that direction available [https://code.edge.launchpad.net/~gtkconf/murrine/murrine-configurator here]. The second issue needing attention is a graphical configuration tool for all the options and features murrine offers. Editing gtkrc files by hand isn't a very creative way for theme-authors and artist to create new looks for theme-engines. Therefore a solid GUI frontend with decent preview-functionality has to be written. There is a first effort going in that direction available [[https://code.edge.launchpad.net/~gtkconf/murrine/murrine-configurator|here]].
Line 82: Line 82:
 * [http://library.gnome.org/devel/gtk/stable/GtkEntry.html GtkEntry]  * [[http://library.gnome.org/devel/gtk/stable/GtkEntry.html|GtkEntry]]
Line 84: Line 84:
... you can see in the screenshot below how unaltered rendering of [http://library.gnome.org/devel/gtk/stable/GtkEntry.html GtkEntry]-widgets (on the left) exposes ugly non-transparent areas in the surrounding frame, while a fixed way of rendering the [http://library.gnome.org/devel/gtk/stable/GtkEntry.html GtkEntry]-widgets (on the right) correctly removes these opaque parts in the frame. ... you can see in the screenshot below how unaltered rendering of [[http://library.gnome.org/devel/gtk/stable/GtkEntry.html|GtkEntry]]-widgets (on the left) exposes ugly non-transparent areas in the surrounding frame, while a fixed way of rendering the [[http://library.gnome.org/devel/gtk/stable/GtkEntry.html|GtkEntry]]-widgets (on the right) correctly removes these opaque parts in the frame.
Line 86: Line 86:
[http://people.ubuntu.com/~mmueller/spit-and-polish/gtk-entry-rgba-issue http://people.ubuntu.com/~mmueller/spit-and-polish/small_gtk-entry-rgba-issue.png][[BR]] [[http://people.ubuntu.com/~mmueller/spit-and-polish/gtk-entry-rgba-issue|{{http://people.ubuntu.com/~mmueller/spit-and-polish/small_gtk-entry-rgba-issue.png}}]]<<BR>>
Line 88: Line 88:
The approach to this fix consists of a small patch in murrine's RGBA-related drawing-code for a [http://library.gnome.org/devel/gtk/stable/GtkEntry.html GtkEntry]-widget and redirecting the [http://library.gnome.org/devel/gtk/stable/GtkEntry.html GtkEntry] to an offscreen-buffer, clearing its background to be fully transparent in its expose-handler and finally compositing it onto the parent widget in the parent widgets expose-handler. In [http://people.ubuntu.com/~mmueller/spit-and-polish/authenticate-rgba.png screenshot B] you see that this also works with irregular backgrounds of the parent widget. The approach to this fix consists of a small patch in murrine's RGBA-related drawing-code for a [[http://library.gnome.org/devel/gtk/stable/GtkEntry.html|GtkEntry]]-widget and redirecting the [[http://library.gnome.org/devel/gtk/stable/GtkEntry.html|GtkEntry]] to an offscreen-buffer, clearing its background to be fully transparent in its expose-handler and finally compositing it onto the parent widget in the parent widgets expose-handler. In [[http://people.ubuntu.com/~mmueller/spit-and-polish/authenticate-rgba.png|screenshot B]] you see that this also works with irregular backgrounds of the parent widget.
Line 90: Line 90:
The visual glitch shown for [http://library.gnome.org/devel/gtk/stable/GtkEntry.html GtkEntry] is also exposed with... The visual glitch shown for [[http://library.gnome.org/devel/gtk/stable/GtkEntry.html|GtkEntry]] is also exposed with...
Line 92: Line 92:
 * [http://library.gnome.org/devel/gtk/stable/GtkComboBoxEntry.html GtkComboBoxEntry]  * [[http://library.gnome.org/devel/gtk/stable/GtkComboBoxEntry.html|GtkComboBoxEntry]]
Line 94: Line 94:
... but the approach used for [http://library.gnome.org/devel/gtk/stable/GtkEntry.html GtkEntry] to fix the rendering issue does not work in this case, because [http://library.gnome.org/devel/gtk/stable/GtkComboBoxEntry.html GtkComboBoxEntry] draws itself differently. How to fix it for [http://library.gnome.org/devel/gtk/stable/GtkComboBoxEntry.html GtkComboBoxEntry] has yet to be figured out fully. ... but the approach used for [[http://library.gnome.org/devel/gtk/stable/GtkEntry.html|GtkEntry]] to fix the rendering issue does not work in this case, because [[http://library.gnome.org/devel/gtk/stable/GtkComboBoxEntry.html|GtkComboBoxEntry]] draws itself differently. How to fix it for [[http://library.gnome.org/devel/gtk/stable/GtkComboBoxEntry.html|GtkComboBoxEntry]] has yet to be figured out fully.
Line 96: Line 96:
In addition to fixing the visual glitches for [http://library.gnome.org/devel/gtk/stable/GtkEntry.html GtkEntry] and [http://library.gnome.org/devel/gtk/stable/GtkComboBoxEntry.html GtkComboBoxEntry] the rendering of any kind of menu should be altered to allow slightly rounded corners - with matching drop-shadows - as well. In addition to fixing the visual glitches for [[http://library.gnome.org/devel/gtk/stable/GtkEntry.html|GtkEntry]] and [[http://library.gnome.org/devel/gtk/stable/GtkComboBoxEntry.html|GtkComboBoxEntry]] the rendering of any kind of menu should be altered to allow slightly rounded corners - with matching drop-shadows - as well.
Line 98: Line 98:
 * [http://library.gnome.org/devel/gtk/stable/GtkComboBox.html GtkComboBox]
 * [http://library.gnome.org/devel/gtk/stable/GtkMenu.html GtkMenu]
 * [[http://library.gnome.org/devel/gtk/stable/GtkComboBox.html|GtkComboBox]]
 * [[http://library.gnome.org/devel/gtk/stable/GtkMenu.html|GtkMenu]]
Line 101: Line 101:
These widgets should be rendered like show in the screenshot-mock up [http://people.ubuntu.com/~mmueller/spit-and-polish/menu-mockup.png here]. These widgets should be rendered like show in the screenshot-mock up [[http://people.ubuntu.com/~mmueller/spit-and-polish/menu-mockup.png|here]].

Summary

GTK+ supports RGBA-colormaps, which allow to improve the aesthetic looks of the UI, especially in combination with a composited environment (e.g. compiz, metacity with enabled compositor). RGBA-colormaps make it possible to composite child-widgets against their parents background. In addition to that it is also possible to composite top-level windows against the desktop or whatever window is stacked below it, if run under a composited environment. There are two common approaches to make use of this GTK+-feature. The first one is a GTK+-theme engine (e.g. murrine) drawing widgets by default with a RGBA-colormap and choose the opacity on a per-widget-basis. The most popular variation of this - under composited environments - is to have the top-level windows background to be slightly transparent (see screenshot A). The second approach, which also works without a RGBA-capable GTK+-theme, is to manually take care of the clearing and filling of a widgets background in its expose-handler (see screenshots B, C and D).

screenshot A (GTK+-theme-engine murrine with RGBA-support)
http://people.ubuntu.com/~mmueller/spit-and-polish/murrine-rgba.jpg

screenshot B (top-level window composited against desktop)
http://people.ubuntu.com/~mmueller/spit-and-polish/authenticate-rgba.png

screenshot C (top-level window composited against desktop)
http://people.ubuntu.com/~mmueller/spit-and-polish/logout-rgba.png

screenshot D (buttons composited against window-background)
http://people.ubuntu.com/~mmueller/spit-and-polish/brasero-rgba.png

This spec does not have a targetted release of Ubuntu and should rather be viewed as an on-going effort to improve the looks of the desktop in general. Not all mentioned improvements of UI-elements need to be implemented at once, although it would be nicer from a consistency point of view.

Release Note

Decoration-less popup-dialogs now use slightly rounded corners and subtle transparencies in order to make them visually more pleasing and provide a more consistent look in regards to enabled desktop-effects. Main application windows also have very light transparencies now as long as the application does not override this with custom drawing. These visual effects are only active, if desktop-effects are turned on. Also menus and comboboxes use slightly rounded corners to help unify the look of UI-elements.

Rationale

Unification of UI-elements across the desktop needs to be continued. Offering theme-artists and UI-designers greater flexibilty, makes their work more fun thus more productive. Increasing the visual attractiveness of the GNOME- and Ubuntu-desktop is of paramount importance, because users demand and expect good looking desktop-systems these days. Furthermore we need to stay competitive with offereings form other projects and vendors.

Use Cases

A list with dialogs and widgets that should make use of visual enhancements possible due to the use of RGBA-colormaps and a composited desktop (desktop-effects):

mockup of gnome-screensaver's unlock-dialog (already partly implemented)
http://people.ubuntu.com/~mmueller/spit-and-polish/unlock-mockup.png

mockup of GTK+-widget menu
http://people.ubuntu.com/~mmueller/spit-and-polish/menu-mockup.png

mockup of GTK+-widget combobox
http://people.ubuntu.com/~mmueller/spit-and-polish/combobox-mockup.png

mockup of libgksu's authenticate-dialog (already implemented)
http://people.ubuntu.com/~mmueller/spit-and-polish/authenticate-mockup.png

mockup of gnome-session's logout-dialog (already implemented)
http://people.ubuntu.com/~mmueller/spit-and-polish/logout-mockup.png

Design

There are three sections to address. First there are the decoration-less dialogs, which should be drawn with rounded corners - using roughly the same corner-radius as buttons of the set GTK+-theme do - and a slight transparency in the dialogs background. Then there is the GTK+-theme that needs to make use of RGBA-colormaps, thus a theme-artist can make consistent use of transparencies for certain widgets and application-developers can more easily handle RGBA-drawing without needing to do the needed boiler-plate code themselves. Lastly there are a few GTK+-widgets that need to be adjusted in the way they draw themselves to avoid visual glitches when rendered with RGBA-colormaps on non-opaque backgrounds.

Implementation

Decoration-less dialogs

Good examples for decoration-less dialogs are the unlock-dialog of gnome-screensaver, the logout-dialog of gnome-session and the authenticate-dialog of libgksu. The general approach here is to...

  • test if composited is available in the initialization part of the dialog
  • set a rgba-colormap for the main dialog-background
  • only if those two were successful connect a custom handler to its expose-event
  • increase the border-width of the corresponding widget a bit
  • in the custom expose-handler clear the background to fully be transparent
  • get the themes background-color of the normal-state of a widget
  • use that to draw a non-opaque rectangle with rounded corners (yay for cairo! Smile :)

  • draw your own drop-shadows, since neither compiz nor metacity (with enabled compositor) do that in this case
  • enjoy the new looks

This already works very well with the logout-dialog of gnome-session and the authenticate-dialog of libgksu. The unlock-dialog of gnome-screensaver is displayed on its own screen and is usually not composited. Therefore the proposed looks of the mockup above are not easily implemented and require some more work. For the moment only a plain RGB-colormap is used and the the rounded corners are achieved by clearing to opaque black and drawing on top of that.

GTK+-theme

The most complete (only) RGBA-enabled GTK+-theme-engine at the time of this writing is murrine (see screenshot A). While murrine itself does not need much more work, a freedesktop specification and a related tool need to be addressed before an engine like murrine can use RGBA-colormaps by default without any issues.

The freedesktop-specification for tray-icons needs to be updated according to the proposal published here.

Once that's in place the GTK+-widget GtkStatusIcon has to be updated to reflect those changes in the updated freedesktop-specification for tray-icons.

The second issue needing attention is a graphical configuration tool for all the options and features murrine offers. Editing gtkrc files by hand isn't a very creative way for theme-authors and artist to create new looks for theme-engines. Therefore a solid GUI frontend with decent preview-functionality has to be written. There is a first effort going in that direction available here.

GTK+-widgets

If widgets are drawn (composited) on top of non-opaque parent widgets, visual glitches are exposed in some cases due to the way certain widgets are drawn right now by upstream GTK+ and an RGBA-enabled theme-engine. For...

... you can see in the screenshot below how unaltered rendering of GtkEntry-widgets (on the left) exposes ugly non-transparent areas in the surrounding frame, while a fixed way of rendering the GtkEntry-widgets (on the right) correctly removes these opaque parts in the frame.

http://people.ubuntu.com/~mmueller/spit-and-polish/gtk-entry-rgba-issue

The approach to this fix consists of a small patch in murrine's RGBA-related drawing-code for a GtkEntry-widget and redirecting the GtkEntry to an offscreen-buffer, clearing its background to be fully transparent in its expose-handler and finally compositing it onto the parent widget in the parent widgets expose-handler. In screenshot B you see that this also works with irregular backgrounds of the parent widget.

The visual glitch shown for GtkEntry is also exposed with...

... but the approach used for GtkEntry to fix the rendering issue does not work in this case, because GtkComboBoxEntry draws itself differently. How to fix it for GtkComboBoxEntry has yet to be figured out fully.

In addition to fixing the visual glitches for GtkEntry and GtkComboBoxEntry the rendering of any kind of menu should be altered to allow slightly rounded corners - with matching drop-shadows - as well.

These widgets should be rendered like show in the screenshot-mock up here.

Migration

There will most certainly be legacy (GTK+-based) applications, which will crash or break in some kind of way, if RGBA-colormaps become the new default colormap of the used GTK+-theme. These need to be identified and fixed as soon as Ubuntu is able to ship a beta of a RGBA-enabled GTK+-theme. Those applications then need to be fixed upstream one at a time. Should the application in question be closed source its users have to switch back to a non-RGBA GTK+-theme. Or we could provide a wrapper start-script that could be used to disable the use of RGBA-colormaps by default, when such closed source legacy applications are started via the applications-menu.

Test/Demo Plan

It's important that we are able to test new features, and demonstrate them to users. Use this section to describe a short plan that anybody can follow that demonstrates the feature is working. This can then be used during testing, and to show off after release.

This need not be added or completed until the specification is nearing beta.


CategorySpec

DesktopTeam/Specs/SpitAndPolish (last edited 2008-08-06 16:40:29 by localhost)