Ask the Expert

Why does Mozilla look different on some apps?

Why does Mozilla look different to other GNOME and Gtk-based applications?

    Requires Free Membership to View

Any X11 and Gtk-based program can set the colours used in its windows. If a program wants to fit in with the rest of the desktop, though, then it has to use the system of theme engines that Gtk supports. A theme engine serves up skinning information to any program smart enough to take advantage of it. Since the skinning information is the same for all theme-engine enabled programs, all such programs have some common visual elements.

In the Mozilla case, two theme engines are at work. There's the Gtk system, and then there's Mozilla's own skinning system, also called themes. The Mozilla theme engine is responsible for Mozilla-specific skins like Classic and Modern, as well as third party skins like SkyPilot. Each of these skins uses a generally fixed set of colours and images. To the Gtk theme engine, these Mozilla skins look like static information, so the theme engine adds nothing.

Mozilla's themes are built using CSS, and Mozilla has a new CSS style property called -moz-appearance. This extension forces Mozilla to consult the native theme engine (on Linux, the Gtk one) for skin information. By creating a Mozilla skin that makes use of this extension, the native theme information can "shine through" into Mozilla windows. In fact, the Classic skin uses -moz-appearance in several places, particularly in form elements and in scrollbars.

The Classic skin also sets some colours and images directly, in order to be familiar to older Netscape 4.x users. So there isn't a skin that perfectly shows the underlying Gtk theme yet. In fact, native theme support is only 95% ready in Mozilla at this time. We're not far away, though, from being able to create a Transparent skin that uses -moz-appearance across the whole range of GUI widgets. Mozilla currently relies on the Gtk 1.2 libraries. Many GNOME programs use Gtk 1.2, so that's not a big deal. When Gtk 2.0 is supported though, Mozilla will come even closer to the look and feel of other GNOME tools.

This was first published in March 2004

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: