Difference between revisions of "GTK2"

From GnuCash
Jump to: navigation, search
m (GTK2, [Category:GTK])
m (use {{GitURL}})
 
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The GnuCash 2.x series is using GTK2 for its GUI. This page collects informations to facilitate the first steps in improving the GnuCash GUI.
+
[[Category:GTK]]
 +
GnuCash '''version 2''' used GTK2 for its GUI. With version 3.0, GnuCash has upgraded to the [[GTK3]] library.
 +
 
 +
GTK uses ''resource files'' to control the appearance of GnuCash. Resource file locations can be found at [[Configuration_Locations#GTK_CONFIG_HOME|GTK Configuration Home]] , while the filenames can be found at [[Configuration_Locations#In_GTK_CONFIG_HOME|Resource file names]].
 +
 
 +
It is important to note that the resource files are not created by default, and a user may need to create the appropriate files using a text editor.
 +
;See also: [[:Category:Building]], [[:Category:Installation]], [[:Category:Releases]], and [[:Category:Tools]].
 +
 
 +
=Tools=
 +
How a user changes the appearance of GnuCash varies by platform.
 +
 
 +
;Windows:Users can use the ''Select Theme'' tool installed with GnuCash. This can be further modified by manually editing the appropriate resource file as identified at [[Configuration_Locations#In_GTK_CONFIG_HOME|Resource file names]]. Note that manual edits can get overwritten by subsequent use of the ''Select Theme'' tool.
 +
 
 +
;Linux:Most desktop environments have a module in ''System Settings'' to adjust the general appearance of Gnome and all GTK apps. For application specific settings they have to modify their resource files directly using a text editor.
 +
 
 +
;MacOS:Users edit the resource files directly using a text editor.
 +
 
 +
=Examples=
 +
A sample GTK resource file for GTK2 is available at: [{{GitURL}}/gnucash/blob/2.6.21/doc/gtkrc-2.0.gnucash GTK resource file example].
 +
 
 +
==Toolbar Items==
 +
Here is an example that sets how toolbar items display:
 +
 
 +
<tt><syntaxhighlight lang="ini">gtk-toolbar-style = GTK_TOOLBAR_ICONS</syntaxhighlight></tt>
  
== Where are the source files? ==
+
The possible values are:
The bad news: they are spread over the whole source tree - each module has its own files. But they have the suffix <tt>.glade</tt> and reside usually in a directory <tt>gtkbuilder</tt> below a directory containing <tt>gnome</tt> in its name.
+
:;GTK_TOOLBAR_ICONS: icons only
 +
:;GTK_TOOLBAR_TEXT: text only
 +
:;GTK_TOOLBAR_BOTH: icons and text below
 +
:;GTK_TOOBLAR_BOTH_HORIZ: icons and text aside
  
They are xml files and you can work on them with <tt>glade3</tt>.
+
:;Note: This option is no longer supported by [[GTK3#Labels of Toolbar Buttons|GTK3]].
  
== Tutorials ==
+
==Register Appearance==
:[https://developer.gnome.org/gtk-tutorial/stable/ gtk-tutorial]
+
The GnuCash registers use a yellow/green theme by default for register windows. Users must disable this default theme in order to change register appearance.  
:Relations glade - gazpacho - stetic - libglade: http://tadeboro.blogspot<dot>com/2009/07/glade-gazpacho-stetic-libglade.html
 
:glade >=3.6 tutorial: http://tadeboro.blogspot<dot>com/2009/09/glade3-tutorial-1-introduction.html
 
  
----
+
To override this, one first has to disable this custom theme by enabling "Don't use GnuCash built-in colors" in the GnuCash Preferences.
[[Category:GTK]]
+
 
 +
GnuCash will now use the default system theme (or more precisely the default GTK theme for your system) for all styling. The system theme can be overridden by creating a custom GTK configuration file following [[Configuration Locations|these guidelines]].
 +
 
 +
Then create or change the GTK resource file for further styling tweaks.
 +
 
 +
For making changes to the register colors and fonts, you can copy the [{{GitURL}}/gnucash/blob/2.6.19/doc/gtkrc-2.0.gnucash#L129 Register - Font section] and the [{{GitURL}}/gnucash/blob/2.6.19/doc/gtkrc-2.0.gnucash#L138 Register Window - Colors section] to your own GTK resource file and adjust to taste.

Latest revision as of 20:25, 16 November 2022

GnuCash version 2 used GTK2 for its GUI. With version 3.0, GnuCash has upgraded to the GTK3 library.

GTK uses resource files to control the appearance of GnuCash. Resource file locations can be found at GTK Configuration Home , while the filenames can be found at Resource file names.

It is important to note that the resource files are not created by default, and a user may need to create the appropriate files using a text editor.

See also
Category:Building, Category:Installation, Category:Releases, and Category:Tools.

Tools

How a user changes the appearance of GnuCash varies by platform.

Windows
Users can use the Select Theme tool installed with GnuCash. This can be further modified by manually editing the appropriate resource file as identified at Resource file names. Note that manual edits can get overwritten by subsequent use of the Select Theme tool.
Linux
Most desktop environments have a module in System Settings to adjust the general appearance of Gnome and all GTK apps. For application specific settings they have to modify their resource files directly using a text editor.
MacOS
Users edit the resource files directly using a text editor.

Examples

A sample GTK resource file for GTK2 is available at: GTK resource file example.

Toolbar Items

Here is an example that sets how toolbar items display:

gtk-toolbar-style = GTK_TOOLBAR_ICONS

The possible values are:

GTK_TOOLBAR_ICONS
icons only
GTK_TOOLBAR_TEXT
text only
GTK_TOOLBAR_BOTH
icons and text below
GTK_TOOBLAR_BOTH_HORIZ
icons and text aside
Note
This option is no longer supported by GTK3.

Register Appearance

The GnuCash registers use a yellow/green theme by default for register windows. Users must disable this default theme in order to change register appearance.

To override this, one first has to disable this custom theme by enabling "Don't use GnuCash built-in colors" in the GnuCash Preferences.

GnuCash will now use the default system theme (or more precisely the default GTK theme for your system) for all styling. The system theme can be overridden by creating a custom GTK configuration file following these guidelines.

Then create or change the GTK resource file for further styling tweaks.

For making changes to the register colors and fonts, you can copy the Register - Font section and the Register Window - Colors section to your own GTK resource file and adjust to taste.