Uniform Look for QT and GTK Applications
From FrugalWiki
Dansk – Deutsch – English – Español – Français – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Polski – Português – Română – Slovenský – Suomi – Svenska – Türkçe – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어
Contents |
Introduction
Qt- and GTK+ -based programs both use a different widget toolkit to render the graphical user interface. Each come with different themes, styles and icon sets by default, among other things, so the "look and feel" differ significantly. This article will help you make your Qt and GTK+ applications look similar for a more streamlined and "integrated" desktop experience.
"Qt (pronounced "cute") is a cross-platform application development framework, widely used for the development of GUI programs (in which case it is known as a Widget toolkit), and also used for developing non-GUI programs such as console tools and servers."
- Theme - Collection of a style, an icon theme and a colour theme.
- Style - Graphical layout; look.
- Icon Theme - Set of global icons.
- Colour Theme - Set of global colours that are used in conjunction with the style.
Styles for both Qt and GTK+
There are widget style sets available for the purpose of integration, where builds are written and provided for both Qt and GTK+, all major versions included. With these, you can have one look for all applications regardless of the toolkit they had been written with.
KDE4 Oxygen
Oxygen is the QT4 style that installs with KDE4.
There's also a GTK+ version called oxygen-molecule. It's goal is to provide a uniform look for GTK+ applications when used under the KDE desktop environment, by using gtk-engine-pixbuf.Download oxygen-molecule from KDE-look for further documentation and variations.
Another GTK+ port is in the oxygen-gtk. It's primary goal is to ensure visual consistency between gtk and qt-based applications running under kde. A secondary objective is to also have a stand-alone nice looking gtk theme that would behave well on other Desktop Environments. Unlike other attempts made to port the kde oxygen theme to gtk, this attempt does not depend on Qt (via some Qt to Gtk conversion engine), nor does render the widget appearance via hard coded pixmaps, which otherwise breaks everytime some setting is changed in kde.
QtCurve
Available for qt4 (kde4), qt3 (kde3), and gtk2 (gnome) in the repository, this highly-configurable style is the most popular all-rounder. It has many controls for various options, ranging from the appearance of buttons to the shape of sliders. You can install all of them using pacman.
Others
Similar style sets are those that look like each other - written and provided for both Qt and GTK+ - but are not necessarily from the same developers. You may have to do some minor tweaking to make them look the same. Below is a list:
- klearlooks (qt3); clearlooks (gtk2)
How do I set styles for each toolkit?
You can use the following methods to change the theme used in each environment.
QT4 styles
- Using KDE4 System Settings (/usr/bin/systemsettings)
- --> Common Appearance and Behavior --> Application Appearance --> Style --> Widget Style
- Qt Configuration (/usr/bin/qtconfig)
- --> Appearance --> Select GUI Style
GTK2 styles
- gtk-kde4 (allows you to change style and font of GTK applications in KDE4)
- lxappearance (a DE independent configuration tool from the LXDE project, which does not require any other parts of LXDE)
- Manual configuration
aMSN GTK or KDE dialogs
aMSN's TK file dialogs are plain looking but no fear there is a plugin that will allow you to use GTK or KDE file dialogs to match your desktop. You can find the plugin on aMSN's Plugin Page
Using custom GTK style
You can use custom styles for specific GTK2 applications. For this, use GTK2_RC_FILES=/path/to/theme/gtk-2.0/gtkrc appname
For example:
GTK2_RC_FILES=/usr/share/themes/QtCurve/gtk-2.0/gtkrc firefox
It will launch firefox with QtCurve theme.