New version of the borderless button patch.



I realized that the previous version of this patch was not very clean
code.  I also added some changes to the toolbar to allow the buttons in
the toolbar to be automatically borderless and a change to testgtk to test
these changes.  The patch is attached.
  Chris
This is the README for the patch for the creation of borderless buttons.   

This implements buttons that have no borders most of the time.  When
the mouse is over them they have a shadow and if they have the focus
they have the standard black rectangle border.  If neither of these is
the case then the widget in them looks almost as if it is just sitting
on the widget containing the button.

Another part of this change is that borderless buttons don't change
background when the mouse enters them.  They just look silly if they
do change background.

Secondly, I changed the toolbar widget so that it stores a default
style for its automatically created buttons.  There's functions to get
and set the button style.

Finally, I made the default for the button style for the toolbar in
testgtk GTK_BUTTON_BORDERLESS and added two buttons to switch the
button style.


Coding stuff:
GtkButtonStyle is an enum with two possible values: GTK_BUTTON_NORMAL, and
GTK_BUTTON_BORDERLESS.

gtk_button_set_style takes a button and one of these two values and
sets the style of the given button.

gtk_button_get_style returns one of these two values.


gtk_toolbar_set_button_style takes a toolbar and one of these two
values and sets the style of all automatically generated buttons in
that toolbar, including those that are already created.

gtk_toolbar_get_button_style returns one of these two values.


The changes to testgtk.c are pretty obvious.


Future directions:
This is a pretty simple change.  More ideas are certainly welcome.
One idea I've thought of would be to add similar changes to the other
button types.


Christopher James Lahey <clahey@umich.edu>
This patch generated against CVS head as of about 1:15 AM Sat May 9.

gtk-clahey-980509-0.patch.gz



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