patch: go-combo-font (2)



Hi, 

i have hacked some more on the font combo, incorporating the suggestions.
At construction time a GOFontComboModel can be passed to the
GOFontCombo. So the list of displayed fonts can be controlled.

API: 

GOComboFontModel* go_combo_font_model_new             (void);
void                      go_combo_font_model_add_desc        (GOComboFontModel *self,
const PangoFontDescription *desc);
gboolean                  go_combo_font_model_contains_desc   (GOComboFontModel
*self, const PangoFontDescription *desc);
void                      go_combo_font_model_remove_desc     (GOComboFontModel *self,
const PangoFontDescription *desc);
void                      go_combo_font_model_add_family      (GOComboFontModel *self,
const gchar *family);
gboolean                  go_combo_font_model_contains_family (GOComboFontModel
*self, const gchar *family);
void                      go_combo_font_model_remove_family   (GOComboFontModel *self,
const gchar *family);
gboolean                  go_combo_font_model_get_show_other  (GOComboFontModel *self);
gboolean                  go_combo_font_model_is_other            (GOComboFontModel *self, gint idx);

The "show-other" property determines whether the "Other ..." entry
should be displayed at the bottom, beneath a separator (as seen on the
screenshot). The is_other() method can be used to determine if this
special entry has been selected in the "changed" signal handler.

"Patch": http://www.abisource.org/~rob/tmp/go-combo-font.tgz (seems
like it's not possible to create "-N" patches using gnome's anoncvs,
just unpack in goffice/gtk)

Test thingy: http://www.abisource.org/~rob/tmp/go-fontcombo.c

Screenshot: http://www.abisource.org/~rob/tmp/go-fontcombo-2.png
(using custom model)

It now also contains locking locking code so multiple goffice
consumers can share the cache (disabled by default, gotta stress test
that).

Best, 
- Rob



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