Commit Graph

17102 Commits

Author SHA1 Message Date
Ryan Lortie
81e76746ff GtkActionHelper: two small fixups in _set_target_value()
First, ensure we always consume floating values, as documented.

Second (and more serious), don't try to query the action if the
action name is not set yet.  This will cause crashes...
2012-08-22 00:54:57 -04:00
William Jon McCann
515e211d0b Don't left align label in check buttons when they have no indicator
Because they should be normal buttons in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=681617
2012-08-21 07:09:14 -04:00
Cosimo Cecchi
de3cfa6034 modelmenu: fix a GCC warning
This should not be a const string, since the caller is supposed to free
it.
2012-08-21 11:15:32 +02:00
Cosimo Cecchi
4e9f4fbc77 textview: fix a typo in method gtk-doc annotation
This was causing a warning from the introspection scanner.
2012-08-21 11:14:46 +02:00
Cosimo Cecchi
f6079f6406 menubutton: use consistent parameter names
Or the introspection scanner will emit a warning.
2012-08-21 11:14:16 +02:00
Matthias Clasen
79eeb78c46 Fix the doc build 2012-08-20 23:38:03 -04:00
Matthias Clasen
ed04b879c0 Fix exports for new symbols 2012-08-20 23:38:00 -04:00
Matthias Clasen
0101a735a3 Add documentation
Document the new API and properties, and their interaction with
existing properties.

https://bugzilla.gnome.org/show_bug.cgi?id=651244
2012-08-20 18:54:22 -04:00
Matthias Clasen
7d1c1a8d20 GtkTextView: Add input purpose and hints
Add input-purpose and input-hints properties and pass these through
to the GtkIMContext.

https://bugzilla.gnome.org/show_bug.cgi?id=651244
2012-08-20 18:54:22 -04:00
Matthias Clasen
eaaee081b1 GtkEntry: Add input purpose and hints
Add input-purpose and input-hints properties to GtkEntry,
and pass these on to GtkIMContext.

https://bugzilla.gnome.org/show_bug.cgi?id=651244
2012-08-20 18:54:21 -04:00
Matthias Clasen
3cb4aa44b3 GtkIMContext: Add purpose and hints
Add input-purpose and input-hints properties to GtkIMContext.

https://bugzilla.gnome.org/show_bug.cgi?id=651244
2012-08-20 18:54:21 -04:00
Krzesimir Nowak
8a8c434737 enums: Add purpose enum and hints flags.
This commit adds two enumerations that will be used
to pass additional information to input methods, in
the subsequent commits.

https://bugzilla.gnome.org/show_bug.cgi?id=651244
2012-08-20 18:54:20 -04:00
Ryan Lortie
0244dc8017 GtkMenuButton: rename _set_menu() to _set_popup()
It's too close to the release so we'll keep _set_menu() around, but
deprecate it, pointing to the new API.  It will be removed (and the name
reused) before the 3.6.0 release.

https://bugzilla.gnome.org/show_bug.cgi?id=682235
2012-08-20 17:04:14 -04:00
William Jon McCann
c5c46a125e icon-view: emit selection-changed when changing the model
Only if there was a selection active.

https://bugzilla.gnome.org/show_bug.cgi?id=681613
2012-08-20 13:59:09 -04:00
Lars Uebernickel
710674720e gtkmodelmenu: add support for action namespaces
If a section or submenu item has a "action-namespace" attribute, the
action names of the created GtkModelMenuItems will be prefixed with that
namespace.  Namespaces can be cascaded.
2012-08-20 13:13:50 -04:00
Ryan Lortie
5634eb226f GtkApplicationWindow: drop GActionMuxer use
There are no remaining users of the GActionMuxer in GtkApplicationWindow
because they've all been ported over to using the one on GtkWidget (via
GtkActionHelper, for the most part).
2012-08-20 13:13:50 -04:00
Ryan Lortie
4dd7de2e68 Drop GSimpleActionObserver
The only place that this was being created was in GtkApplicationWindow
and the last commit dropped that code.
2012-08-20 13:13:49 -04:00
Ryan Lortie
315d43e8a9 Remove private appwindow observer creation API
There are no remaining users of the GtkApplicationWindow API to create
GSimpleActionObserver or to get the GActionObservable (ie: muxer) for
the appwindow.  Drop those APIs.
2012-08-20 13:13:49 -04:00
Lars Uebernickel
86d7c9d5b5 ApplicationWindow: setup accels with widget muxer
Use the muxer from GtkWidget to setup the accels rather than our own
local muxer (which will soon be removed).
2012-08-20 13:13:49 -04:00
Ryan Lortie
fd9b7bbfac Remove #include for muxer from gtkapplication.c 2012-08-20 13:13:49 -04:00
William Hua
fe48e077bd Action helper support in Mac OS menus. 2012-08-20 13:13:49 -04:00
Ryan Lortie
dd45862a06 gtkmodelmenu: move to new action regime
Drop the explicit passing of GActionGroup into the GtkMenu(Bar)
constructors and operate from the action context instead.

With GtkMenuItem implementing GtkActionable, this turns out to be pretty
easy (and most of the code can be removed from GtkModelMenuItem,
including the GActionObserver implementation).
2012-08-20 13:13:49 -04:00
Ryan Lortie
ea5a56dacf GtkMenuItem: implement GtkActionable
...using the new GtkActionHelper
2012-08-20 13:13:45 -04:00
Ryan Lortie
694be447e3 port GtkButton to GtkActionHelper 2012-08-20 13:11:02 -04:00
Ryan Lortie
fbb38e95ac port GtkSwitch to GtkActionHelper 2012-08-20 13:11:01 -04:00
Lars Uebernickel
ab3b41374a Add two users of gtk_widget_insert_action_group
Each GtkWindow with an associated GtkApplication should add this as
"app" to its action context.  Each GtkApplicationWindow is its own
GActionGroup, and it should add itself to itself with the prefix "win".

There is now some duplication here because we have the new GActionMuxer
hierarchy managed by GtkWidget, but GtkApplicationWindow still carries
its own muxer.  The redundancy will be removed in a future patch.
2012-08-20 13:11:01 -04:00
Ryan Lortie
652f16dd98 introduce private GtkActionHelper
The current process of implementing GActionObserver is annoying and the
GSimpleActionObserver interface leaves a lot to be desired.  Introduce a
new class, GtkActionHelper that gives you pretty much everything you'd
want to do as an implementor of GtkActionable.

The GtkActionHelper also features an "application" mode that is not
associated with a particular GtkWidget but rather with whatever widget
happens to be the active window of the given GtkApplication at a
particular point in time.  This will be useful for the Mac OS menubar.
2012-08-20 13:11:01 -04:00
Lars Uebernickel
d30d56452c GtkWidget: Add gtk_widget_insert_action_group()
This allows adding a GActionGroup with a given name at an arbitrary
point in the widget tree.

This patch also adds an internal _get_action_muxer() API.  Calling this
will create a GActionMuxer associated with the widget.  The parent of
the muxer will be the muxer of the widget's conceptual parent.  For
non-menus, that is the normal parent.  For menus, it is the attach
widget.

In this way, we end up with a hierarchy of GActionMuxer that largely
reflects the hierarchy of GtkWidget, but only in places that the action
context has been requested.  These muxers are the ones on which the
inserted actions groups are installed.

A following patch will add a user of this API.
2012-08-20 13:09:04 -04:00
Ryan Lortie
2e57819477 GtkApplication: add 'active-window' property 2012-08-20 13:08:17 -04:00
Lars Uebernickel
d1c458f9e1 GActionMuxer: add support for parent muxers
If a muxer does not contain an action group with the given prefix, chain
up to the "parent" muxer to look for it.

This initial implementation is rather inefficient.  It will lead to
changes on action groups associated with parent muxers being broadcast
to all children (regardless of if anybody there is interested or not).
An optimised version will follow soon.
2012-08-20 13:08:17 -04:00
Alexander Larsson
6b7eaf86ed GtkMountOperation: Return the right password_save
If the buttons were never sent we returned the wrong
default value (i.e. not what the UI displayed).
2012-08-20 17:07:54 +02:00
Emmanuele Bassi
78107b1a7d docs: Fix up the RadioButton example in the description 2012-08-20 11:03:17 +01:00
Frédéric Péters
9399275089 doc: fix location of ATK documentation (GNOME bug 682193) 2012-08-19 19:07:22 +02:00
Colin Walters
9ca355b460 GtkEntryAccessible: Remove unused variable 2012-08-16 10:37:05 -04:00
Chun-wei Fan
628892bce8 gtk/gtklevelbar.c: Fix build on non-C99 compilers
-Include fallback-c89.c for the usage of round(), where an implementation
 of round() is provided for compilers that don't have it
-Use g_ascii_strtod() instead of strtof as strtof() may not be universally
 available.
2012-08-16 13:42:13 +08:00
Colin Walters
8ac04de2aa Fix _gtk_entry_get_borders() declaration
Regression introduced by https://bugzilla.gnome.org/show_bug.cgi?id=681591
2012-08-14 19:47:28 -04:00
David King
9d11da702b docs: Clarify GtkToggleButton action documentation
https://bugzilla.gnome.org/show_bug.cgi?id=373279
2012-08-14 12:43:39 +01:00
William Jon McCann
374d48c37b Fix typo in documentation 2012-08-10 13:03:10 -04:00
Mario Sanchez Prada
63e2a0ff0c Expose the masked string for password fields to assistive technologies.
Call _gtk_entry_get_display_text()from gtkentryaccessible.c to make
sure we always consider the actual text being displayed when
implementing the functions from the AtkTet interface.

https://bugzilla.gnome.org/show_bug.cgi?id=681591
2012-08-10 18:09:06 +02:00
Mario Sanchez Prada
58a9244518 Export gtk_entry_get_display_text() as a private function through
gtkentryprivate.h, so we can use it from gtkentryaccessible.c

https://bugzilla.gnome.org/show_bug.cgi?id=681591
2012-08-10 18:09:06 +02:00
Cosimo Cecchi
319bb2641b appchooserdialog: add a missing label mnemonic
https://bugzilla.gnome.org/show_bug.cgi?id=681577
2012-08-10 13:28:01 +02:00
Claudio Saavedra
560952d3c0 Chain up relevant GObjectClass:notify vfuncs
These widgets have ancestors other than GObject which could eventually
implement the notify vfunc for their properties. For correctness, they
should chain up the notify vfunc.

https://bugzilla.gnome.org/show_bug.cgi?id=673478
2012-08-07 18:14:56 +03:00
Cosimo Cecchi
8062e471d1 toolbar: deprecate shadow-type style property
While shadow-type *properties* can make sense, to opt-out of the
padding/border machinery programmatically, having it as a style
property doesn't make any sense, since we have a better way to change
the bevel style from the theme already.
This commit deprecates the shadow-type style property in GtkToolbar.
2012-08-07 16:08:45 +02:00
Cosimo Cecchi
1ec6329f18 toolbar: don't request CSS padding twice
This is a regression from commit
d0d21a4f00.

We are requesting the CSS padding twice: once unconditionally and
another time if SHADOW_TYPE != NONE, which is usually the case.
2012-08-07 16:05:30 +02:00
Cosimo Cecchi
512fee6363 toolbar: deprecate internal-padding style property
This is equivalent to a regular CSS padding, and that's what people
should use.
2012-08-07 12:55:37 +02:00
Matthias Clasen
f89d5c8280 Optimize gtk_widget_path_copy() by preallocating "elems" array
gtk_widget_path_copy() currently calls g_array_append_val() in a loop,
which is inefficient due to reallocating the array's memory. Calling
g_array_set_size() before entering the loop reduces the number of CPU
cycles used by roughly 30%.

Patch by John Lindgren,
https://bugzilla.gnome.org/show_bug.cgi?id=679978
2012-08-07 00:38:48 -04:00
Matthias Clasen
e2c15e2791 Fix a memory leak
As Pavel Vesin pointed out in bug 681064, we were leaking
the container_restyle_queue.
2012-08-06 23:37:36 -04:00
Matthias Clasen
2661403f88 Fix DND keyboard control with XI2
We are using XI2 to grab the key events, but we did not do the
necessary extra work to make GDK deliver root window events to us.

https://bugzilla.gnome.org/show_bug.cgi?id=681006
2012-08-06 22:56:59 -04:00
Matthias Clasen
5a3442bf9c Improve GtkMenuButton menu positioning
Take the menu halign/valign into consideration when positioning
the menu. Also, document the various combinations.

https://bugzilla.gnome.org/show_bug.cgi?id=680988
2012-08-06 22:27:48 -04:00
Matthias Clasen
4942b6f5e4 Remove references to deprecated functions
This inconsistency of the docs was pointed out by
Pierre-Yves Luyten in bug 680949.
2012-08-06 22:27:48 -04:00