• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

demo/H03-May-2022-3,7232,000

rc/H03-May-2022-669552

special-icons/H03-May-2022-

src/H03-May-2022-39,95822,094

AUTHORSH A D17-Feb-2014193 75

COPYINGH A D17-Jan-201425.9 KiB511422

DoxyfileH A D17-Jan-201463.9 KiB1,5521,110

INSTALLH A D22-Oct-20142.1 KiB5236

READMEH A D22-Oct-201414.8 KiB270187

TODOH A D22-Oct-20141.8 KiB5236

cmake_uninstall.cmake.inH A D17-Jan-20141.1 KiB2926

config.h.cmakeH A D22-Oct-20141.6 KiB4739

README

1Oxygen-Gtk is a port of the default KDE widget theme (Oxygen), to gtk.
2
3It'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.
4
5Unlike 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.
6
7Contents:
8---------
9
10I. Introduction
11
12II. Install
13
14III. Hacks
15III.1 ARGB support
16III.2 DBus support
17III.3 Window grabbing
18III.4 Window background
19III.5 GtkTreeView
20III.6 GtkScrolledWindow
21III.7 Button order in dialogs
22III.8 Mouse-over support
23III.9 Tab close buttons
24III.10 Combobox list resize
25III.11 Inner shadows
26
27IV. Technical details
28IV.1 Directories
29IV.2 Some details on some files in src
30IV.3 Some details on some files in animations
31
32V. Example configuration (aka: how to select the oxygen-gtk style)
33
34VI. How to determine oxygen-gtk version
35
36I. introduction
37---------------
38
39Oxygen-Gtk is a port of the default KDE widget theme (Oxygen) to GTK.
40
41Its primary goal is to ensure visual consistency between gtk-based 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.
42
43Unlike 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.
44
45II. install
46-----------
47see the INSTALL file in top-level directory
48
49III. Hacks
50----------
51This section describes some of the hacks we used in oxygen-gtk to make the style match its Qt/Kde counterpart better.
52These details are given here because:
53
54- they might cause crashes or rendering glitches for some apps (at least until we fix it, once aware of it)
55- they might cause some widgets to behave differently from what application designers might have expected
56
57III.1 ARGB support
58------------------
59
60Oxygen-gtk renders menus tooltips, drowdown lists, using ARGB (semi-transparent) colormaps. This is needed to have nice non-pixelated rounded corners, as in Oxygen-Qt, and semi-transparent background for tooltips, when compositing is enabled.
61
62Since release 1.0.2, only the colormap for the windows corresponding widgets mentionned above are modified. The colormap for all other windows (notably main windows and dialogs), are unchanged. Unlike with previous relieses of Oxygen-gtk, this now works for 99% of the applications (with firefox and company being the only exception we are aware of).
63
64In case this still causes issues (typically: crashes, or menus not being rendered properly) for applications that we have not tested, we provide a way to black-list applications (so that ARGB support is not enabled).
65
66The full list of black-listed applications is in rc/argb-apps.conf, and is usually installed at:
67
68  /usr/share/themes/oxygen-gtk/gtk-2.0/argb-apps.conf
69
70There is also a per-user config file usually in
71
72  $HOME/.config/oxygen-gtk/argb-apps.conf
73
74This file will be parsed AFTER the system-wide one, thus allowing the user to override SOME or ALL of the rules set in the system-wide file. I.e., using "disable:all" as a first statement in the per-user config file will make system-wide one inactive.
75
76It can be edited by the user to add (or remove) new applications in case we overlooked some.
77The syntax used to add/remove an application in the black-list is described in the argb-apps.conf file.
78When there is a need to add new applications, user should also post it in this bug: https://bugs.kde.org/show_bug.cgi?id=260640 so that it also gets added in the distributed code.
79
80There are some environment variables to help debug ARGB hack:
81
82  OXYGEN_DISABLE_ARGB_HACK - set it to 1 to check if app will crash without the hack. Oxygen-GTK will print app name to report.
83  OXYGEN_ARGB_DEBUG - set it to 1 to print all debug information concerning ARGB hack (mainly to debug blacklist logic).
84  OXYGEN_DISABLE_INNER_SHADOWS_HACK - set it to 1 to disable inner shadows hack, which might make some widgets render in a wrong way or not render at all
85
86III.2 DBus support
87------------------
88Provided that dbus-glib-1 is found on the system, oxygen-gtk is compiled with DBus support. This allows gtk applications to be updated automatically when kde (or oxygen) configuration is changed. This covers:
89- changing the color scheme
90- changing icon theme and sizes
91- changing oxygen style options, like the number and position of scrollbar arrows
92- ...
93
94The style still compiles (and runs) when dbus support is not found, but the feature above is missing, naturally.
95
96So far we have encountered no issue with this feature.
97
98III.3 Window grabbing
99---------------------
100
101Oxygen-gtk supports the oxygen-qt feature that one can grab a window from any empty area and move it around as one usually does from the window decoration. The detection of 'empty' areas is quite tedious, but works well for all the applications we have tested so far. It is based mostly on main windows (or dialogs) recieving mouse button press/release events, assuming that no other child widget had any use of such events and thus allowing oxygen-gtk to use such events for moving the window.
102
103It might unfortunately happen that some widgets (so far unknown to us) make use of a mouse button press/release events and still pass them to their parent window, in which case the window-grab feature will conflict with the widget's usage of the event.
104
105If this happens, user should
106- disable window-grab (using the oxygen-qt's configuration tool; called 'oxygen-settings'), to be able to still use the faulty application
107- file a bug report and wait for the bug to be fixed.
108
109III.4 Window background
110-----------------------
111
112Oxygen uses gradients for windows and menus background (there is a linear vertical gradient, and a radial gradient at the center of the window's top part) that match the window decoration's background. Some widgets however, paint their own flat background, without any possibility for the style to overwrite these, which results in plain flat squares being painted in the middle of the otherwise well-matched background.
113
114Unfortunately in most cases, there is not much we can do about it. This is most likely either a missing feature on the gtk style (letting the style render the widget's background), or an ill-design of the widget itself.
115
116III.5 GtkTreeView
117-----------------
118
119Tree-lines are rendered by default on all tree-views (unless it is disabled in oxygen-qt's configuration tool).
120However, in order to have 'solid' grey lines instead of dotted black lines (provided by Gtk, with no way for the style to change it), we completely rewrote the tree-line drawing code (and disabled Gtk's equivalent code). This also allowed us to change the placement of the tree expander and the lines, so that they match Qt.
121So far we have encountered no issue with this feature.
122
123III.6 GtkScrolledWindow
124-----------------------
125
126For scrolled windows that contain a GtkTreeView, we force the frame to be sunken. This is consistent with Qt, and allows us to properly render mouse-over and focus effects on such lists. There might be some specific widget's layouts however for which this results in rendering glitches (for instance, two sunken frames one embedded in the other). If you observe such things, please report and we'll fix.
127
128III.7 Button order in dialogs
129-----------------------------
130
131We changed the button order in dialogs so that it matches the Qt convention. Notably, "accept" buttons are usually located 'left-of' "cancel" buttons. This choice was driven to improve consistency accross applications, although it might disorient Gnome users.
132
133III.8 Mouse-over support
134------------------------
135
136We added mouse-over support (that is: highlight when mouse pointer enters the widget) for a number of widgets for which gtk did not support it. This is notably the case for: GtkTreeView, GtkEntry, GtkNoteBook. This is achieved by watching enter/leave and mouse-move events for such widgets and some of their children. To our knowledge there is no remaining issue with this feature.
137
138III.9 Tab close buttons
139-----------------------
140
141GTK notebook doesn't provide a standard way for apps to put close buttons on tabs. Because of this, close buttons in different apps are implemented differently. Oxygen-gtk hides such buttons' icons/text, and draws Qt close button images instead. But there's no way of detecting if the button is really _close_ one. So, current implementation may break apps which have some additional buttons in the tabs. If you find such apps with multiple buttons on single tab (which all look like close buttons) when using oxygen-gtk, file a bug report.
142
143III.10 Combobox list resize
144---------------------------
145
146We haven't figured out any way to draw combobox button glow outside of the button widget, so the button is drawn reduced by glow dimensions. This leads to combobox list not match button in size (it's 6px wider than the button). To make popped-up combobox look nicer, we resize it on each popup.
147This may result in flicker, so if it's undesirable, this hack can be disabled this in CMakeLists.txt: set ENABLE_COMBOBOX_LIST_RESIZE to 0 instead of default 1.
148
149III.11 Inner shadows
150--------------------
151
152To implement inner shadows so that they get inside their child windows, we make children windows composited (gdk_window_set_composited()).
153This may lead to inexpected effects such as not rendered (or rendered as garbage) children of GtkScrolledWindow and GtkViewport.
154Currently no such problems are known.
155To disable this hack, set ENABLE_INNER_SHADOWS_HACK to 0 in CMakeLists.txt.
156
157Note: this feature requires gtk version 2.24.2 or later.
158
159
160IV. Technical details
161---------------------
162
163Oxygen-Gtk is written in c++ (but makes only 'c' style calls to Gtk methods).
164This section provides some details about the files and classes structure of oxygen-gtk.
165
166IV.1. Directories:
167------------------
168
169rc/ contains 'default' configuration files
170src/ contains all the source code.
171src/animations/ contains code needed for hover/focus effects, and will contain code for smooth animations.
172It connects to various widgets signals and events to setup and trigger widget updates when appropriate conditions are fullfilled.
173
174IV.2. Some details on some files in src/
175----------------------------------------
176
177oxygenrcstyle:
178oxygenstylewrapper:
179are the core gtk style files. Oxygenstylewrapper wraps all gtk painting calls to oxygenstyle singleton painting class.
180
181oxygenstyle:
182does all the painting, as called by oxygenstylewrapper
183
184oxygenstylehelper:
185contains some lower level painting classes, that depend on cairo context, and not on gtk windows/widgets any more. It is also responsible for generating the tilesets.
186
187oxygentileset:
188stores 3x3 pixmap array to handle scalable widgets, similar to what KDE/plasma does (as well as oxygen-qt)
189These tilesets are cached using home-made stl-based cache containers can be cached.
190
191oxygenwindowmanager: handles window grabbing
192
193oxygenrgba:
194stores rgba color representation and has some conversion utility functions, mostly imported from KDE/Qt.
195
196oxygencolorutils:
197all color handling, used to shade, mix, blend, etc. It is based on code in oxygen-qt and kde/kdelibs/kdeui kcolorutils and kcolorscheme.
198
199oxygenpalette:
200internal storage of colors. It extends the colors used by gdk and passed via gtkstyle
201
202oxygenqtsettings:
203does all the handling of Qt/Kde options, and conversion to gtk options where needed
204
205oxygengtkicons:
206is responsible for mapping/replacing gtk icons by oxygen icons. This is largely inspired from QtCurve-gtk
207
208utility files/classes:
209oxygengeometry.h: some low-level geometry classes
210oxygencairocontext: a self-freed wrapper around cairo_context_t;
211oxygencairopattern: a self-freed wrapper around cairo_pattern_t;
212oxygencache: some stl based implementation of a fifo cache and a mru cache;
213oxygencairoutils: some cairo/gdk-cairo utilities
214oxygengtkdetail: wrapper around the 'detail' strings passed to painting routines
215oxygengtkutils: some widget/window ancestry tree navigation utility functions.
216oxygenflags: generic utility class to handle enumeration based bit patterns, inspired from the QFlag Qt class.
217oxygentaboptions: stores options relevant for tab rendering in notebooks.
218oxygenstyleoptions: stores generic options for widget rendering, based on their state, shadow, etc.
219
220IV.3. some details on some files in animations/
221-----------------------------------------------
222
223All types of animations (mostly mouse-over effects for the moment) have two classes:
224- a Data class, that stores widget specific information on a per widget basis
225- an Engine class, that collects all Data objects and map them to their matching GtkWidget. When a GtkWidget is destroyed, the corresponding entry in the map is removed.
226
227All engines are stored inside the oxygenanimations class, and owned by it.
228All engines must derive from Oxygen::BaseEngine, to be stored inside Animations.
229For convenience and to minimize redundant code, an Oxygen::GenericEngine class is used as a base class for most engines.
230
231For a "Data" object to be used in an engine, it must contain a "::connect(GtkWidget*)" and a "::disconnect(GtkWidget*)" class.
232These two methods are responsible for the initialization and clean-up of the Data object.
233
234utility files/classes:
235oxygendatamap:
236keeps track of association between widgets and data objects. It also keeps track of the last accessed widget, in case it is re-used immediately; for optimization.
237
238oxygentimer:
239a convenience class to handle delayed actions.
240
241oxygensignal:
242a convenience class to handle signal/callback connections and disconnections.
243
244V. Example configuration (aka: how to select the oxygen-gtk style)
245------------------------------------------------------------------
246Below is a 'sample' .gtkrc-2.0 file used to select oxygen-gtk for a style.
247For kde users this should be copied to $HOME/.gtkrc-2.0-kde
248For others, in $HOME/.gtkrc-2.0 (or make a soft-link to the file above).
249It is provided here without any warranty, and users should backup their old config file before modifying.
250It is unclear whether this file will work for all configurations, all desktop environments and all systems (your distribution and DM would know better). On the other hand it has worked (by experience) in many cases.
251
252----- begin of file ------
253include "/usr/share/themes/oxygen-gtk/gtk-2.0/gtkrc"
254
255style "user-font"
256{
257	font_name="Sans Serif"
258}
259widget_class "*" style "user-font"
260
261gtk-theme-name="oxygen-gtk"
262gtk-font-name="Sans Serif 8"
263----- end of file -----
264
265VI. How to determine oxygen-gtk version
266---------------------------------------
267If you have installed oxygen-gtk from source, then deleted the sources, you can still determine oxygen-gtk version when needed using either of these commands:
268oxygen-gtk-demo --version
269oxygen-gtk-deco --version
270