Commit Graph

136 Commits

Author SHA1 Message Date
Benjamin Otte
d3c147a62d stylecontext: Split render functions out into gtkrender.[ch] 2014-10-03 06:18:05 +02:00
Marek Kasik
8b5d30d439 Remove redundant checks for NULL
Remove checks for NULL before g_free() and g_clear_object().
Merge check for NULL, freeing of pointer and its setting
to NULL by g_clear_pointer().

https://bugzilla.gnome.org/show_bug.cgi?id=733157
2014-10-02 19:06:03 +02:00
Matthias Clasen
73267102fd GtkAccelLabel: unconditionally chain up in draw
No need to check, we know for sure that GtkLabel has a draw
function.
2014-07-19 23:37:43 -04:00
Matthias Clasen
fba83da3ee GtkAccelLabel: use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:30:51 -04:00
Matthias Clasen
10f8ea27bf GtkAccelLabel: Convert to g_object_class_install_properties 2014-06-09 13:30:51 -04:00
Matthias Clasen
4d002d5e6a GtkAccelLabel: Drop use of GtkMisc
Just use 0 instead of xpad.

https://bugzilla.gnome.org/show_bug.cgi?id=730613
2014-05-24 00:04:41 -04:00
Matthias Clasen
b8309cdf2f Fix a leftover deprecation warning 2014-05-13 11:56:29 -04:00
Matthias Clasen
ec0a60a248 Deprecate GtkMisc
This has been dangling ever since 3.0.
2014-05-13 08:45:00 -04:00
Matthias Clasen
c779b42476 Docs: use // for comments in examples
Without sgml mode, we can't escape /* as /* anymore,
so just switch to // for comments in examples.
2014-02-14 23:34:22 -05:00
Matthias Clasen
7f6a964c47 Docs: Remove all entities and turn off sgml mode
With all element markup gone, it is time to turn off
sgml mode, and get rid of entities as well.
2014-02-09 17:58:07 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
William Jon McCann
63e887e165 docs: replace all <examples> with markdown headings 2014-02-04 16:58:54 -05:00
William Jon McCann
4c8bd8e7cf docs: Identify examples that are C code
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
768bc44081 docs: use |[ ]| instead of <programlisting></programlisting>
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
498345ffe1 docs: fix docs for out params 2014-01-21 12:41:16 -05:00
Matthias Clasen
7e3f68d950 GtkAccelLabel: Add a setter for manual accels
This is needed to keep the a11y keybinding code working.
2014-01-05 11:12:09 -05:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
Bastien Nocera
3c8a4126a8 GtkAccelLabel: Don't show "+" if there's no more keys to add
With the following code:
    #define INVALID_CHAR GDK_KEY_VoidSymbol - 1
    gtk_accelerator_get_label (INVALID_CHAR, GDK_SHIFT_MASK | GDK_CONTROL_MASK);
we would get this label:
    Shift+Ctrl+
instead of this label:
    Shift+Ctrl

https://bugzilla.gnome.org/show_bug.cgi?id=694075
2013-02-18 18:00:44 +01:00
Ryan Lortie
99a53112ec GtkAccelLabel: adjust recent accel changes
In the event that a GtkAccelKey was present for the closure but it
contained a keyval of 0 the previous code would show "".  After the
recent adjustments, "-/-" would be shown in this case.

It turns out to be a pretty common case, so fix the logic to stop using
'0' as a magic value to mean "don't have an accel" and add a separate
boolean for that purpose.
2012-09-18 08:57:53 -04:00
Ryan Lortie
778aa7ade0 GtkAccelLabel: add manual accel API
Add an API to GtkAccelLabel for hardcoding the accel key to be displayed
(ie: allowing us to bypass the GtkAccelGroup lookup).

Use that from the GMenuModel-based GtkMenu construction code instead of
passing around the accel group.

This makes accel labels work in bloatpad again.

This patch effectively removes any hope of automatic runtime accel
changes in GMenuModel-based menus without additional application
support but it leaves the door open for this to be supported again in
the future (if we decide that it's important).

https://bugzilla.gnome.org/show_bug.cgi?id=683738
2012-09-17 12:31:22 -04:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Rui Matos
221442aa2a accellabel: Stop setting state flags on the style context for drawing 2011-12-19 19:21:15 +00:00
Matthias Clasen
4a857ac023 Use a weak ref in GtkAccelLabel
GtkAccelLabel was holding a strong reference on its parent,
which could, depending on the circumstances, lead to leaks.

https://bugzilla.gnome.org/show_bug.cgi?id=344858
2011-08-24 08:16:03 -04:00
Benjamin Otte
0c9b046af0 accellabel: Use gtk_widget_class_set_accessible_role() 2011-07-18 18:30:51 +02:00
Javier Jardón
31f53dd8d4 gtkaccellabel: Do not use GET_PRIV macro 2011-06-02 15:10:49 +02:00
Matthias Clasen
c56150ea5b Fix an example 2011-05-31 23:50:13 -04:00
Benjamin Otte
ecb0fa952a accellabel: Remove leftover debug code
The disabling of the check was added in
63a0ab5e73

Ooops.
2011-05-02 20:09:17 +02:00
Benjamin Otte
63a0ab5e73 accellabel: Only daw accelerator after natural size has been reached 2011-05-01 08:02:15 +02:00
Matthias Clasen
2610e00de9 GtkAccelLabel: Improve struct packing 2011-04-12 12:23:35 -04:00
Matthias Clasen
3f1c95de8d Don't try to modify readonly strings
This was an oversight in the recent accel label improvement.
When we get an untranslated string back from gettext(), it is
not ok to replace '_' by ' ' in-place. Instead, do it while
appending to the GString.
https://bugzilla.gnome.org/show_bug.cgi?id=641912
2011-02-09 17:32:05 -05:00
Matthias Clasen
b6783933c9 Strip XF86 prefix from untranslated keysyms
When we don't have translations, at least remove the
ugly XF86 prefix.
2011-02-04 15:34:36 -05:00
Javier Jardón
03df034684 Remove latest bits of GtkItemFactory 2011-02-04 17:30:11 +00:00
Matthias Clasen
b5c6904c2f Drop explicit includes of gdkkeysyms.h
These are no longer needed. At the same time, port gtkimcontextsimpleseqs.h
to use the new GDK_KEY_ symbols.
2011-01-04 12:21:41 -05:00
Carlos Garnacho
1cecb10584 Make GtkAccelLabel use GtkStyleContext. 2010-12-24 19:37:20 +01:00
Javier Jardón
eac1959d2c Move destroy signal to GtkWidget
Also make GtkWidget derive from GInitiallyUnowned
2010-09-26 22:18:18 -04:00
Benjamin Otte
c34c05217c accellabel: Remove gtk_widget_is_drawable() check from draw vfunc 2010-09-26 15:11:46 +02:00
Benjamin Otte
d9c9259861 Move GtkSizeRequest into GtkWidget
It doesn't make sense to keep them separate as GtkSizeRequest requires a
GtkWidget and GtkWidget implements GtkSizeRequest, so you can never have
one without the other.
It also makes the code a lot easier because no casts are required when
calling functions.

Also, the names would translate to gtk_widget_get_width() and people
agreed that this would be a too generic name, so a "preferred" was added
to the names.

So this patch moves the functions:
gtk_size_request_get_request_mode() => gtk_widget_get_request_mode()
gtk_size_request_get_width() => gtk_widget_get_preferred_width()
gtk_size_request_get_height() => gtk_widget_get_preferred_height()
gtk_size_request_get_size() => gtk_widget_get_preferred_size()
gtk_size_request_get_width_for_height() =>
  gtk_widget_get_preferred_width_for_height()
gtk_size_request_get_height_for_width() =>
  gtk_widget_get_preferred_height_for_width()
... and moves the corresponding vfuncs to the GtkWidgetClass.

The patch also renames the implementations of the vfuncs in widgets to
include the word "preferrred".
2010-09-26 15:11:45 +02:00
Benjamin Otte
1d3f6b30b0 API: Rename gtk_cairo_paint_*() to gtk_paint_*()
Large patch, but just renaming.
Indentation should still mostly be correct because I took care of
keeping the indentation for this function name.
2010-09-26 15:11:42 +02:00
Benjamin Otte
fb4ba51d44 accellabel: Port to draw vfunc 2010-09-26 15:11:36 +02:00
Matthias Clasen
e0aa12eb0a Tons of transfer annotations 2010-09-21 00:18:11 -04:00
Javier Jardón
b140884fec Use gtk_size_request_get_size() instead deprecated gtk_widget_size_request()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629598

Signed-off-by: Javier Jardón <jjardon@gnome.org>
Signed-off-by: Tristan Van Berkom <tristanvb@openismus.com>
2010-09-15 03:02:58 +02:00
Kristian Rietveld
0fc5433753 Update for GDK key name changes 2010-09-13 16:27:08 +02:00
Tristan Van Berkom
fa565f3a3e Fixed accel label to do its derived work in ->get_width() instead of the old ->size_request() 2010-08-18 20:01:27 -04:00
Javier Jardón
f760538f17 gtkaccellabel: Remove unused class members
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=97414
2010-08-10 04:17:29 +02:00
Javier Jardón
0a07e9733b gtk/: fully remove gtkalias hacks
https://bugzilla.gnome.org/show_bug.cgi?id=623845
2010-07-10 02:51:26 +02:00
Javier Jardón
00d3d8516b Fix compilation warning: cast to GTK_WIDGET 2010-05-03 01:51:19 +02:00
Cody Russell
0779d0a37e Move GSEAL'd members of GtkAccelLabel into private struct. 2010-05-03 01:51:18 +02:00
Javier Jardón
32b9aeaadd Don't use GTK_WIDGET_STATE in internal code anymore
Use gtk_widget_get/set_state() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-09 02:40:17 +01:00
Javier Jardón
4f78f70b15 Deprecate widget flag: GTK_WIDGET_DRAWABLE
Use gtk_widget_is_drawable() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 04:55:55 +01:00
Javier Jardón
2adef27d7b Move documentation to inline comments: GtkAccelLabel
https://bugzilla.gnome.org/show_bug.cgi?id=403485
2010-02-09 04:12:25 +01:00