Commit Graph

54 Commits

Author SHA1 Message Date
Benjamin Otte
54c6c7ae87 cellrendereraccel: Remove unused variables 2014-10-03 06:18:07 +02:00
Matthias Clasen
07722ae2dd GtkCellRendererAccel: Stop using deprecated API 2014-10-02 00:37:52 -04:00
Matthias Clasen
e9df5edc11 Avoid compiler warnings
The previous commit was sloppy with parameter types.
2014-09-06 21:28:31 -04:00
Matthias Clasen
794230e708 GtkCellRendererAccel: Try harder to capture bound keys
Add a grab on the editable widget, so that we can capture
also shortcuts which are bound in the application itself.

https://bugzilla.gnome.org/736203
2014-09-06 20:56:03 -04:00
Matthias Clasen
fa0e43471c GtkCellRendererAccel: Stop editing on focus out
This is not automatic, and with grabs in place, it is awkward
to have focus moved elsewhere, so stop editing whenever the
cell editable loses focus.
2014-09-06 19:03:07 -04:00
Matthias Clasen
bdd1871cba GtkCellRendererAccel: rework the grabbing
Grab keyboard/mouse on the toplevel, and grab the focus to the
cell editable, so we actually see the key events.
2014-09-06 19:03:06 -04:00
Matthias Clasen
fe11f8f875 Revert "gtkcellrendereraccel: Use a GtkInvisible to grab on"
This reverts commit fe5402d32e.
2014-09-06 19:02:41 -04:00
Jasper St. Pierre
fe5402d32e gtkcellrendereraccel: Use a GtkInvisible to grab on
Grabbing on a non-toplevel might not do what we want it to do, since it
will go on the focused widget, not the grabbed widget. Since we don't
focus the widget before clicking on it, that means that putting the
focus somewhere else and then clicking on the accelerator editor will
freeze the app. Additionally, since it's a global system grab that can't
be exited except by a key press that we won't ever get, it effectively
locks up your system as well unless you know how to break the grab or
kill the app. Ouch.

Since doing a device grab on a non-toplevel is generally considered a
bad idea, just don't do it. Use a GtkInvisible and take a grab on that
instead.
2014-06-29 20:56:40 -04:00
Matthias Clasen
f4e60bc36d GtkCellRendererAccel: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:30:52 -04:00
Carlos Garnacho
db14e22f06 cellrendereraccel: remove superfluous GTK+ grabs 2014-05-23 19:54:24 +02:00
William Jon McCann
2c4431e6ba docs: don't use <keycap> tags 2014-02-04 19:29:00 -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
Philip Withnall
ceb866dfe6 Bug 595615 — Use proper ellipses
Use ‘…’ instead of ‘...’ in translatable strings.

Closes: https://bugzilla.gnome.org/show_bug.cgi?id=595615
2012-11-26 08:59:27 +00:00
Benjamin Otte
48c6b3b4f4 gtk: Add get_type() function declarations for private objects
I'm adding a bunch of fixes for gcc complaining about
-Wmissing-declarations.

This set of patches makes private classes in gtk/*.c that use
G_DEFINE_TYPE() safe by adding definitions for the get_type() function
that can't be made static.
2012-10-02 19:32:38 +02:00
Cosimo Cecchi
295ed0033e cellrendereraccel: don't translate Alt+Print to SysRq
We want to use Alt+Print for screenshot keybindings, so we have to avoid
translating it into SysRq, since that's what the keymap would dictate.
After talking with Owen, it sounds like doing this generically would be
a lot of work and quite hairy code, so hardcoding this should be OK.

https://bugzilla.gnome.org/show_bug.cgi?id=671006
2012-03-22 00:45:08 -04:00
Cosimo Cecchi
ab605e11bf cellrendereraccel: override get_preferred_width, not get_size
Since GtkCellRendererText moved to WFH requests, our get_size
implementation is ignored. We should override get_preferred_width
instead. This fixes the accel renderer being clipped to a wrong size
when trying to edit its shortcut.
2012-02-28 15:06:33 -05:00
Cosimo Cecchi
a77eba5de4 cellrendereraccel: override background on the event box, not the label
Since that's what renders the background. Otherwise the event box will
get the regular window background and will look bad.
2012-02-28 15:06:33 -05:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Matthias Clasen
9bf17a95e5 Revert 3fd7dbc940
Calling gdk_keymap_add_virtual_modifiers causes _all_ virtual
modifiers to be added, which causes problem when they are co-located
on the same real modifier (as Super and Hyper often are). Effectively,
this made it impossible to enter key combinations involving Super,
since they all turn into Super+Hyper.
2011-12-08 12:44:19 -05:00
Michael Natterer
1c8481a6ea Bug 663856 - Make option-foo accelerators use the right symbol
If the keyboard group shifting modifier is *also* a normal
accelerator modifier, we need to special case it when calling
gdk_keymap_translate_keyboard_state(), so we get the right
key symbol for accelerators (for example we want Option-O,
not Option-Ø displayed in menu items). This patch should only
affect quartz where the Alt key both shifts the group and can
be used as accel modifier, and not X11 or Win32 where AltGr
is not used for accelerators.

- fix quartz' gdk_keymap_translate_keyboard_state() to return
  the right consumed_modifiers
- add _gtk_translate_keyboard_accel_state() which does the
  special casing
- use it everywhere instead of gdk_keymap_translate_keyboard_state()
2011-11-18 13:06:27 +01:00
Bastien Nocera
d69c7f4776 gtk: Fix GtkCellRenderer ignoring keycodes
We should use the new helper code rather than invent our own
functions again.

https://bugzilla.gnome.org/show_bug.cgi?id=663761
2011-11-10 14:33:28 +00:00
Michael Natterer
3fd7dbc940 gtk: enable setting virtual modifiers in GtkCellRendererAccel
Call gdk_keymap_add_virtual_modifiers() on event->state,
so virtual modifiers get added at all.
(cherry picked from commit be1eea612c)
2011-09-26 16:01:50 +02:00
Diego Celix
df9d7cf9aa gtkcellrendereraccel: gtk_misc_set_alignment
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtkcellrendereraccel.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-06-10 17:59:49 -04:00
Matthias Clasen
92f1f0c118 GtkCellRendererAccelPrivate: Improve struct packing 2011-04-12 12:30:04 -04:00
Javier Jardón
610d46d12e Move documentation to inline comments: GtkCellRendererAccel 2011-04-11 03:27:08 +01:00
Carlos Garnacho
e3a77b9db8 Make GtkCellRendererAccel use GtkStyleContext 2011-01-27 20:57:13 +01:00
Matthias Clasen
8f6a8441a2 Implement the editing-canceled property in GtkCellEditableEventBox
https://bugzilla.gnome.org/show_bug.cgi?id=639455
2011-01-14 20:24:26 -05:00
Matthias Clasen
98440ad031 Remove gtktypeutils altogether
Based on patches by Javier Jardón.

https://bugzilla.gnome.org/show_bug.cgi?id=629955
2011-01-04 14:51:19 -05: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
Michael Natterer
fb5dd9f72f Move all GdkDevice members to private and add one missing accessor 2010-11-23 20:25:13 +01:00
Matthias Clasen
21eae6b6f3 Make GdkRectangle arguments in GtkCellRenderer use const consistently
https://bugzilla.gnome.org/show_bug.cgi?id=630900
2010-10-04 10:23:55 -04: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
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
Colin Walters
913cdf3be7 GDK: Prefix key names with KEY_
The keysyms create a lot of potential namespace conflicts for
C, and are especially problematic for introspection, where we take
constants into the namespace, so GDK_Display conflicts with GdkDisplay.

For C application compatiblity, add gdkkeysyms-compat.h which uses
the old names.

Just one user in GTK+ continues to use gdkkeysyms-compat.h, which is
the gtkimcontextsimple.c, since porting that requires porting more
custom Perl code.
2010-09-08 18:51:44 -04:00
Javier Jardón
1e5d7c0225 Use GtkFooPrivate instead GtkFooPriv 2010-08-27 04:48:23 +02:00
Javier Jardón
c6b86761d6 gtk/gtkcellrendereraccel.c: use accessor functions to access GtkWidget 2010-08-22 22:56:15 +02:00
Javier Jardón
6736c085b3 Use accessor functions to access GtkCellRendererText 2010-07-13 19:40:45 +02:00
Javier Jardón
932568d1ed gtkcellrendereraccel: Move public members to private structure 2010-07-13 19:40:45 +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
Matthias Clasen
bd4609b140 Merge the xi2-for-master branch 2010-05-25 18:38:44 -04:00
Matthias Clasen
05d39e4085 Add a missing include
This was reported in bug 593606.
2009-09-02 22:14:47 -04:00
Kristian Rietveld
6320b12e8c Bug 526149 - GtkCellRendererAccel editing conflicts with mnemonics
GtkCellRendererAccel also needs to acquire the GTK+ grab in addition to
a GDK keyboard grab.  With the GDK keyboard grab, KeyPress and
KeyRelease events are delivered as usual, although we only want to
receive them for our grab widget.
2009-08-23 08:59:34 +02:00
Christian Persch
45d076fcc2 Display invalid accelerators as "Invalid" in GTK mode.
When in GTK_CELL_RENDERER_ACCEL_MODE_GTK, display accelerator key
combinations that don't pass gtk_accelerator_valid() as "Invalid".
Bug #572799.
2009-04-20 14:54:59 +02:00
Christian Persch
db7d72c82f Display localised accelerator keys also in OTHER mode
This fixes bug 572797.
2009-04-11 01:53:32 -04:00
Matthias Clasen
5cfd038335 Use C_() instead of Q_(). String change!
2008-10-26  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkaccellabel.c:
        * gtk/gtkcalendar.c:
        * gtk/gtkcellrendereraccel.c:
        * gtk/gtkcellrendererprogress.c:
        * gtk/gtkimmulticontext.c:
        * gtk/gtkrecentchoosermenu.c:
        * gtk/gtkvolumebutton.c: Use C_() instead of Q_(). String change!



svn path=/trunk/; revision=21716
2008-10-27 01:42:28 +00:00
Christian Persch
e68135a992 Bug 555724 – gtkcellrendereraccel not initialised correctly
svn path=/trunk/; revision=21641
2008-10-13 12:54:39 +00:00
Sven Neumann
2a95978506 gtk/gtkaboutdialog.c gtk/gtkcellrendereraccel.c gtk/gtkcellrenderercombo.c
2008-08-11  Sven Neumann  <sven@gimp.org>

	* gtk/gtkaboutdialog.c
	* gtk/gtkcellrendereraccel.c
	* gtk/gtkcellrenderercombo.c
	* gtk/gtkcellrendererspin.c
	* gtk/gtkcellrenderertext.c
	* gtk/gtkclipboard.c
	* gtk/gtkcolorsel.c
	* gtk/gtkcombo.c
	* gtk/gtkcombobox.c
	* gtk/gtkdnd-quartz.c
	* gtk/gtkdnd.c
	* gtk/gtkentry.c
	* gtk/gtkentrycompletion.c
	* gtk/gtkfilechooserbutton.c
	* gtk/gtkfilechooserdefault.c
	* gtk/gtkfilechooserentry.c
	* gtk/gtkfontsel.c
	* gtk/gtkinputdialog.c
	* gtk/gtkmenutoolbutton.c
	* gtk/gtkpathbar.c
	* gtk/gtktooltip.c: use canonical signal names in 
g_signal_connect().


svn path=/trunk/; revision=21060
2008-08-11 09:17:49 +00:00
Kristian Rietveld
e523ba2ce8 implement getter for keycode property. (#476665, patch by Christian
2007-09-14  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtkcellrendereraccel.c (gtk_cell_renderer_accel_get_property):
	implement getter for keycode property.  (#476665, patch by
	Christian Persch).


svn path=/trunk/; revision=18817
2007-09-13 22:37:02 +00:00
Michael Natterer
06e5e2a5f0 use multihead safe ungrab functions instead of gdk_keyboard_ungrab() and
2007-03-07  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkcellrendereraccel.c: use multihead safe ungrab functions
	instead of gdk_keyboard_ungrab() and gdk_pointer_ungrab(), remove
	empty finalize() implementation, some cosmetic cleanup
	(bug #415645).


svn path=/trunk/; revision=17412
2007-03-07 14:18:53 +00:00
Michael Natterer
7f374a74ba Add new infrastructure for notifications of failed keyboard navigation and
2006-11-16  Michael Natterer  <mitch@imendio.com>

	Add new infrastructure for notifications of failed keyboard
	navigation and navigation with restricted set of keys.

	The patch handles configurable beeping, navigating the GUI with
	cursor keys only (as in phone environments), and configurable
	wrap-around. Fixes bugs #322640, #70986, #318827, #334726, #334742
	and #309291.

	* gtk/gtksettings.c: added properties gtk-keynav-cursor-only,
	gtk-keynav-wrap-around and gtk-error-bell.

	* gtk/gtkwidget.[ch]: added new signal "keynav-failed" and public
	API to emit it. Added New function gtk_widget_error_bell() which
	looks at the gtk-error-bell setting and calls gdk_window_beep()
	accordingly.

	* gtk/gtk.symbols: add the new widget symbols.

	* gtk/gtkcellrendereraccel.c
	* gtk/gtkimcontextsimple.c
	* gtk/gtkmenu.c
	* gtk/gtknotebook.c: use gtk_widget_error_bell() or look at the
	gtk-error-bell setting instead of calling gdk_display_beep()
	unconditionally.

	* gtk/gtkcombobox.c
	* gtk/gtkentry.c
	* gtk/gtkiconview.c
	* gtk/gtklabel.c
	* gtk/gtkmenushell.c
	* gtk/gtkspinbutton.c
	* gtk/gtktextview.c
	* gtk/gtktreeview.c: call gtk_widget_error_bell() on failed keynav.

	* gtk/gtkentry.c
	* gtk/gtklabel.c
	* gtk/gtkrange.c
	* gtk/gtktextview.c: consult gtk_widget_keynav_failed() on failed
	cursor navigation and leave the widget if it returns FALSE.

	* gtk/gtkmenushell.c
	* gtk/gtknotebook.c: only wrap around if gtk-keynav-wrap-around
	is TRUE.

	* gtk/gtkradiobutton.c: ask gtk_widget_keynav_failed() to decide
	whether to to wrap-around, and don't select active items on cursor
	navigation if gtk-keynav-cursor-only is TRUE. Should look at
	gtk-keynav-wrap-around too, will look into that.
2006-11-16 12:56:30 +00:00