Patches for cool border thicknesses



Hi all:

I started developing a new theme some days ago, and found I needed to
set different border thicknesses for different widget classes.
Looking at the stuff in gtkstyle.c, I realized the only way to do that
was by creating many instances of GtkStyleClass, but that looked to me
like an ugly hack.

So I decided to hack Gtk+ a bit to allow for changing border
thicknesses the easy and cool way.  I barely did the following:

- Move the xthickness and ythickness fields from GtkStyleClass to
  GtkStyle.  I know this breaks source compatibility somewhat
  (programs are usually easy to fix, though) but GtkStyle really seems
  to be the right place for them to be.

- Add support to gtkrc.c to add two fields, xthickness and ythickness,
  to the rc files.  This way it is possible to specify styles like
  
	style "verythick"
	{
	  xthickness = 10
	  ythickness = 15
	}

  that make widgets they are applied to, have vertical borders of
  width 10 and horizontal borders of width 15.

- Fix many widgets so that border thicknesses really work.  When I
  tested things with border thicknesses different from 2 (the default
  value) or with different vertical and horizontal thickness values,
  many widgets started to show funny behaviors.  I think I fixed every
  problem I found (at least testgtk and many Gnome apps, including gmc
  and gnumeric, work fine for me now).

I'd appreciate you guys to test this stuff and tell me what you think.

Patches for gtk+-1.1.15 and gtk-engines-0.3, as well as a few
screenshots showing tesgtk and Gnome working with the patched gtk, are
available from http://naoma.uniandes.edu.co/~masoto/gtk/.  Feel free
to contact me if you find any trouble with them.

Have fun,

M. S.
------------
Martin A. Soto J.                           Profesor
Departamento de Ingenieria de Sistemas y Computacion
Universidad de los Andes      masoto@uniandes.edu.co



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]