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-08 Cody Russell <bratsche@gnome.org>
* gtk/gtkmenushell.c
* gtk/gtkmenu.c: In enter/leave notify events, check that the crossing
mode is not GTK_GRAB, GTK_UNGRAB, or STATE_CHANGED. Fixes regressions
in menus caused by bug #56070.
svn path=/trunk/; revision=21049
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-21 Hans Breuer <hans@breuer.org>
* gtk/gtkprintoperation-win32.c(1713) : fix 'function' : incompatible
types - from 'struct _cairo *' to 'struct _cairo_surface *' by
passing the surface to cairo_surface_show_page(), not the context
* gtk/gtkprintoperation-win32.c(866) : get rid of warning C4018:
'<' : signed/unsigned mismatch by using guint for the loop
* gtk/gtkmenu.c(gtk_menu_get_property) : property 'menu::active' is
an uint, gtk_menu_get_active() returns the widget pointer. Convert
the latter to the former by calculating the index in menu::children
Also fix some occurences of g_return_if_fail() where
g_return_val_if_fail() was meant
svn path=/trunk/; revision=20662
2008-06-19 Johan Dahlin <jdahlin@async.com.br>
* gtk/gtkmenu.c (gtk_menu_set_accel_path):
Remove an unused variable and cast to gchar to avoid a compiler
warning.
svn path=/trunk/; revision=20467
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-05-30 Michael Natterer <mitch@imendio.com>
* gtk/gtkmenu.c (get_attach_info): cast attach_info_free() to
GDestroyNotify when using it in g_object_set_data_full().
svn path=/trunk/; revision=20257
detail
* gtk/gtkmenu.c (gtk_menu_paint): Use "menu_scroll_arrow_up/down"
as detail when drawing scroll arrow backgrounds. Proposed by
Tommi Komulainen.
svn path=/trunk/; revision=20202
2007-11-14 Michael Natterer <mitch@imendio.com>
* gtk/gtkmenu.c (gtk_menu_popup): remove recently added
gdk_flush() again, it's not needed after all.
svn path=/trunk/; revision=18991
2007-11-06 Michael Natterer <mitch@imendio.com>
* gtk/gtkmenu.c (gtk_menu_popup): call gdk_flush() after showing
the menu so we can definitely grab on it. Grab failure found by
Xan Lopez.
svn path=/trunk/; revision=18969
2007-09-11 Michael Natterer <mitch@imendio.com>
* gtk/gtkmenu.c (gtk_menu_button_release): Make sure
menu_shell->button gets reset to 0 when we bail out early here
instead of chaining up, so it is in a consistent state for the
next press/release in GtkMenuShell. Fixes bug #449371.
svn path=/trunk/; revision=18795
2007-06-27 Michael Natterer <mitch@imendio.com>
Merged from maemo-gtk:
* gtk/gtkmenu.c (gtk_menu_handle_scrolling): when updating the
scroll arrows' state, make sure we don't overwrite the insensitive
state that might have been set by the first scroll step hitting
the top/bottom border of the menu.
svn path=/trunk/; revision=18260
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-25 Michael Natterer <mitch@imendio.com>
* gtk/gtkmenu.c (gtk_menu_handle_scrolling): fix ACTIVE state of
scroll buttons (we were setting the state to ACTIVE but
immediately overwriting it with NORMAL or PRELIGHT). Also got rid
of many separate calls to gdk_window_invalidate_rect() by
remembering the old button state and only invalidating the area if
the state has changed (addresses parts of bug #433242, Tommi
Komulainen).
(gtk_menu_scroll_to): change the arrow states only if changing
from or to INSENSITIVE state, so we don't overwrite the ACTIVE
state set by above function.
svn path=/trunk/; revision=17630
2007-03-29 Michael Natterer <mitch@imendio.com>
Don't close menus on clicks on their border area (bug #423761).
(modified patch from maemo-gtk).
* gtk/gtkmenu.c (gtk_menu_button_press)
(gtk_menu_button_release): bail out early if the click was on the
menu's border (not on any item and not outside the window).
(pointer_in_menu_window): new utility function which checks if
passed root coords are inside the menu_shell or one of its
parent shells.
svn path=/trunk/; revision=17571
2007-03-29 Michael Natterer <mitch@imendio.com>
* gtk/gtkmenu.c: get rid of local GtkSettings variables by moving
gtk_widget_get_settings() into the g_object_get() call. Some small
indentation fixes.
svn path=/trunk/; revision=17570
2007-02-14 Michael Natterer <mitch@imendio.com>
* gtk/gtkmenu.c (gtk_menu_motion_notify): don't forget to set the
state of the synthesized GDK_ENTER_NOTIFY event. Fix taken from
maemo-gtk.
svn path=/trunk/; revision=17291
2007-02-01 Michael Natterer <mitch@imendio.com>
* gtk/gtkmenu.c (gtk_menu_button_press)
(gtk_menu_button_release)
(gtk_menu_button_scroll): remove redundant and confusing
if (GTK_IS_MENU (widget)) checks because "widget" is always a
GtkMenu here.
svn path=/trunk/; revision=17247
2007-01-18 Michael Natterer <mitch@imendio.com>
* gtk/gtkcheckbutton.c
* gtk/gtkdnd.c
* gtk/gtkentry.c
* gtk/gtkmenu.c
* gtk/gtktreeview.c
* gtk/gtkviewport.c: pass more clip rectangles to gtk_paint_foo()
functions. Based on a patch from maemo-gtk (bug #398023).
svn path=/trunk/; revision=17183
2007-01-05 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkmenu.c (gtk_menu_paint): Take the scroll arrow into
account when drawing the background. (#393166, Benjamin Berg)
svn path=/trunk/; revision=17084
2006-12-15 Federico Mena Quintero <federico@novell.com>
Merged from gtk-2-10:
* gtk/gtkmenu.c (gtk_menu_set_title): Don't try to optimize for
the case where the new title is the same as the old title, to
preserve the behavior from GTK+ 2.8 (NULL and "" titles are not
equivalent). Handle the case where title == priv->title. This
was found by the LSB compatibility tests:
https://bugzilla.novell.com/show_bug.cgi?id=223882
2006-12-15 Dom Lachowicz <domlachowicz@gmail.com>
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.