GNOME Bugzilla – Bug 107682
GnomeFontPicker style button
Last modified: 2011-02-04 16:12:26 UTC
I took the font picker found in libgnomeui, adapted it to the gtk coding style and simplified it a bit (no modes, hardwire font_info mode).
Created attachment 14805 [details] gtkfontpickerbutton.h
Created attachment 14806 [details] gtkfontpickerbutton.c
Here is a patch which adds the font picker to gtk/Makefile.am and modifies testgtk to demonstrate a font picker.
Created attachment 14825 [details] [review] patch
Here is a version of the font picker which optionally displays the style of the selected font as well.
Created attachment 14846 [details] gtkfontpickerbutton.c
Created attachment 14847 [details] gtkfontpickerbutton.h
Created attachment 14848 [details] an example
I decided to rename it to GtkFontSelectionButton.
Created attachment 15082 [details] gtkfontselbutton.h
Created attachment 15083 [details] gtkfontselbutton.c
Here is a new version, which is now called GtkFontButton for brevity. Main changes: * indentation fixes * replace GTK_TYPE boilerplate by G_TYPE boilerplate * label_font_size is gone in favor of use_size. You now have the choice to use either the regular font size from the style or the selected font size. * preview_text is gone * broken attempts of instant update removed * separator between font name and style removed
Created attachment 15106 [details] gtkfontbutton.h
Created attachment 15107 [details] gtkfontbutton.c
Created attachment 17890 [details] gtkfontbutton.h
Created attachment 17891 [details] gtkfontbutton.c
The new version has the following changes: - reduce some excessively long function names - move to instance private data - improved documentation - fixed a few bugs noticed while doing the above
Created attachment 17932 [details] gtkfontbutton.h - incorporating feedback from Soeren & Owen
Created attachment 17933 [details] gtkfontbutton.c - incorporating feedback from Soeren & Owen
Committed, including docs and demos.