Commit Graph

180 Commits

Author SHA1 Message Date
Javier Jardón
c1a2ecc369 Check if childs actually exists before using it
Check seems to have gone lost during GtkBin sealing in commit 4427760b

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=624707
2010-07-22 17:17:43 +02:00
Javier Jardón
4427760bcc Use GtkBin accessors 2010-07-13 19:40:47 +02:00
Javier Jardón
3a10216dd0 Use accessor functions to acces GtkContainer 2010-07-13 19:40:46 +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
Christian Dywan
025eebb49d Remove deprecated GtkMenuItem function 2010-05-03 01:39:49 +02:00
Jan Arne Petersen
63c21edab7 Fix notify::label emmision in GtkMenuItem
Emit notify::label in GtkMenuItem also when label is changed through GtkAction.

Refactor GtkMenuItem and remove duplicated code for GtkLabel creation. Reset
the accel-widget back to the GtkMenuItem itself when there is no action related
to the GtkMenuItem anymore.

Add test for notify::label emmisions.

Fixes bug 612574 - GtkMenuItem does not emit notify::label when label is
changed through GtkAction.
2010-03-15 20:50:07 +01:00
Javier Jardón
1934de4b65 Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_REALIZED)
Use new API instead: gtk_widget_set_realized ()

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-06 11:51:33 +01:00
Javier Jardón
24bafd8693 Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_NO_WINDOW)
Use new API instead: gtk_widget_set_has_window ()

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-06 11:37:06 +01:00
Javier Jardón
16a59ad912 Deprecate widget flag: GTK_WIDGET_REALIZED
Use gtk_widget_get_realized() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-03 20:41:05 +01:00
Javier Jardón
1fe7d3cefd Deprecate widget flag: GTK_WIDGET_MAPPED
Use gtk_widget_get_mapped() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-03 20:19:03 +01:00
Javier Jardón
214a023e91 Deprecate widget flag: GTK_WIDGET_VISIBLE
Use gtk_widget_get_visible() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 07:52:07 +01:00
Javier Jardón
a27d5a2c9e Deprecate widget flag: GTK_WIDGET_IS_SENSITIVE
Use gtk_widget_is_sensitive() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 05:32:51 +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
Johan Dahlin
fe85272112 [annotations] Add allow-none
This commit was created using a script that searched for all docstrings
containing a parameter and the string 'or %NULL'.
Gdk backends and demos excluded as they are not part of a public API

https://bugzilla.gnome.org/show_bug.cgi?id=610474
2010-02-19 17:57:51 -02:00
Matthias Clasen
c59f76fda2 Only show the mnemonic underline when pressing Alt
...and show them in menus when navigating the menu with the keyboard.
This is similar to what other platforms do, and reduces visual clutter.
There is a setting to control this. Most of the work on this patch was
done by Thomas Wood. See bug 588554.
2009-12-20 03:11:05 -05:00
Colin Walters
6529c07614 [introspection] Merge in Gtk-custom.c annotations
The Gtk-custom.c file in gir-repository contained a number of
introspection annotations.  Merge those into the GTK source files.

Some documentation was moved from the tmpl/ files to accomodate
the addition of annotations.
2009-12-16 17:22:01 -02:00
Tristan Van Berkom
515a0b61a1 Accelerators failed for submenus (GNOME bug 582025)
gtk/gtkmenuitem.c: Override custom_tag_finished() for "accelerator" and search
the correct toplevel GtkWindow to attach accelerators to menu items.

gtk/gtkwidget.[ch]: Added _gtk_widget_buildable_finish_accelerator() to allow
subclasses to specify a toplevel window to associate with when parsing <accelerator>
tags
2009-06-22 12:19:56 -04:00
Matthias Clasen
e6f6ee193d Rename gtk_activatable_reset to gtk_activatable_sync_action_properties,
* gtk/gtk.symbols:
        * gtk/gtkactivatable.[hc]: Rename gtk_activatable_reset to
        gtk_activatable_sync_action_properties, since the previous name
        was deemed too generic. Update all implementations.


svn path=/trunk/; revision=22389
2009-02-22 05:20:14 +00:00
Matthias Clasen
bb72b647f6 i Bug 560228 – Add "action-controller" property to GtkWidgetClass
Rework the way actions and proxies interact, to make the
        interaction less ad hoc, more extensible, and better suited
        for support in GUI builders like glade.

        To be used as a proxy, a widget must now implement the
        GtkActivatable interface, and GtkActivatable implementations
        are responsible for syncing their appearance with the action
        and for activating the action.

        All the widgets that are commonly used as proxies implement
        GtkActivatable now.

        Patch by Tristan van Berkom.

        * gtk/gtkactivatable.[hc]: The GtkActivatable interface.

        * gtk/gtkbutton.c:
        * gtk/gtktogglebutton.c:
        * gtk/gtktoolitem.c:
        * gtk/gtktoolbutton.c:
        * gtk/gtktoggletoolbutton.c:
        * gtk/gtkmenuitem.c:
        * gtk/gtkcheckmenuitem.c:
        * gtk/gtkimagemenuitem.c:
        * gtk/gtkradiomenuitem.c:
        * gtk/gtkrecentchooserprivate.h:
        * gtk/gtkrecentchooser.c:
        * gtk/gtkrecentchooserdefault.c:
        * gtk/gtkrecentchoosermenu.c: Implement GtkActivatable.
        * gtk/gtkaction.[hc]: Move appearance synchronization to
        GtkActivatable implementations.

        * gtk/gtkradioaction.c:
        * gtk/gtkrecentaction.c:
        * gtk/gtktoggleaction.c:
        * gtk/gtkactiongroup.c: Adapt.

        * gtk/gtk.h: Include gtkactivatable.h
        * gtk/gtk.symbols: Add new functions


svn path=/trunk/; revision=22195
2009-01-23 15:15:28 +00:00
Christian Dywan
9f6daa9fb2 Bug 560602 – Wrong GtkMenuItem default value (test fails)
2008-11-13  Christian Dywan  <christian@imendio.com>

	Bug 560602 – Wrong GtkMenuItem default value (test fails)

	* gtk/gtkmenuitem.c (gtk_menu_item_class_init):
	Correct default "label" value to ""

svn path=/trunk/; revision=21788
2008-11-13 08:48:38 +00:00
Tristan Van Berkom
4858ae47e2 Made buildable and added support for adding children of type "submenu"
* gtk/gtkmenuitem.c: Made buildable and added support for adding children
	of type "submenu"

	* gtk/gtkwindow.c: Added support for custom tag "accel-groups" to add GtkAccelGroups
	to the window.

	* gtk/gtkcontainer.c: Added builder contextual warnings in buildable_add_child()

	* gtk/tests/builder.c: Added tests for buildable menus (test that accelerators are
	properly connected on stock items, test the menu hierarchy, test permission to
	add alien/custom menuitem children).

	* docs/reference/gtk/tmpl/gtkbuilder.sgml, docs/reference/gtk/tmpl/gtkwindow.sgml,
	docs/reference/gtk/tmpl/gtkmenuitem.sgml: Updated docs for buildable submenus
	and accel groups.


svn path=/trunk/; revision=21767
2008-11-06 17:34:30 +00:00
Tristan Van Berkom
70a5f5388e added new apis gtk_menu_item_[set/get]_label() and
2008-11-06  Tristan Van Berkom <tvb@gnome.org>

	* gtk/gtkmenuitem.[ch]: added new apis gtk_menu_item_[set/get]_label() and
	gtk_menu_item_[set/get]_use_underline() with "label" and "use-underline"
	properties, constructors cleaned up to use g_object_new().
	GtkMenuItemClass take new vfuncs ->get/set_label().

	* gtk/gtkcheckmenuitem.c: constructors cleaned up to use g_object_new().

	* gtk/gtkimagemenuitem.[ch]: added new apis gtk_image_menu_item_[get/set]_use_stock()
	and gtk_image_menu_item_set_accel_group() with "use-stock" and write-only
	"accel-group" properties. constructors cleaned up to use g_object_new().


svn path=/trunk/; revision=21766
2008-11-06 17:19:08 +00:00
Michael Natterer
e4f4f03fcf gtk/gtkmenu.c remove unused macro cruft. Also remove some unneeded
2008-09-03  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenu.c
	* gtk/gtkmenuitem.c: remove unused macro cruft. Also remove some
	unneeded includes.


svn path=/trunk/; revision=21266
2008-09-03 15:23:17 +00:00
Björn Lindqvist
7df6b76a1a Bug 541315 – Segfault when selecting a GtkMenuItem with submenu and no
2008-08-18  Björn Lindqvist  <bjourne@gmail.com>

	Bug 541315 – Segfault when selecting a GtkMenuItem with submenu
	and no parent

	* gtk/gtkmenuitem.c (gtk_menu_item_real_popup_submenu): Ensure
	that the menu item has a parent before popping it up.

svn path=/trunk/; revision=21149
2008-08-18 17:48:13 +00:00
Michael Natterer
e0bbf16989 get rid of the deprecated aliases NONE and BOOL.
2008-08-13  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmarshalers.list: get rid of the deprecated aliases NONE
	and BOOL.

	* gtk/gtkdialog.c
	* gtk/gtkentrycompletion.c
	* gtk/gtkmenuitem.c
	* gtk/gtkoldeditable.c
	* gtk/gtkrange.c
	* gtk/gtktreeview.c
	* gtk/gtkwidget.c: changed accordingly.


svn path=/trunk/; revision=21111
2008-08-13 18:44:11 +00:00
Michael Natterer
d9d3379698 gtk/gtkaccellabel.c gtk/gtkcalendar.c gtk/gtkclist.c gtk/gtkentry.c
2008-08-12  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkaccellabel.c
	* gtk/gtkcalendar.c
	* gtk/gtkclist.c
	* gtk/gtkentry.c
	* gtk/gtkeventbox.c
	* gtk/gtkfilechooserbutton.c
	* gtk/gtkfilechooserdefault.c
	* gtk/gtkhandlebox.c
	* gtk/gtkhsv.c
	* gtk/gtkiconview.c
	* gtk/gtkimage.c
	* gtk/gtklayout.c
	* gtk/gtklistitem.c
	* gtk/gtkmenuitem.c
	* gtk/gtkmessagedialog.c
	* gtk/gtknotebook.c
	* gtk/gtkpaned.c
	* gtk/gtkpathbar.c
	* gtk/gtkplug.c
	* gtk/gtkprintunixdialog.c
	* gtk/gtkrange.c
	* gtk/gtkrecentchooserdefault.c
	* gtk/gtkruler.c
	* gtk/gtksocket.c
	* gtk/gtktext.c
	* gtk/gtktextview.c
	* gtk/gtktoolbar.c
	* gtk/gtktreeitem.c
	* gtk/gtktreeview.c
	* gtk/gtkviewport.c
	* gtk/gtkwin32embedwidget.c: chain up unconditionally in
	realize(), unrealize(), map(), unmap(), style_set(),
	key_press_event() and size_request()


svn path=/trunk/; revision=21088
2008-08-12 09:44:32 +00:00
Michael Natterer
e18d3c6fd3 consistently chain up using GTK_FOO_CLASS(parent_class)->bar(instance)
2008-08-12  Michael Natterer  <mitch@imendio.com>

	* gtk/*.c: consistently chain up using
	GTK_FOO_CLASS(parent_class)->bar(instance) instead of
	(*GTK_FOO_CLASS(parent_class))->bar(instance).


svn path=/trunk/; revision=21085
2008-08-12 09:06:34 +00:00
Sven Neumann
9cf66a8a9c gtk/gtkmenu.c gtk/gtkmenuitem.c gtk/gtkmenushell.c gtk/gtknotebook.c
2008-08-11  Sven Neumann  <sven@gimp.org>

	* gtk/gtkmenu.c
	* gtk/gtkmenuitem.c
	* gtk/gtkmenushell.c
	* gtk/gtknotebook.c
	* gtk/gtkoldeditable.c
	* gtk/gtkpaned.c: use canonical signal names.



svn path=/trunk/; revision=21063
2008-08-11 11:52:06 +00:00
Matthias Clasen
65f9d54685 Fall back to the default positioning when the menuitem is not realized.
* gtk/gtkmenuitem.c: Fall back to the default positioning when
        the menuitem is not realized. Patch by Björn Lindqvist.



svn path=/trunk/; revision=20754
2008-07-03 23:33:08 +00:00
Michael Natterer
a82c180023 Bug 537591 – Don't hardcode minimum width of menuitems
2008-07-02  Michael Natterer  <mitch@imendio.com>

	Bug 537591 – Don't hardcode minimum width of menuitems

	* gtk/gtkmenuitem.c: applied patch from Christian Dywan which
	introduces a "width-chars" style property which replaces the
	hardcoded minimum width of menuitems with submenu. Patch
	extracted from Maemo-GTK+.


svn path=/trunk/; revision=20733
2008-07-02 12:05:42 +00:00
Cody Russell
57223c9a05 Revert name change
svn path=/trunk/; revision=20724
2008-07-01 22:57:50 +00:00
Cody Russell
fce9c8b7d4 Practically everything changed.
2008-06-30  Cody Russell  <bratsche@gnome.org>

        * Practically everything changed.

        Change	all references	of GIMP	Toolkit	(and variations	of it)
        to GTK+	Toolkit, showing no mercy at all to our	beloved
	ancestry. (#540529)


svn path=/trunk/; revision=20709
2008-06-30 23:01:56 +00:00
Johan Dahlin
d97cdbdf53 Include "config.h" instead of <config.h> Command used: find -name
2008-06-21  Johan Dahlin  <jdahlin@async.com.br>

    * *.[ch]: Include "config.h" instead of <config.h>
    Command used:
    find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
    Rubberstamped by Mitch and Tim


svn path=/trunk/; revision=20669
2008-06-22 14:28:52 +00:00
Hans Breuer
8e2ef4982b must return a value of the appropriate type with g_return_val_if_fail
2008-06-20  Hans Breuer  <hans@breuer.org>

	* gtk/gtkmenuitem.c gtk/gtkmessagedialog.c gtk/gtkplug.c : must return
	a value of the appropriate type with g_return_val_if_fail
	
	* gdk/gdkconfig.h.win32 : add the GSEAL definition here as well

	* gtk/gtkfilesystem.c : don't add the "File System" on win32

	* tests/makefile.msc : remove broken autotestfile(system|chooser) 
	from build


svn path=/trunk/; revision=20657
2008-06-20 20:39:22 +00:00
Johan Dahlin
e46eeab2a9 Add missing Since: gtk-doc markup for newly added GSEAL API. Change all
2008-06-20  Johan Dahlin  <jdahlin@async.com.br>

    * gtk/gtkaccelgroup.c:
    * gtk/gtkcolorseldialog.c:
    * gtk/gtkcontainer.c:
    * gtk/gtkdialog.c:
    * gtk/gtkentry.c (gtk_entry_class_init):
    * gtk/gtkfontsel.c:
    * gtk/gtkhandlebox.c:
    * gtk/gtklayout.c:
    * gtk/gtkmenu.c (gtk_menu_class_init):
    * gtk/gtkmenuitem.c (gtk_menu_item_class_init):
    * gtk/gtkplug.c (gtk_plug_class_init):
    * gtk/gtkselection.c:
    * gtk/gtksocket.c:
    * gtk/gtktreeselection.c:
    * gtk/gtkwidget.c (gtk_widget_class_init):
    * gtk/gtkwindow.c:
    Add missing Since: gtk-doc markup for newly added GSEAL API.
    Change all Since: GSEAL-branch to Since: 2.14.


svn path=/trunk/; revision=20639
2008-06-20 13:54:31 +00:00
Tim Janik
dcbc5d021f Fix documentaion of gtk_menu_item_get_accel_path
svn path=/trunk/; revision=20623
2008-06-20 11:10:02 +00:00
Tim Janik
a66946e2a5 Seal GtkMenuItem
svn path=/trunk/; revision=20610
2008-06-20 11:08:45 +00:00
Johan Dahlin
234dc3726f remove an unused variable and cast accel_path to gchar, just like in
2008-06-19  Johan Dahlin  <jdahlin@async.com.br>

    * gtk/gtkmenuitem.c: remove an unused variable and cast
    accel_path to gchar, just like in gtkmenu.c


svn path=/trunk/; revision=20473
2008-06-19 19:09:50 +00:00
Christian Persch
dcc9428036 Bug 535608 – do not string-copy accel paths in the menu code
Don't store the accel path as a string in gtkmenu/gtkmenuitem.
The accel path will be interned anyway, so keeping a string copy around
is just a waste of memory.
Improve the documentation to mention this.

svn path=/trunk/; revision=20331
2008-06-07 20:40:20 +00:00
Matthias Clasen
b0ea8e9f85 Bug 501730 – use GSlice for small allocs
* gtk/gtkmenuitem.c:
        * gtk/gtkmenu.c: Use the slice allocator for small allocations.
        Patch by Christian Persch.


svn path=/trunk/; revision=20161
2008-05-25 22:33:34 +00:00
Michael Natterer
e7355f82c2 gtk/gtkcontainer.c gtk/gtkexpander.c gtk/gtkframe.c gtk/gtklabel.c
2008-02-06  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkcontainer.c
	* gtk/gtkexpander.c
	* gtk/gtkframe.c
	* gtk/gtklabel.c
	* gtk/gtkmain.c
	* gtk/gtkmenu.c
	* gtk/gtkmenuitem.c
	* gtk/gtkmenushell.c
	* gtk/gtknotebook.c
	* gtk/gtkseparatortoolitem.c
	* gtk/gtksocket.c
	* gtk/gtktextlayout.c
	* gtk/gtktoggletoolbutton.c
	* gtk/gtktoolbutton.c
	* gtk/gtktoolitem.c
	* gtk/gtktree.c
	* gtk/gtktreeitem.c: replace "foo && GTK_IS_FOO (foo)" by simply
	"GTK_IS_FOO (foo)".


svn path=/trunk/; revision=19481
2008-02-06 09:53:34 +00:00
Matthias Clasen
5b48e3bfb3 Remove debug spew
svn path=/trunk/; revision=19092
2007-11-30 00:36:52 +00:00
Behdad Esfahbod
a64cba34e3 Make GtkMenuItem's arrow size themeable. (#469239, Michael Natterer)
2007-11-21  Behdad Esfahbod  <behdad@gnome.org>

        * gtk/gtkmenuitem.c (gtk_menu_item_class_init),
        (gtk_menu_item_paint): Make GtkMenuItem's arrow size themeable.
        (#469239, Michael Natterer)


svn path=/trunk/; revision=19020
2007-11-21 09:22:06 +00:00
Michael Natterer
ece25ff10c add "submenu" property. Fix gtk_menu_item_set_submenu() to accept NULL
2007-06-13  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenuitem.[ch]: add "submenu" property. Fix
	gtk_menu_item_set_submenu() to accept NULL submenus and deprecate
	gtk_menu_item_remove_submenu() because we have a properly working
	setter now (bug #447065).

	* gtk/gtk.symbols: deprecate gtk_menu_item_remove_submenu().

	* gtk/gtkcombobox.c: use gtk_menu_item_set_submenu() instead of
	gtk_menu_item_remove_submenu().


svn path=/trunk/; revision=18125
2007-06-13 15:21:10 +00:00
Michael Natterer
62c13f0463 don't switch submenu opening direction for overlapping reasons if there is
2007-06-01  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): don't switch
	submenu opening direction for overlapping reasons if there is even
	less space on the other side (bug #441863, Tommi Komulainen).


svn path=/trunk/; revision=18002
2007-06-01 11:02:11 +00:00
Michael Natterer
533d3fcc76 Merged heavily modified patch from maemo-gtk which enables opening and
2007-04-27  Michael Natterer  <mitch@imendio.com>

	Merged heavily modified patch from maemo-gtk which enables opening
	and closing submenus on click, and introduces some usability
	changes when gtk-touchscreen-mode is enabled (bug #128968):

	* gtk/gtkmenushell.c (struct GtkMenuShellPrivate): added boolean
	"activated_submenu" to indicate that the current mouse operation
	(click or drag) has opened a submenu.

	(gtk_menu_shell_button_press): pop up submenus without delay
	and record the fact in "activated_submenu".

	(gtk_menu_shell_button_release): if a submenu was explicitely
	opened, or not opened by this release's button_press, or enough
	time has passed since timeout-opening it, close the submenu here.

	(gtk_menu_shell_enter_notify): when entering a menu item with
	any mouse button pressed, open its submenu.

	(gtk_real_menu_shell_move_current): in touchsreen mode, close the
	submenu when moving the focus away from it via keyboard-navigation.

	* gtk/gtkmenuitem.[ch] (_gtk_menu_item_popup_submenu): added
	parameter "gboolean with_delay" so GtkMenuShell can control this
	for the different scenarios of submenu showing.

	(_gtk_menu_item_popdown_submenu): new function. also needed by
	GtkMenuShell for closing submenus on click.

	Renamed internal function gtk_menu_item_select_timeout() to
	gtk_menu_item_popup_timeout().

	(gtk_menu_item_real_popup_submenu): new utility function which
	does the actual popup and records the exact time of the popup when
	the menu was timeout-opened (using g_get_current_time()).

	(gtk_real_menu_item_select): don't add the popup timeout when in
	touchscreen mode.

	* gtk/gtkmenu.c (gtk_menu_popup): in touchscreen mode, select the
	first item of every opened menu.


svn path=/trunk/; revision=17659
2007-04-27 14:49:37 +00:00
Michael Natterer
160ea46dba queue a draw on the parent_menu_item of this menu item's menu, to enable
2007-01-29  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenuitem.c (gtk_menu_item_select)
	(gtk_menu_item_deselect): queue a draw on the parent_menu_item of
	this menu item's menu, to enable themeing menu items depending on
	whether something is selected in their submenu (patch taken from
	maemo-gtk).


svn path=/trunk/; revision=17234
2007-01-29 15:45:18 +00:00
Matthias Clasen
721c3bc101 Replace a lot of idle and timeout calls by the new gdk_threads api.
2006-12-22  Matthias Clasen  <mclasen@redhat.com>

        * *.c: Replace a lot of idle and timeout calls by
        the new gdk_threads api.
2006-12-22 19:10:43 +00:00
Benjamin Berg
8f9a1d8bf6 Take GtkMenu::horizontal-padding into account when placing submenus
2006-06-09  Benjamin Berg  <benjamin@sipsolutions.net>

	* gtk/gtkmenuitem.c: (get_offsets): Take GtkMenu::horizontal-padding
	into account when placing submenus (#344290)
2006-06-09 15:20:53 +00:00
Matthias Clasen
113f364a37 More of the same 2006-05-14 04:25:34 +00:00