Difference between revisions of "Overrule Gramps Icons"

From Gramps
Jump to: navigation, search
(convert overruleicons)
 
(Overrule GTK icons)
Line 54: Line 54:
 
To overrule GTK icons, your theme must be correctly configured. The theme will normally map a set of gtk icons to theme icons. In eg the Tango icon set, a actions/gtk-copy.png icon is available. By replacing it you see it everywhere different.  
 
To overrule GTK icons, your theme must be correctly configured. The theme will normally map a set of gtk icons to theme icons. In eg the Tango icon set, a actions/gtk-copy.png icon is available. By replacing it you see it everywhere different.  
  
In KDE, if you use the GTK-QT-engine to make GTK apps look like QT apps, you can hack the .gtk_qt_engine_rc file in your home directry.  The variable ''pixmap_path'' sets the absolute path where icons can be found, and eg  
+
In KDE, if you use the GTK-QT-engine to make GTK apps look like QT apps, you will note that this does not work 100%. '''Patches have been accepted in GTK-QT to make it work, version > 0.7'''. <br \>
 +
If you have version <= 0.7 you can hack the .gtk_qt_engine_rc file in your home directory to make it work.  The variable ''pixmap_path'' sets the absolute path where icons can be found, and eg  
 
  <nowiki>stock["gtk-bold"]={
 
  <nowiki>stock["gtk-bold"]={
 
{ "22x22/actions/text_bold.png", *, *, "gtk-large-toolbar" },
 
{ "22x22/actions/text_bold.png", *, *, "gtk-large-toolbar" },

Revision as of 12:49, 20 August 2007

Making custom icons for use in GRAMPS

Why do this

The GRAMPS icon style is based on the Tango guidelines. If you use a different icon set, this might not fit in well. Normally the GTK stock icons should be taken from the theme you use, so paste, edit, add, ... should be conform. You can overrule those too however.

Overruling GRAMPS icons, with fallback

The following is for upcoming version 2.4. Suppose you use the Buuf icon theme, and want to make your own custom gramps icons. Then do the following:

Preparation

  • In directories Buuf/16x16, Buuf/22x22, and Buuf/scalable, add the directory gramps.
  • In these created gramps directories, make the icons with the corresponding sizes (scalable is for svg icons of size 48x48px), for the gramps icons you want to overrule. Give the icons the correct gramps name, see GRAMPS icon set.

Overruling

To make GRAMPS use these icons, save a backup of gramps_main.py and then open gramps_main.py. Change the following codelines, using the correct path names on your system:

iconpaths = [
                   (os.path.join(const.image_dir,'scalable'),'.svg'),
                   (const.image_dir,'.svg'), (const.image_dir,'.png'),
                   ]

must be changed into:

iconpaths = [
                    ('/path_to_buuf/Buuf/scalable/gramps','.svg'),
                   (os.path.join(const.image_dir,'scalable'),'.svg'),
                   (const.image_dir,'.svg'), (const.image_dir,'.png'),
                   ]

and

extraiconsize = [
                   (os.path.join(const.image_dir, '22x22'),
                           gtk.ICON_SIZE_LARGE_TOOLBAR),
                   (os.path.join(const.image_dir, '16x16'),
                           gtk.ICON_SIZE_MENU),
                   (os.path.join(const.image_dir, '22x22'),
                           gtk.ICON_SIZE_BUTTON),
                   ] 

into

extraiconsize = [
                   (os.path.join(const.image_dir, '22x22'),
                           gtk.ICON_SIZE_LARGE_TOOLBAR),
                   (os.path.join(const.image_dir, '16x16'),
                           gtk.ICON_SIZE_MENU),
                   (os.path.join(const.image_dir, '22x22'),
                           gtk.ICON_SIZE_BUTTON),
                   ('/path_to_buuf/Buuf/22x22/gramps',
                           gtk.ICON_SIZE_LARGE_TOOLBAR),
                   ('/path_to_buuf/Buuf/22x22/gramps', 
                           gtk.ICON_SIZE_BUTTON),
                   ('//path_to_buuf/Buuf/16x16/gramps', 
                           gtk.ICON_SIZE_MENU),
                   ]

Your own icons are now visible in gramps. You could off course replace the gramps icons in the images directory too, but the above method has less risk of deleting icons by error.

Overrule GTK icons

To overrule GTK icons, your theme must be correctly configured. The theme will normally map a set of gtk icons to theme icons. In eg the Tango icon set, a actions/gtk-copy.png icon is available. By replacing it you see it everywhere different.

In KDE, if you use the GTK-QT-engine to make GTK apps look like QT apps, you will note that this does not work 100%. Patches have been accepted in GTK-QT to make it work, version > 0.7.
If you have version <= 0.7 you can hack the .gtk_qt_engine_rc file in your home directory to make it work. The variable pixmap_path sets the absolute path where icons can be found, and eg

stock["gtk-bold"]={
	{ "22x22/actions/text_bold.png", *, *, "gtk-large-toolbar" },
	{ "32x32/actions/text_bold.png", *, *, "gtk-dnd" },
	{ "32x32/actions/text_bold.png", *, *, "gtk-dialog" },
	{ "16x16/actions/text_bold.png", *, *, "gtk-button" },
	{ "16x16/actions/text_bold.png", *, *, "gtk-menu" },
	{ "16x16/actions/text_bold.png", *, *, "gtk-small-toolbar" },
	{ "22x22/actions/text_bold.png" }
 }

shows how to find the gtk icon gtk-bold, and with which sizes. This can be easily changed to your liking. If you make an error, delete the file and restart GRAMPS. The gtk-qt-engine will recreate it (on font/icon set change the file is also regenerated, so keep a backup of your changes to the file).