Commit Graph

130 Commits

Author SHA1 Message Date
Matthias Clasen
6f955a7df6 Redo font map support in GtkFontChooser
We can't add properties to the interface, since it breaks
3rd party implementations of the GtkFontChooser interface.
These exist, for example in gnumeric.

So, instead of a new property, add getter/setter vfuncs.
2015-06-13 00:00:51 -04:00
Ting-Wei Lan
a1e418ebd5 Fix return value error in gtk_font_chooser_get_font_map
https://bugzilla.gnome.org/show_bug.cgi?id=749248
2015-05-12 07:22:32 -04:00
Matthias Clasen
142c8a5c8d GtkFontChooser: Add an example to the docs 2015-05-07 07:33:23 -04:00
Matthias Clasen
049cbc8b74 GtkFontChooser: Allow a custom font map
This lets applications show their own fonts instead of
or in addition to system fonts.

https://bugzilla.gnome.org/show_bug.cgi?id=748771
2015-05-07 07:33:23 -04:00
Matthias Clasen
595a44680a GtkFontChooser: Use G_PARAM_EXPLICIT_NOTIFY for show-preview-entry
Implementors will have to be adjusted.
2014-06-09 13:31:01 -04:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
Matthias Clasen
a731cd1ef6 Minor doc cleanup
Remove widget references from interface docs.

https://bugzilla.gnome.org/show_bug.cgi?id=695874
2013-03-14 20:29:00 -04:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Benjamin Otte
b95bbb5e39 fontchooser: List font description as font description
Otherwise there will be two properties listed as "Font" in property
selectors (in Glade or testfontchooser).
2011-09-19 22:11:05 +02:00
Christian Persch
8219a413ff Clarify conditions when get_font_{family,face} return NULL 2011-09-13 12:55:34 +02:00
Christian Persch
6902813a11 Rename gtk_font_chooser_get_{family,face,size}
... to gtk_font_chooser_get_font_{family,face,size}, in order to
avoid naming conflicts in bindings.
2011-09-13 12:55:33 +02:00
Christian Persch
abd9242f33 Add GtkFontChooser:font-desc property
Add a way to set/get the font as a PangoFontDescription.
2011-09-13 12:55:33 +02:00
Christian Persch
1b818f2e46 Remove GtkFontChooser:[sg]et_font
Now that the setter doesn't return a value anymore, we can just use
g_object_[sg]et instead of having these vfuncs.
2011-09-13 12:55:22 +02:00
Christian Persch
0b7db6888a Setters should not return a boolean
The setter for the "font" property returned a boolean that indicated
whether the given font has been found. Instead, fall back to the default
font name when the given font doesn't exist.
2011-09-13 12:55:22 +02:00
Matthias Clasen
bdcb8558e3 Trivial: Fix up function name in the docs 2011-09-13 12:55:22 +02:00
Christian Persch
eb9efc9fd2 Rename GtkFontChooser:font-name to :font
GtkFontButton already has a property named "font-name" which may
conflict / be an ABI break when moving GtkFontButton to implement
GtkFontChooser. Also, this is more in line with how other parts in
gtk (e.g. GtkCellRendererText) call a font string property.
2011-09-13 12:55:21 +02:00
Christian Persch
5452525143 Make GtkFontChooser an interface
Make the GtkFontChooser API similar to the Gtk{File,Recent,App}Chooser
APIs by introducing GtkFontChooser as an interface, that has a default
implementation in GtkFontChooserWidget.

https://bugzilla.gnome.org/show_bug.cgi?id=657627
2011-09-13 12:55:21 +02:00
Matthias Clasen
1bede5c3fb GtkFontChooser: mark 'no matches' string for translation 2011-09-05 11:19:30 -04:00
Matthias Clasen
f601994eff GtkFontChooser: escape markup where required
Since we use markup in the list, we need to escape the font name
and preview text pieces that we embed there.
2011-09-04 17:17:07 -04:00
Matthias Clasen
b2188f5dc1 Trivial: include cleanups 2011-08-28 20:46:11 -04:00
Matthias Clasen
6f39855c08 More include cleanups 2011-08-28 01:54:55 -04:00
Matthias Clasen
f7bf35052e GtkFontChooser: Add a ::font-activated signal
This signal gets emitted when a font in the list is activated.
2011-08-24 00:49:16 -04:00
Matthias Clasen
6877893ed5 Make setting fontname work, independent of a screen 2011-08-15 18:57:58 -04:00
Matthias Clasen
1207757924 Keep the currently selected font over theme changes
When repopulating the list of fonts, don't loose the current
selection, unless the font is no longer in the list.
2011-08-15 18:57:57 -04:00
Matthias Clasen
a09ee203ec Add filtering to the font chooser 2011-08-15 18:57:57 -04:00
Matthias Clasen
ba564088c3 Add 'no matches' functionality
Initial cut at showing a 'no matches' message if the font list
is empty.
2011-08-15 18:57:57 -04:00
Matthias Clasen
6fb69845b0 Make the fontchooser dialog come up in a reasonable size
This is not a perfect solution; we really just want to set
a nice default size, but GTK+ does not make that easy.
2011-08-15 18:57:57 -04:00
Matthias Clasen
7c4ad1f400 Just use a single grid
The subgrid didn't really add anything.
2011-08-15 18:57:57 -04:00
Matthias Clasen
43d62c08e3 Clean up error handling 2011-08-15 18:57:57 -04:00
Matthias Clasen
5b9857d9b9 Rename some statics
gtk_font_chooser_ref_{family,face} -> gtk_font_chooser_set_{family,face}
2011-08-15 18:57:57 -04:00
Matthias Clasen
8dbdfa7e73 Avoid extraneous signals at destroy time
We need to disconnect the cursor-changed handler before the
treeview gets destroyed, to avoid unwanted emissions.
2011-08-15 18:57:57 -04:00
Matthias Clasen
97d26ac9c0 Simplify a few things
Adwaita seems to misrender focus on entries with margins, so
use spacing instead. Also, don't use entry buffer unnecessarily.
2011-08-15 18:57:57 -04:00
Matthias Clasen
a18fab88a1 Trivial formatting fixes
Just committing these is easier than writing them up.
2011-08-15 18:57:57 -04:00
Alberto Ruiz
e79842ce94 GtkFontChooser: get_font_name did not return the font size 2011-08-15 18:57:56 -04:00
Alberto Ruiz
d33088a805 GtkFontChooser: Stub code to handle empty list by search. 2011-08-15 18:57:56 -04:00
Alberto Ruiz
66a7add23f GtkFontChooser: font-name property notification wasn't properly propagated during size change from the spinbutton 2011-08-15 18:57:56 -04:00
Alberto Ruiz
5795d3d616 GtkFontChooser: Using G_N_ELEMENTS instead of a define 2011-08-15 18:57:56 -04:00
Alberto Ruiz
9245a66e6f GtkFontChooser: Using the widget instead of the private struct as signal data in all conects 2011-08-15 18:57:56 -04:00
Alberto Ruiz
bf8ad994d4 GtkFontChooser: Fixed coding style wrt spacing around operators 2011-08-15 18:57:56 -04:00
Alberto Ruiz
26fb5c90b1 GtkFontChooser: Using explicit comparisons for g_strcmp0 2011-08-15 18:57:56 -04:00
Alberto Ruiz
ab1ebb072e GtkFontChooser: Added missing breaks in switch statements 2011-08-15 18:57:56 -04:00
Alberto Ruiz
c36d291acc GtkFontChooser: Setting all ought to be static functions as static 2011-08-15 18:57:56 -04:00
Alberto Ruiz
23b15254bb GtkFontChooser: Set correct margin values between UI elements 2011-08-15 18:57:56 -04:00
Alberto Ruiz
1dda502bcb GtkFontChooser: Fix size synchronization between slider and spin button 2011-08-15 18:57:56 -04:00
Alberto Ruiz
cabfcbd18d GtkFontChooser: Cleanup comments and fix indentation alignments 2011-08-15 18:57:56 -04:00
Alberto Ruiz
e3f70857af GtkFontChooser: Remove default geometry defines 2011-08-15 18:57:55 -04:00
Alberto Ruiz
55d50b3cca GtkFontChooser: Fix scroll callback connected to treeview instead of preview 2011-08-15 18:57:55 -04:00
Alberto Ruiz
9dee34ad27 GtkFontChooser: Remove the themed color for the font title 2011-08-15 18:57:55 -04:00
Alberto Ruiz
f5a00f0c77 GtkFontChooser: Use a nested grid to achieve the right layout in the size controls 2011-08-15 18:57:55 -04:00