2008-07-01 22:57:50 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
1997-11-24 22:37:52 +00:00
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 11:33:08 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1997-11-24 22:37:52 +00:00
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-07-26 11:33:08 +00:00
|
|
|
* Lesser General Public License for more details.
|
1997-11-24 22:37:52 +00:00
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
1997-11-24 22:37:52 +00:00
|
|
|
*/
|
1999-02-24 07:37:18 +00:00
|
|
|
|
|
|
|
/*
|
2000-07-26 11:33:08 +00:00
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
1999-02-24 07:37:18 +00:00
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
*/
|
|
|
|
|
2011-01-14 03:11:22 +00:00
|
|
|
/**
|
|
|
|
* SECTION:gtkmenubar
|
|
|
|
* @Title: GtkMenuBar
|
|
|
|
* @Short_description: A subclass of GtkMenuShell which holds GtkMenuItem widgets
|
|
|
|
* @See_also: #GtkMenuShell, #GtkMenu, #GtkMenuItem
|
|
|
|
*
|
|
|
|
* The #GtkMenuBar is a subclass of #GtkMenuShell which contains one or
|
|
|
|
* more #GtkMenuItems. The result is a standard menu bar which can hold
|
|
|
|
* many menu items.
|
2015-11-03 04:49:20 +00:00
|
|
|
*
|
|
|
|
* # CSS nodes
|
|
|
|
*
|
|
|
|
* GtkMenuBar has a single CSS node with name menubar.
|
2011-01-14 03:11:22 +00:00
|
|
|
*/
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
#include "config.h"
|
2010-09-09 13:35:58 +00:00
|
|
|
|
|
|
|
#include "gtkmenubar.h"
|
|
|
|
|
Added gdk_text/string_extents() - too calculate all the metrics at once of
Tue Jul 21 12:42:01 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.h gdk/gdkfont.c: Added gdk_text/string_extents() -
too calculate all the metrics at once of a string, including
things which weren't calculated before.
* gtk/Makefile.am gtk/gtk.h gtk/gtktearoffmenu.[ch]: New
MenuItem type, that when put as the first thing in a
menu, makes the menu tearoff. Currently drawn as a
dashed line.
* gtk/gtkmenuitem.h gtk/gtkcheckmenuitem.c: Added a flag
"hide_on_activate" to the MenuItem class structure to allow
check and radio buttons to be changed with <Space> without
hiding the menu.
* gtk/gtkaccellabel.[ch]: Added new capabilities to set
a underline_group and underline_mods for the label -
accelerators added in the underline group matching
underline_mods will be displayed as an underline character.
This doesn't work - Save As needs to be underlined
as Save _As.
* gtk/gtkitemfactory.c:
- Create a AccelGroup for each MenuShell we create.
- If an '&' appears before a character 'c' in the path,
then make 'c' an accelerator in the menu's accel group,
and if the menuitem is menubar <alt>C an accelerator
in the itemfactory's accel group.
* gtk/gtklabel.[ch]: Add support for a pattern arg -
which is a string. If an '_' appears in this string,
the corresponding position in the label is underlined.
Add gtk_label_parse_uline() convenience function which
takes a string with embedded underlines, sets the
pattern and label, and returns the accelerator keyval.
* gtk/gtkmenu.[ch]: Make menus no longer a toplevel widget.
Instead, they create a GtkWindow and add themselves
to that. (When torn off, another new feature, they
create another GtkWindow to hold the torn off menu)
New function gtk_menu_set_tearoff_state()
* gtk/gtkenums.h gtk/gtkmenushell.[ch] gtk/gtkenums.h:
Added action signals for keyboard navigation of menus.
* gtk/gtkmenushell.c: Key press handler which activates
bindings for navigation, and accelerators, for handling
underline accelerators. Exported functions to select
and activate menu items in a menushell.
* gtk/testgtk.c: Added a new "Item Factory" test which
tests GtkItemFactory and the new keyboard navigation
of menus.
1998-08-12 16:49:13 +00:00
|
|
|
#include "gtkbindings.h"
|
2016-01-01 23:23:27 +00:00
|
|
|
#include "gtkcsscustomgadgetprivate.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
#include "gtkmain.h"
|
2002-03-01 01:05:11 +00:00
|
|
|
#include "gtkmarshalers.h"
|
2010-12-27 01:36:51 +00:00
|
|
|
#include "gtkmenuitemprivate.h"
|
2010-08-29 01:24:11 +00:00
|
|
|
#include "gtkmenuprivate.h"
|
2010-12-23 23:21:53 +00:00
|
|
|
#include "gtkmenushellprivate.h"
|
2014-06-15 15:57:59 +00:00
|
|
|
#include "gtkrender.h"
|
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
|
|
|
#include "gtksettings.h"
|
2010-09-09 13:35:58 +00:00
|
|
|
#include "gtksizerequest.h"
|
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
|
|
|
#include "gtkwindow.h"
|
2011-06-05 23:31:59 +00:00
|
|
|
#include "gtkcontainerprivate.h"
|
2010-09-09 13:35:58 +00:00
|
|
|
#include "gtkintl.h"
|
2005-03-22 02:14:55 +00:00
|
|
|
#include "gtkprivate.h"
|
2011-01-04 19:51:19 +00:00
|
|
|
#include "gtktypebuiltins.h"
|
2013-04-22 21:37:05 +00:00
|
|
|
#include "gtkwidgetprivate.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2013-06-26 18:08:37 +00:00
|
|
|
#define MENU_BAR_POPUP_DELAY 0
|
|
|
|
|
2005-02-11 07:15:11 +00:00
|
|
|
/* Properties */
|
|
|
|
enum {
|
|
|
|
PROP_0,
|
|
|
|
PROP_PACK_DIRECTION,
|
|
|
|
PROP_CHILD_PACK_DIRECTION
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GtkMenuBarPrivate
|
|
|
|
{
|
|
|
|
GtkPackDirection pack_direction;
|
|
|
|
GtkPackDirection child_pack_direction;
|
2016-01-01 23:23:27 +00:00
|
|
|
|
|
|
|
GtkCssGadget *gadget;
|
2005-02-11 07:15:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static void gtk_menu_bar_set_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gtk_menu_bar_get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
2016-01-01 23:23:27 +00:00
|
|
|
static void gtk_menu_bar_finalize (GObject *object);
|
2016-10-22 14:06:14 +00:00
|
|
|
static void gtk_menu_bar_measure_ (GtkWidget *widget,
|
|
|
|
GtkOrientation orientation,
|
|
|
|
int for_size,
|
|
|
|
int *minimum,
|
|
|
|
int *natural,
|
|
|
|
int *minimum_baseline,
|
|
|
|
int *natural_baseline);
|
gtkmenu.c, gtkmenubar.c, gtkmenuitem.c, gtkmenushell.c, gtkmenushell.h,
Sun Oct 20 23:58:03 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtkmenu.c, gtkmenubar.c, gtkmenuitem.c, gtkmenushell.c,
gtkmenushell.h, gtkmenushell.h
- make the delay before submenus appear below menu bars a
GtkSetting
- make the delay before submenus pops up a GtkSetting
- make the stay up triangle slightly larger
- don't pop up the first submenu immediately.
- make the default delay for submenus 225 ms, and 0 for menubars.
- make the default delay before popping down inside the stay-up
triangle 1000 ms
Fixes #74950
2002-10-20 22:29:57 +00:00
|
|
|
static void gtk_menu_bar_size_allocate (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation);
|
2010-09-06 15:23:40 +00:00
|
|
|
static gint gtk_menu_bar_draw (GtkWidget *widget,
|
|
|
|
cairo_t *cr);
|
gtkmenu.c, gtkmenubar.c, gtkmenuitem.c, gtkmenushell.c, gtkmenushell.h,
Sun Oct 20 23:58:03 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtkmenu.c, gtkmenubar.c, gtkmenuitem.c, gtkmenushell.c,
gtkmenushell.h, gtkmenushell.h
- make the delay before submenus appear below menu bars a
GtkSetting
- make the delay before submenus pops up a GtkSetting
- make the stay up triangle slightly larger
- don't pop up the first submenu immediately.
- make the default delay for submenus 225 ms, and 0 for menubars.
- make the default delay before popping down inside the stay-up
triangle 1000 ms
Fixes #74950
2002-10-20 22:29:57 +00:00
|
|
|
static void gtk_menu_bar_hierarchy_changed (GtkWidget *widget,
|
|
|
|
GtkWidget *old_toplevel);
|
2005-02-11 07:15:11 +00:00
|
|
|
static gint gtk_menu_bar_get_popup_delay (GtkMenuShell *menu_shell);
|
|
|
|
static void gtk_menu_bar_move_current (GtkMenuShell *menu_shell,
|
|
|
|
GtkMenuDirectionType direction);
|
gtkmenu.c, gtkmenubar.c, gtkmenuitem.c, gtkmenushell.c, gtkmenushell.h,
Sun Oct 20 23:58:03 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtkmenu.c, gtkmenubar.c, gtkmenuitem.c, gtkmenushell.c,
gtkmenushell.h, gtkmenushell.h
- make the delay before submenus appear below menu bars a
GtkSetting
- make the delay before submenus pops up a GtkSetting
- make the stay up triangle slightly larger
- don't pop up the first submenu immediately.
- make the default delay for submenus 225 ms, and 0 for menubars.
- make the default delay before popping down inside the stay-up
triangle 1000 ms
Fixes #74950
2002-10-20 22:29:57 +00:00
|
|
|
|
2016-01-01 23:23:27 +00:00
|
|
|
static void gtk_menu_bar_measure (GtkCssGadget *gadget,
|
|
|
|
GtkOrientation orientation,
|
|
|
|
int for_size,
|
|
|
|
int *minimum,
|
|
|
|
int *natural,
|
|
|
|
int *minimum_baseline,
|
|
|
|
int *natural_baseline,
|
|
|
|
gpointer data);
|
|
|
|
static void gtk_menu_bar_allocate (GtkCssGadget *gadget,
|
|
|
|
const GtkAllocation *allocation,
|
|
|
|
int baseline,
|
|
|
|
GtkAllocation *out_clip,
|
|
|
|
gpointer data);
|
|
|
|
static gboolean gtk_menu_bar_render (GtkCssGadget *gadget,
|
|
|
|
cairo_t *cr,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int width,
|
|
|
|
int height,
|
|
|
|
gpointer data);
|
|
|
|
|
2013-06-27 19:02:52 +00:00
|
|
|
G_DEFINE_TYPE_WITH_PRIVATE (GtkMenuBar, gtk_menu_bar, GTK_TYPE_MENU_SHELL)
|
2001-03-09 13:28:26 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void
|
|
|
|
gtk_menu_bar_class_init (GtkMenuBarClass *class)
|
|
|
|
{
|
2005-02-11 07:15:11 +00:00
|
|
|
GObjectClass *gobject_class;
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkWidgetClass *widget_class;
|
|
|
|
GtkMenuShellClass *menu_shell_class;
|
|
|
|
|
Added gdk_text/string_extents() - too calculate all the metrics at once of
Tue Jul 21 12:42:01 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.h gdk/gdkfont.c: Added gdk_text/string_extents() -
too calculate all the metrics at once of a string, including
things which weren't calculated before.
* gtk/Makefile.am gtk/gtk.h gtk/gtktearoffmenu.[ch]: New
MenuItem type, that when put as the first thing in a
menu, makes the menu tearoff. Currently drawn as a
dashed line.
* gtk/gtkmenuitem.h gtk/gtkcheckmenuitem.c: Added a flag
"hide_on_activate" to the MenuItem class structure to allow
check and radio buttons to be changed with <Space> without
hiding the menu.
* gtk/gtkaccellabel.[ch]: Added new capabilities to set
a underline_group and underline_mods for the label -
accelerators added in the underline group matching
underline_mods will be displayed as an underline character.
This doesn't work - Save As needs to be underlined
as Save _As.
* gtk/gtkitemfactory.c:
- Create a AccelGroup for each MenuShell we create.
- If an '&' appears before a character 'c' in the path,
then make 'c' an accelerator in the menu's accel group,
and if the menuitem is menubar <alt>C an accelerator
in the itemfactory's accel group.
* gtk/gtklabel.[ch]: Add support for a pattern arg -
which is a string. If an '_' appears in this string,
the corresponding position in the label is underlined.
Add gtk_label_parse_uline() convenience function which
takes a string with embedded underlines, sets the
pattern and label, and returns the accelerator keyval.
* gtk/gtkmenu.[ch]: Make menus no longer a toplevel widget.
Instead, they create a GtkWindow and add themselves
to that. (When torn off, another new feature, they
create another GtkWindow to hold the torn off menu)
New function gtk_menu_set_tearoff_state()
* gtk/gtkenums.h gtk/gtkmenushell.[ch] gtk/gtkenums.h:
Added action signals for keyboard navigation of menus.
* gtk/gtkmenushell.c: Key press handler which activates
bindings for navigation, and accelerators, for handling
underline accelerators. Exported functions to select
and activate menu items in a menushell.
* gtk/testgtk.c: Added a new "Item Factory" test which
tests GtkItemFactory and the new keyboard navigation
of menus.
1998-08-12 16:49:13 +00:00
|
|
|
GtkBindingSet *binding_set;
|
|
|
|
|
2005-02-11 07:15:11 +00:00
|
|
|
gobject_class = (GObjectClass*) class;
|
1997-11-24 22:37:52 +00:00
|
|
|
widget_class = (GtkWidgetClass*) class;
|
|
|
|
menu_shell_class = (GtkMenuShellClass*) class;
|
|
|
|
|
2005-02-11 07:15:11 +00:00
|
|
|
gobject_class->get_property = gtk_menu_bar_get_property;
|
|
|
|
gobject_class->set_property = gtk_menu_bar_set_property;
|
2016-01-01 23:23:27 +00:00
|
|
|
gobject_class->finalize = gtk_menu_bar_finalize;
|
2005-02-11 07:15:11 +00:00
|
|
|
|
2016-10-22 14:06:14 +00:00
|
|
|
widget_class->measure = gtk_menu_bar_measure_;
|
1997-11-24 22:37:52 +00:00
|
|
|
widget_class->size_allocate = gtk_menu_bar_size_allocate;
|
2010-09-06 15:23:40 +00:00
|
|
|
widget_class->draw = gtk_menu_bar_draw;
|
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
|
|
|
widget_class->hierarchy_changed = gtk_menu_bar_hierarchy_changed;
|
2011-07-18 16:14:00 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
menu_shell_class->submenu_placement = GTK_TOP_BOTTOM;
|
gtkmenu.c, gtkmenubar.c, gtkmenuitem.c, gtkmenushell.c, gtkmenushell.h,
Sun Oct 20 23:58:03 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtkmenu.c, gtkmenubar.c, gtkmenuitem.c, gtkmenushell.c,
gtkmenushell.h, gtkmenushell.h
- make the delay before submenus appear below menu bars a
GtkSetting
- make the delay before submenus pops up a GtkSetting
- make the stay up triangle slightly larger
- don't pop up the first submenu immediately.
- make the default delay for submenus 225 ms, and 0 for menubars.
- make the default delay before popping down inside the stay-up
triangle 1000 ms
Fixes #74950
2002-10-20 22:29:57 +00:00
|
|
|
menu_shell_class->get_popup_delay = gtk_menu_bar_get_popup_delay;
|
2005-02-11 07:15:11 +00:00
|
|
|
menu_shell_class->move_current = gtk_menu_bar_move_current;
|
Added gdk_text/string_extents() - too calculate all the metrics at once of
Tue Jul 21 12:42:01 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.h gdk/gdkfont.c: Added gdk_text/string_extents() -
too calculate all the metrics at once of a string, including
things which weren't calculated before.
* gtk/Makefile.am gtk/gtk.h gtk/gtktearoffmenu.[ch]: New
MenuItem type, that when put as the first thing in a
menu, makes the menu tearoff. Currently drawn as a
dashed line.
* gtk/gtkmenuitem.h gtk/gtkcheckmenuitem.c: Added a flag
"hide_on_activate" to the MenuItem class structure to allow
check and radio buttons to be changed with <Space> without
hiding the menu.
* gtk/gtkaccellabel.[ch]: Added new capabilities to set
a underline_group and underline_mods for the label -
accelerators added in the underline group matching
underline_mods will be displayed as an underline character.
This doesn't work - Save As needs to be underlined
as Save _As.
* gtk/gtkitemfactory.c:
- Create a AccelGroup for each MenuShell we create.
- If an '&' appears before a character 'c' in the path,
then make 'c' an accelerator in the menu's accel group,
and if the menuitem is menubar <alt>C an accelerator
in the itemfactory's accel group.
* gtk/gtklabel.[ch]: Add support for a pattern arg -
which is a string. If an '_' appears in this string,
the corresponding position in the label is underlined.
Add gtk_label_parse_uline() convenience function which
takes a string with embedded underlines, sets the
pattern and label, and returns the accelerator keyval.
* gtk/gtkmenu.[ch]: Make menus no longer a toplevel widget.
Instead, they create a GtkWindow and add themselves
to that. (When torn off, another new feature, they
create another GtkWindow to hold the torn off menu)
New function gtk_menu_set_tearoff_state()
* gtk/gtkenums.h gtk/gtkmenushell.[ch] gtk/gtkenums.h:
Added action signals for keyboard navigation of menus.
* gtk/gtkmenushell.c: Key press handler which activates
bindings for navigation, and accelerators, for handling
underline accelerators. Exported functions to select
and activate menu items in a menushell.
* gtk/testgtk.c: Added a new "Item Factory" test which
tests GtkItemFactory and the new keyboard navigation
of menus.
1998-08-12 16:49:13 +00:00
|
|
|
|
|
|
|
binding_set = gtk_binding_set_by_class (class);
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
2010-09-08 17:35:51 +00:00
|
|
|
GDK_KEY_Left, 0,
|
2008-08-12 14:37:03 +00:00
|
|
|
"move-current", 1,
|
Added gdk_text/string_extents() - too calculate all the metrics at once of
Tue Jul 21 12:42:01 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.h gdk/gdkfont.c: Added gdk_text/string_extents() -
too calculate all the metrics at once of a string, including
things which weren't calculated before.
* gtk/Makefile.am gtk/gtk.h gtk/gtktearoffmenu.[ch]: New
MenuItem type, that when put as the first thing in a
menu, makes the menu tearoff. Currently drawn as a
dashed line.
* gtk/gtkmenuitem.h gtk/gtkcheckmenuitem.c: Added a flag
"hide_on_activate" to the MenuItem class structure to allow
check and radio buttons to be changed with <Space> without
hiding the menu.
* gtk/gtkaccellabel.[ch]: Added new capabilities to set
a underline_group and underline_mods for the label -
accelerators added in the underline group matching
underline_mods will be displayed as an underline character.
This doesn't work - Save As needs to be underlined
as Save _As.
* gtk/gtkitemfactory.c:
- Create a AccelGroup for each MenuShell we create.
- If an '&' appears before a character 'c' in the path,
then make 'c' an accelerator in the menu's accel group,
and if the menuitem is menubar <alt>C an accelerator
in the itemfactory's accel group.
* gtk/gtklabel.[ch]: Add support for a pattern arg -
which is a string. If an '_' appears in this string,
the corresponding position in the label is underlined.
Add gtk_label_parse_uline() convenience function which
takes a string with embedded underlines, sets the
pattern and label, and returns the accelerator keyval.
* gtk/gtkmenu.[ch]: Make menus no longer a toplevel widget.
Instead, they create a GtkWindow and add themselves
to that. (When torn off, another new feature, they
create another GtkWindow to hold the torn off menu)
New function gtk_menu_set_tearoff_state()
* gtk/gtkenums.h gtk/gtkmenushell.[ch] gtk/gtkenums.h:
Added action signals for keyboard navigation of menus.
* gtk/gtkmenushell.c: Key press handler which activates
bindings for navigation, and accelerators, for handling
underline accelerators. Exported functions to select
and activate menu items in a menushell.
* gtk/testgtk.c: Added a new "Item Factory" test which
tests GtkItemFactory and the new keyboard navigation
of menus.
1998-08-12 16:49:13 +00:00
|
|
|
GTK_TYPE_MENU_DIRECTION_TYPE,
|
|
|
|
GTK_MENU_DIR_PREV);
|
Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
2001-06-29 01:59:02 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
2010-09-08 17:35:51 +00:00
|
|
|
GDK_KEY_KP_Left, 0,
|
2008-08-12 14:37:03 +00:00
|
|
|
"move-current", 1,
|
Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
2001-06-29 01:59:02 +00:00
|
|
|
GTK_TYPE_MENU_DIRECTION_TYPE,
|
|
|
|
GTK_MENU_DIR_PREV);
|
Added gdk_text/string_extents() - too calculate all the metrics at once of
Tue Jul 21 12:42:01 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.h gdk/gdkfont.c: Added gdk_text/string_extents() -
too calculate all the metrics at once of a string, including
things which weren't calculated before.
* gtk/Makefile.am gtk/gtk.h gtk/gtktearoffmenu.[ch]: New
MenuItem type, that when put as the first thing in a
menu, makes the menu tearoff. Currently drawn as a
dashed line.
* gtk/gtkmenuitem.h gtk/gtkcheckmenuitem.c: Added a flag
"hide_on_activate" to the MenuItem class structure to allow
check and radio buttons to be changed with <Space> without
hiding the menu.
* gtk/gtkaccellabel.[ch]: Added new capabilities to set
a underline_group and underline_mods for the label -
accelerators added in the underline group matching
underline_mods will be displayed as an underline character.
This doesn't work - Save As needs to be underlined
as Save _As.
* gtk/gtkitemfactory.c:
- Create a AccelGroup for each MenuShell we create.
- If an '&' appears before a character 'c' in the path,
then make 'c' an accelerator in the menu's accel group,
and if the menuitem is menubar <alt>C an accelerator
in the itemfactory's accel group.
* gtk/gtklabel.[ch]: Add support for a pattern arg -
which is a string. If an '_' appears in this string,
the corresponding position in the label is underlined.
Add gtk_label_parse_uline() convenience function which
takes a string with embedded underlines, sets the
pattern and label, and returns the accelerator keyval.
* gtk/gtkmenu.[ch]: Make menus no longer a toplevel widget.
Instead, they create a GtkWindow and add themselves
to that. (When torn off, another new feature, they
create another GtkWindow to hold the torn off menu)
New function gtk_menu_set_tearoff_state()
* gtk/gtkenums.h gtk/gtkmenushell.[ch] gtk/gtkenums.h:
Added action signals for keyboard navigation of menus.
* gtk/gtkmenushell.c: Key press handler which activates
bindings for navigation, and accelerators, for handling
underline accelerators. Exported functions to select
and activate menu items in a menushell.
* gtk/testgtk.c: Added a new "Item Factory" test which
tests GtkItemFactory and the new keyboard navigation
of menus.
1998-08-12 16:49:13 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
2010-09-08 17:35:51 +00:00
|
|
|
GDK_KEY_Right, 0,
|
2008-08-12 14:37:03 +00:00
|
|
|
"move-current", 1,
|
Added gdk_text/string_extents() - too calculate all the metrics at once of
Tue Jul 21 12:42:01 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.h gdk/gdkfont.c: Added gdk_text/string_extents() -
too calculate all the metrics at once of a string, including
things which weren't calculated before.
* gtk/Makefile.am gtk/gtk.h gtk/gtktearoffmenu.[ch]: New
MenuItem type, that when put as the first thing in a
menu, makes the menu tearoff. Currently drawn as a
dashed line.
* gtk/gtkmenuitem.h gtk/gtkcheckmenuitem.c: Added a flag
"hide_on_activate" to the MenuItem class structure to allow
check and radio buttons to be changed with <Space> without
hiding the menu.
* gtk/gtkaccellabel.[ch]: Added new capabilities to set
a underline_group and underline_mods for the label -
accelerators added in the underline group matching
underline_mods will be displayed as an underline character.
This doesn't work - Save As needs to be underlined
as Save _As.
* gtk/gtkitemfactory.c:
- Create a AccelGroup for each MenuShell we create.
- If an '&' appears before a character 'c' in the path,
then make 'c' an accelerator in the menu's accel group,
and if the menuitem is menubar <alt>C an accelerator
in the itemfactory's accel group.
* gtk/gtklabel.[ch]: Add support for a pattern arg -
which is a string. If an '_' appears in this string,
the corresponding position in the label is underlined.
Add gtk_label_parse_uline() convenience function which
takes a string with embedded underlines, sets the
pattern and label, and returns the accelerator keyval.
* gtk/gtkmenu.[ch]: Make menus no longer a toplevel widget.
Instead, they create a GtkWindow and add themselves
to that. (When torn off, another new feature, they
create another GtkWindow to hold the torn off menu)
New function gtk_menu_set_tearoff_state()
* gtk/gtkenums.h gtk/gtkmenushell.[ch] gtk/gtkenums.h:
Added action signals for keyboard navigation of menus.
* gtk/gtkmenushell.c: Key press handler which activates
bindings for navigation, and accelerators, for handling
underline accelerators. Exported functions to select
and activate menu items in a menushell.
* gtk/testgtk.c: Added a new "Item Factory" test which
tests GtkItemFactory and the new keyboard navigation
of menus.
1998-08-12 16:49:13 +00:00
|
|
|
GTK_TYPE_MENU_DIRECTION_TYPE,
|
|
|
|
GTK_MENU_DIR_NEXT);
|
Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
2001-06-29 01:59:02 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
2010-09-08 17:35:51 +00:00
|
|
|
GDK_KEY_KP_Right, 0,
|
2008-08-12 14:37:03 +00:00
|
|
|
"move-current", 1,
|
Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
2001-06-29 01:59:02 +00:00
|
|
|
GTK_TYPE_MENU_DIRECTION_TYPE,
|
|
|
|
GTK_MENU_DIR_NEXT);
|
Added gdk_text/string_extents() - too calculate all the metrics at once of
Tue Jul 21 12:42:01 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.h gdk/gdkfont.c: Added gdk_text/string_extents() -
too calculate all the metrics at once of a string, including
things which weren't calculated before.
* gtk/Makefile.am gtk/gtk.h gtk/gtktearoffmenu.[ch]: New
MenuItem type, that when put as the first thing in a
menu, makes the menu tearoff. Currently drawn as a
dashed line.
* gtk/gtkmenuitem.h gtk/gtkcheckmenuitem.c: Added a flag
"hide_on_activate" to the MenuItem class structure to allow
check and radio buttons to be changed with <Space> without
hiding the menu.
* gtk/gtkaccellabel.[ch]: Added new capabilities to set
a underline_group and underline_mods for the label -
accelerators added in the underline group matching
underline_mods will be displayed as an underline character.
This doesn't work - Save As needs to be underlined
as Save _As.
* gtk/gtkitemfactory.c:
- Create a AccelGroup for each MenuShell we create.
- If an '&' appears before a character 'c' in the path,
then make 'c' an accelerator in the menu's accel group,
and if the menuitem is menubar <alt>C an accelerator
in the itemfactory's accel group.
* gtk/gtklabel.[ch]: Add support for a pattern arg -
which is a string. If an '_' appears in this string,
the corresponding position in the label is underlined.
Add gtk_label_parse_uline() convenience function which
takes a string with embedded underlines, sets the
pattern and label, and returns the accelerator keyval.
* gtk/gtkmenu.[ch]: Make menus no longer a toplevel widget.
Instead, they create a GtkWindow and add themselves
to that. (When torn off, another new feature, they
create another GtkWindow to hold the torn off menu)
New function gtk_menu_set_tearoff_state()
* gtk/gtkenums.h gtk/gtkmenushell.[ch] gtk/gtkenums.h:
Added action signals for keyboard navigation of menus.
* gtk/gtkmenushell.c: Key press handler which activates
bindings for navigation, and accelerators, for handling
underline accelerators. Exported functions to select
and activate menu items in a menushell.
* gtk/testgtk.c: Added a new "Item Factory" test which
tests GtkItemFactory and the new keyboard navigation
of menus.
1998-08-12 16:49:13 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
2010-09-08 17:35:51 +00:00
|
|
|
GDK_KEY_Up, 0,
|
2008-08-12 14:37:03 +00:00
|
|
|
"move-current", 1,
|
Added gdk_text/string_extents() - too calculate all the metrics at once of
Tue Jul 21 12:42:01 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.h gdk/gdkfont.c: Added gdk_text/string_extents() -
too calculate all the metrics at once of a string, including
things which weren't calculated before.
* gtk/Makefile.am gtk/gtk.h gtk/gtktearoffmenu.[ch]: New
MenuItem type, that when put as the first thing in a
menu, makes the menu tearoff. Currently drawn as a
dashed line.
* gtk/gtkmenuitem.h gtk/gtkcheckmenuitem.c: Added a flag
"hide_on_activate" to the MenuItem class structure to allow
check and radio buttons to be changed with <Space> without
hiding the menu.
* gtk/gtkaccellabel.[ch]: Added new capabilities to set
a underline_group and underline_mods for the label -
accelerators added in the underline group matching
underline_mods will be displayed as an underline character.
This doesn't work - Save As needs to be underlined
as Save _As.
* gtk/gtkitemfactory.c:
- Create a AccelGroup for each MenuShell we create.
- If an '&' appears before a character 'c' in the path,
then make 'c' an accelerator in the menu's accel group,
and if the menuitem is menubar <alt>C an accelerator
in the itemfactory's accel group.
* gtk/gtklabel.[ch]: Add support for a pattern arg -
which is a string. If an '_' appears in this string,
the corresponding position in the label is underlined.
Add gtk_label_parse_uline() convenience function which
takes a string with embedded underlines, sets the
pattern and label, and returns the accelerator keyval.
* gtk/gtkmenu.[ch]: Make menus no longer a toplevel widget.
Instead, they create a GtkWindow and add themselves
to that. (When torn off, another new feature, they
create another GtkWindow to hold the torn off menu)
New function gtk_menu_set_tearoff_state()
* gtk/gtkenums.h gtk/gtkmenushell.[ch] gtk/gtkenums.h:
Added action signals for keyboard navigation of menus.
* gtk/gtkmenushell.c: Key press handler which activates
bindings for navigation, and accelerators, for handling
underline accelerators. Exported functions to select
and activate menu items in a menushell.
* gtk/testgtk.c: Added a new "Item Factory" test which
tests GtkItemFactory and the new keyboard navigation
of menus.
1998-08-12 16:49:13 +00:00
|
|
|
GTK_TYPE_MENU_DIRECTION_TYPE,
|
|
|
|
GTK_MENU_DIR_PARENT);
|
Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
2001-06-29 01:59:02 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
2010-09-08 17:35:51 +00:00
|
|
|
GDK_KEY_KP_Up, 0,
|
2008-08-12 14:37:03 +00:00
|
|
|
"move-current", 1,
|
Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
2001-06-29 01:59:02 +00:00
|
|
|
GTK_TYPE_MENU_DIRECTION_TYPE,
|
|
|
|
GTK_MENU_DIR_PARENT);
|
Added gdk_text/string_extents() - too calculate all the metrics at once of
Tue Jul 21 12:42:01 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.h gdk/gdkfont.c: Added gdk_text/string_extents() -
too calculate all the metrics at once of a string, including
things which weren't calculated before.
* gtk/Makefile.am gtk/gtk.h gtk/gtktearoffmenu.[ch]: New
MenuItem type, that when put as the first thing in a
menu, makes the menu tearoff. Currently drawn as a
dashed line.
* gtk/gtkmenuitem.h gtk/gtkcheckmenuitem.c: Added a flag
"hide_on_activate" to the MenuItem class structure to allow
check and radio buttons to be changed with <Space> without
hiding the menu.
* gtk/gtkaccellabel.[ch]: Added new capabilities to set
a underline_group and underline_mods for the label -
accelerators added in the underline group matching
underline_mods will be displayed as an underline character.
This doesn't work - Save As needs to be underlined
as Save _As.
* gtk/gtkitemfactory.c:
- Create a AccelGroup for each MenuShell we create.
- If an '&' appears before a character 'c' in the path,
then make 'c' an accelerator in the menu's accel group,
and if the menuitem is menubar <alt>C an accelerator
in the itemfactory's accel group.
* gtk/gtklabel.[ch]: Add support for a pattern arg -
which is a string. If an '_' appears in this string,
the corresponding position in the label is underlined.
Add gtk_label_parse_uline() convenience function which
takes a string with embedded underlines, sets the
pattern and label, and returns the accelerator keyval.
* gtk/gtkmenu.[ch]: Make menus no longer a toplevel widget.
Instead, they create a GtkWindow and add themselves
to that. (When torn off, another new feature, they
create another GtkWindow to hold the torn off menu)
New function gtk_menu_set_tearoff_state()
* gtk/gtkenums.h gtk/gtkmenushell.[ch] gtk/gtkenums.h:
Added action signals for keyboard navigation of menus.
* gtk/gtkmenushell.c: Key press handler which activates
bindings for navigation, and accelerators, for handling
underline accelerators. Exported functions to select
and activate menu items in a menushell.
* gtk/testgtk.c: Added a new "Item Factory" test which
tests GtkItemFactory and the new keyboard navigation
of menus.
1998-08-12 16:49:13 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
2010-09-08 17:35:51 +00:00
|
|
|
GDK_KEY_Down, 0,
|
2008-08-12 14:37:03 +00:00
|
|
|
"move-current", 1,
|
Added gdk_text/string_extents() - too calculate all the metrics at once of
Tue Jul 21 12:42:01 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.h gdk/gdkfont.c: Added gdk_text/string_extents() -
too calculate all the metrics at once of a string, including
things which weren't calculated before.
* gtk/Makefile.am gtk/gtk.h gtk/gtktearoffmenu.[ch]: New
MenuItem type, that when put as the first thing in a
menu, makes the menu tearoff. Currently drawn as a
dashed line.
* gtk/gtkmenuitem.h gtk/gtkcheckmenuitem.c: Added a flag
"hide_on_activate" to the MenuItem class structure to allow
check and radio buttons to be changed with <Space> without
hiding the menu.
* gtk/gtkaccellabel.[ch]: Added new capabilities to set
a underline_group and underline_mods for the label -
accelerators added in the underline group matching
underline_mods will be displayed as an underline character.
This doesn't work - Save As needs to be underlined
as Save _As.
* gtk/gtkitemfactory.c:
- Create a AccelGroup for each MenuShell we create.
- If an '&' appears before a character 'c' in the path,
then make 'c' an accelerator in the menu's accel group,
and if the menuitem is menubar <alt>C an accelerator
in the itemfactory's accel group.
* gtk/gtklabel.[ch]: Add support for a pattern arg -
which is a string. If an '_' appears in this string,
the corresponding position in the label is underlined.
Add gtk_label_parse_uline() convenience function which
takes a string with embedded underlines, sets the
pattern and label, and returns the accelerator keyval.
* gtk/gtkmenu.[ch]: Make menus no longer a toplevel widget.
Instead, they create a GtkWindow and add themselves
to that. (When torn off, another new feature, they
create another GtkWindow to hold the torn off menu)
New function gtk_menu_set_tearoff_state()
* gtk/gtkenums.h gtk/gtkmenushell.[ch] gtk/gtkenums.h:
Added action signals for keyboard navigation of menus.
* gtk/gtkmenushell.c: Key press handler which activates
bindings for navigation, and accelerators, for handling
underline accelerators. Exported functions to select
and activate menu items in a menushell.
* gtk/testgtk.c: Added a new "Item Factory" test which
tests GtkItemFactory and the new keyboard navigation
of menus.
1998-08-12 16:49:13 +00:00
|
|
|
GTK_TYPE_MENU_DIRECTION_TYPE,
|
|
|
|
GTK_MENU_DIR_CHILD);
|
Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
2001-06-29 01:59:02 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
2010-09-08 17:35:51 +00:00
|
|
|
GDK_KEY_KP_Down, 0,
|
2008-08-12 14:37:03 +00:00
|
|
|
"move-current", 1,
|
Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
2001-06-29 01:59:02 +00:00
|
|
|
GTK_TYPE_MENU_DIRECTION_TYPE,
|
|
|
|
GTK_MENU_DIR_CHILD);
|
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
|
|
|
|
2005-02-11 07:15:11 +00:00
|
|
|
/**
|
|
|
|
* GtkMenuBar:pack-direction:
|
|
|
|
*
|
|
|
|
* The pack direction of the menubar. It determines how
|
|
|
|
* menuitems are arranged in the menubar.
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (gobject_class,
|
2014-06-09 13:06:32 +00:00
|
|
|
PROP_PACK_DIRECTION,
|
|
|
|
g_param_spec_enum ("pack-direction",
|
|
|
|
P_("Pack direction"),
|
|
|
|
P_("The pack direction of the menubar"),
|
|
|
|
GTK_TYPE_PACK_DIRECTION,
|
|
|
|
GTK_PACK_DIRECTION_LTR,
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2005-02-11 07:15:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GtkMenuBar:child-pack-direction:
|
|
|
|
*
|
2008-12-30 20:47:03 +00:00
|
|
|
* The child pack direction of the menubar. It determines how
|
2005-02-11 07:15:11 +00:00
|
|
|
* the widgets contained in child menuitems are arranged.
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (gobject_class,
|
2014-06-09 13:06:32 +00:00
|
|
|
PROP_CHILD_PACK_DIRECTION,
|
|
|
|
g_param_spec_enum ("child-pack-direction",
|
|
|
|
P_("Child Pack direction"),
|
|
|
|
P_("The child pack direction of the menubar"),
|
|
|
|
GTK_TYPE_PACK_DIRECTION,
|
|
|
|
GTK_PACK_DIRECTION_LTR,
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2015-11-03 04:49:20 +00:00
|
|
|
|
|
|
|
gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_MENU_BAR);
|
|
|
|
gtk_widget_class_set_css_name (widget_class, "menubar");
|
1998-11-16 09:05:26 +00:00
|
|
|
}
|
2007-09-14 09:17:59 +00:00
|
|
|
|
|
|
|
static void
|
2010-06-28 21:21:58 +00:00
|
|
|
gtk_menu_bar_init (GtkMenuBar *menu_bar)
|
2007-09-14 09:17:59 +00:00
|
|
|
{
|
2016-01-01 23:23:27 +00:00
|
|
|
GtkMenuBarPrivate *priv;
|
|
|
|
GtkWidget *widget;
|
|
|
|
GtkCssNode *widget_node;
|
|
|
|
|
|
|
|
priv = menu_bar->priv = gtk_menu_bar_get_instance_private (menu_bar);
|
|
|
|
|
|
|
|
widget = GTK_WIDGET (menu_bar);
|
|
|
|
widget_node = gtk_widget_get_css_node (widget);
|
|
|
|
priv->gadget = gtk_css_custom_gadget_new_for_node (widget_node,
|
|
|
|
widget,
|
|
|
|
gtk_menu_bar_measure,
|
|
|
|
gtk_menu_bar_allocate,
|
|
|
|
gtk_menu_bar_render,
|
|
|
|
NULL, NULL);
|
2007-09-14 09:17:59 +00:00
|
|
|
}
|
|
|
|
|
2011-01-14 03:11:22 +00:00
|
|
|
/**
|
|
|
|
* gtk_menu_bar_new:
|
|
|
|
*
|
|
|
|
* Creates a new #GtkMenuBar
|
|
|
|
*
|
|
|
|
* Returns: the new menu bar, as a #GtkWidget
|
|
|
|
*/
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkWidget*
|
1998-05-03 22:41:32 +00:00
|
|
|
gtk_menu_bar_new (void)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2002-10-05 01:51:16 +00:00
|
|
|
return g_object_new (GTK_TYPE_MENU_BAR, NULL);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2016-01-01 23:23:27 +00:00
|
|
|
static void
|
|
|
|
gtk_menu_bar_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
GtkMenuBar *menu_bar = GTK_MENU_BAR (object);
|
|
|
|
|
|
|
|
g_clear_object (&menu_bar->priv->gadget);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (gtk_menu_bar_parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
2005-02-11 07:15:11 +00:00
|
|
|
static void
|
|
|
|
gtk_menu_bar_set_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GtkMenuBar *menubar = GTK_MENU_BAR (object);
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_PACK_DIRECTION:
|
|
|
|
gtk_menu_bar_set_pack_direction (menubar, g_value_get_enum (value));
|
|
|
|
break;
|
|
|
|
case PROP_CHILD_PACK_DIRECTION:
|
|
|
|
gtk_menu_bar_set_child_pack_direction (menubar, g_value_get_enum (value));
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_menu_bar_get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GtkMenuBar *menubar = GTK_MENU_BAR (object);
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_PACK_DIRECTION:
|
|
|
|
g_value_set_enum (value, gtk_menu_bar_get_pack_direction (menubar));
|
|
|
|
break;
|
|
|
|
case PROP_CHILD_PACK_DIRECTION:
|
|
|
|
g_value_set_enum (value, gtk_menu_bar_get_child_pack_direction (menubar));
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void
|
2016-01-01 23:23:27 +00:00
|
|
|
gtk_menu_bar_measure (GtkCssGadget *gadget,
|
|
|
|
GtkOrientation orientation,
|
|
|
|
int size,
|
|
|
|
int *minimum,
|
|
|
|
int *natural,
|
|
|
|
int *minimum_baseline,
|
|
|
|
int *natural_baseline,
|
|
|
|
gpointer data)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2016-01-01 23:23:27 +00:00
|
|
|
GtkWidget *widget = gtk_css_gadget_get_owner (gadget);
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkMenuBar *menu_bar;
|
2005-02-11 07:15:11 +00:00
|
|
|
GtkMenuBarPrivate *priv;
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkMenuShell *menu_shell;
|
|
|
|
GtkWidget *child;
|
|
|
|
GList *children;
|
2011-04-30 04:31:01 +00:00
|
|
|
gboolean use_toggle_size, use_maximize;
|
2011-04-30 04:34:58 +00:00
|
|
|
gint child_minimum, child_natural;
|
|
|
|
|
|
|
|
*minimum = 0;
|
|
|
|
*natural = 0;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2011-04-30 03:10:55 +00:00
|
|
|
menu_bar = GTK_MENU_BAR (widget);
|
|
|
|
menu_shell = GTK_MENU_SHELL (widget);
|
|
|
|
priv = menu_bar->priv;
|
|
|
|
|
|
|
|
children = menu_shell->priv->children;
|
|
|
|
|
2011-04-30 04:16:18 +00:00
|
|
|
if (priv->child_pack_direction == GTK_PACK_DIRECTION_LTR ||
|
|
|
|
priv->child_pack_direction == GTK_PACK_DIRECTION_RTL)
|
|
|
|
use_toggle_size = (orientation == GTK_ORIENTATION_HORIZONTAL);
|
|
|
|
else
|
|
|
|
use_toggle_size = (orientation == GTK_ORIENTATION_VERTICAL);
|
|
|
|
|
2011-04-30 04:31:01 +00:00
|
|
|
if (priv->pack_direction == GTK_PACK_DIRECTION_LTR ||
|
|
|
|
priv->pack_direction == GTK_PACK_DIRECTION_RTL)
|
|
|
|
use_maximize = (orientation == GTK_ORIENTATION_VERTICAL);
|
|
|
|
else
|
|
|
|
use_maximize = (orientation == GTK_ORIENTATION_HORIZONTAL);
|
|
|
|
|
2011-04-30 03:10:55 +00:00
|
|
|
while (children)
|
|
|
|
{
|
|
|
|
child = children->data;
|
|
|
|
children = children->next;
|
|
|
|
|
|
|
|
if (gtk_widget_get_visible (child))
|
|
|
|
{
|
2016-10-22 14:06:14 +00:00
|
|
|
gtk_widget_measure (child,
|
|
|
|
orientation,
|
|
|
|
size,
|
|
|
|
&child_minimum, &child_natural,
|
|
|
|
NULL, NULL);
|
2011-04-30 03:10:55 +00:00
|
|
|
|
2011-04-30 04:16:18 +00:00
|
|
|
if (use_toggle_size)
|
|
|
|
{
|
|
|
|
gint toggle_size;
|
|
|
|
|
|
|
|
gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child),
|
|
|
|
&toggle_size);
|
|
|
|
|
2011-04-30 04:34:58 +00:00
|
|
|
child_minimum += toggle_size;
|
|
|
|
child_natural += toggle_size;
|
2011-04-30 04:16:18 +00:00
|
|
|
}
|
2011-04-30 03:10:55 +00:00
|
|
|
|
2011-04-30 04:31:01 +00:00
|
|
|
if (use_maximize)
|
2011-04-30 04:34:58 +00:00
|
|
|
{
|
|
|
|
*minimum = MAX (*minimum, child_minimum);
|
|
|
|
*natural = MAX (*natural, child_natural);
|
|
|
|
}
|
2011-04-30 03:10:55 +00:00
|
|
|
else
|
2011-04-30 04:34:58 +00:00
|
|
|
{
|
|
|
|
*minimum += child_minimum;
|
|
|
|
*natural += child_natural;
|
|
|
|
}
|
2011-04-30 03:10:55 +00:00
|
|
|
}
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2010-10-27 05:30:07 +00:00
|
|
|
static void
|
2016-10-22 14:06:14 +00:00
|
|
|
gtk_menu_bar_measure_ (GtkWidget *widget,
|
|
|
|
GtkOrientation orientation,
|
|
|
|
int for_size,
|
|
|
|
int *minimum,
|
|
|
|
int *natural,
|
|
|
|
int *minimum_baseline,
|
|
|
|
int *natural_baseline)
|
2011-04-30 04:41:56 +00:00
|
|
|
{
|
2016-01-01 23:23:27 +00:00
|
|
|
gtk_css_gadget_get_preferred_size (GTK_MENU_BAR (widget)->priv->gadget,
|
2016-10-22 14:06:14 +00:00
|
|
|
orientation,
|
|
|
|
for_size,
|
2016-01-01 23:23:27 +00:00
|
|
|
minimum, natural,
|
2016-10-22 14:06:14 +00:00
|
|
|
minimum_baseline, natural_baseline);
|
2010-10-27 05:30:07 +00:00
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void
|
2016-01-01 23:23:27 +00:00
|
|
|
gtk_menu_bar_allocate (GtkCssGadget *gadget,
|
|
|
|
const GtkAllocation *allocation,
|
|
|
|
int baseline,
|
|
|
|
GtkAllocation *out_clip,
|
|
|
|
gpointer data)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2016-01-01 23:23:27 +00:00
|
|
|
GtkWidget *widget = gtk_css_gadget_get_owner (gadget);
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkMenuBar *menu_bar;
|
|
|
|
GtkMenuShell *menu_shell;
|
2005-02-11 07:15:11 +00:00
|
|
|
GtkMenuBarPrivate *priv;
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkWidget *child;
|
|
|
|
GList *children;
|
2011-05-01 05:06:06 +00:00
|
|
|
GtkAllocation remaining_space;
|
|
|
|
GArray *requested_sizes;
|
|
|
|
gint toggle_size;
|
|
|
|
guint i;
|
2002-11-02 00:18:14 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
menu_bar = GTK_MENU_BAR (widget);
|
|
|
|
menu_shell = GTK_MENU_SHELL (widget);
|
2010-06-28 21:21:58 +00:00
|
|
|
priv = menu_bar->priv;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
if (!menu_shell->priv->children)
|
|
|
|
return;
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
remaining_space = *allocation;
|
|
|
|
requested_sizes = g_array_new (FALSE, FALSE, sizeof (GtkRequestedSize));
|
2010-12-23 23:21:53 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
if (priv->pack_direction == GTK_PACK_DIRECTION_LTR ||
|
|
|
|
priv->pack_direction == GTK_PACK_DIRECTION_RTL)
|
|
|
|
{
|
|
|
|
int size = remaining_space.width;
|
|
|
|
gboolean ltr = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) == (priv->pack_direction == GTK_PACK_DIRECTION_LTR);
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
for (children = menu_shell->priv->children; children; children = children->next)
|
|
|
|
{
|
|
|
|
GtkRequestedSize request;
|
|
|
|
child = children->data;
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
if (!gtk_widget_get_visible (child))
|
|
|
|
continue;
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
request.data = child;
|
|
|
|
gtk_widget_get_preferred_width_for_height (child,
|
|
|
|
remaining_space.height,
|
|
|
|
&request.minimum_size,
|
|
|
|
&request.natural_size);
|
|
|
|
gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child),
|
|
|
|
&toggle_size);
|
|
|
|
request.minimum_size += toggle_size;
|
|
|
|
request.natural_size += toggle_size;
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
gtk_menu_item_toggle_size_allocate (GTK_MENU_ITEM (child), toggle_size);
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
g_array_append_val (requested_sizes, request);
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
size -= request.minimum_size;
|
|
|
|
}
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
size = gtk_distribute_natural_allocation (size,
|
|
|
|
requested_sizes->len,
|
|
|
|
(GtkRequestedSize *) requested_sizes->data);
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
for (i = 0; i < requested_sizes->len; i++)
|
|
|
|
{
|
|
|
|
GtkAllocation child_allocation = remaining_space;
|
|
|
|
GtkRequestedSize *request = &g_array_index (requested_sizes, GtkRequestedSize, i);
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
child_allocation.width = request->minimum_size;
|
|
|
|
remaining_space.width -= request->minimum_size;
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
if (i + 1 == requested_sizes->len && GTK_IS_MENU_ITEM (request->data) &&
|
|
|
|
GTK_MENU_ITEM (request->data)->priv->right_justify)
|
|
|
|
ltr = !ltr;
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
if (ltr)
|
|
|
|
remaining_space.x += request->minimum_size;
|
|
|
|
else
|
|
|
|
child_allocation.x += remaining_space.width;
|
2010-12-23 23:21:53 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
gtk_widget_size_allocate (request->data, &child_allocation);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int size = remaining_space.height;
|
|
|
|
gboolean ttb = (priv->pack_direction == GTK_PACK_DIRECTION_TTB);
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
for (children = menu_shell->priv->children; children; children = children->next)
|
|
|
|
{
|
|
|
|
GtkRequestedSize request;
|
|
|
|
child = children->data;
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
if (!gtk_widget_get_visible (child))
|
|
|
|
continue;
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
request.data = child;
|
|
|
|
gtk_widget_get_preferred_height_for_width (child,
|
|
|
|
remaining_space.width,
|
|
|
|
&request.minimum_size,
|
|
|
|
&request.natural_size);
|
|
|
|
gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child),
|
|
|
|
&toggle_size);
|
|
|
|
request.minimum_size += toggle_size;
|
|
|
|
request.natural_size += toggle_size;
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
gtk_menu_item_toggle_size_allocate (GTK_MENU_ITEM (child), toggle_size);
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
g_array_append_val (requested_sizes, request);
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
size -= request.minimum_size;
|
|
|
|
}
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
size = gtk_distribute_natural_allocation (size,
|
|
|
|
requested_sizes->len,
|
|
|
|
(GtkRequestedSize *) requested_sizes->data);
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
for (i = 0; i < requested_sizes->len; i++)
|
|
|
|
{
|
|
|
|
GtkAllocation child_allocation = remaining_space;
|
|
|
|
GtkRequestedSize *request = &g_array_index (requested_sizes, GtkRequestedSize, i);
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
child_allocation.height = request->minimum_size;
|
|
|
|
remaining_space.height -= request->minimum_size;
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
if (i + 1 == requested_sizes->len && GTK_IS_MENU_ITEM (request->data) &&
|
|
|
|
GTK_MENU_ITEM (request->data)->priv->right_justify)
|
|
|
|
ttb = !ttb;
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
if (ttb)
|
|
|
|
remaining_space.y += request->minimum_size;
|
|
|
|
else
|
|
|
|
child_allocation.y += remaining_space.height;
|
2011-05-01 05:06:06 +00:00
|
|
|
|
2016-01-02 22:59:56 +00:00
|
|
|
gtk_widget_size_allocate (request->data, &child_allocation);
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
2016-01-02 22:59:56 +00:00
|
|
|
|
|
|
|
g_array_free (requested_sizes, TRUE);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
2016-01-02 22:59:56 +00:00
|
|
|
|
2016-01-01 23:23:27 +00:00
|
|
|
static void
|
|
|
|
gtk_menu_bar_size_allocate (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2016-11-02 16:50:12 +00:00
|
|
|
GtkMenuBar *menu_bar = GTK_MENU_BAR (widget);
|
|
|
|
GtkMenuBarPrivate *priv = menu_bar->priv;
|
2016-11-03 20:29:07 +00:00
|
|
|
GtkAllocation clip;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2016-11-03 20:29:07 +00:00
|
|
|
GTK_WIDGET_CLASS (gtk_menu_bar_parent_class)->size_allocate (widget, allocation);
|
2010-11-21 18:38:52 +00:00
|
|
|
|
2016-11-02 16:50:12 +00:00
|
|
|
gtk_css_gadget_allocate (priv->gadget,
|
2016-11-03 20:29:07 +00:00
|
|
|
allocation,
|
2016-01-01 23:23:27 +00:00
|
|
|
gtk_widget_get_allocated_baseline (widget),
|
|
|
|
&clip);
|
|
|
|
|
|
|
|
gtk_widget_set_clip (widget, &clip);
|
|
|
|
}
|
2012-09-17 03:25:40 +00:00
|
|
|
|
2016-01-01 23:23:27 +00:00
|
|
|
static gboolean
|
|
|
|
gtk_menu_bar_render (GtkCssGadget *gadget,
|
|
|
|
cairo_t *cr,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int width,
|
|
|
|
int height,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GtkWidget *widget = gtk_css_gadget_get_owner (gadget);
|
2010-09-06 15:23:40 +00:00
|
|
|
|
|
|
|
GTK_WIDGET_CLASS (gtk_menu_bar_parent_class)->draw (widget, cr);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
|
|
|
|
2016-01-01 23:23:27 +00:00
|
|
|
static gboolean
|
|
|
|
gtk_menu_bar_draw (GtkWidget *widget,
|
|
|
|
cairo_t *cr)
|
|
|
|
{
|
|
|
|
gtk_css_gadget_draw (GTK_MENU_BAR (widget)->priv->gadget, cr);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2002-03-01 01:05:11 +00:00
|
|
|
static GList *
|
|
|
|
get_menu_bars (GtkWindow *window)
|
|
|
|
{
|
|
|
|
return g_object_get_data (G_OBJECT (window), "gtk-menu-bar-list");
|
|
|
|
}
|
|
|
|
|
2014-03-04 11:06:30 +00:00
|
|
|
GList *
|
|
|
|
_gtk_menu_bar_get_viewable_menu_bars (GtkWindow *window)
|
2002-06-12 20:42:44 +00:00
|
|
|
{
|
|
|
|
GList *menu_bars;
|
|
|
|
GList *viewable_menu_bars = NULL;
|
|
|
|
|
|
|
|
for (menu_bars = get_menu_bars (window);
|
|
|
|
menu_bars;
|
|
|
|
menu_bars = menu_bars->next)
|
|
|
|
{
|
|
|
|
GtkWidget *widget = menu_bars->data;
|
|
|
|
gboolean viewable = TRUE;
|
|
|
|
|
|
|
|
while (widget)
|
|
|
|
{
|
2010-03-02 04:19:28 +00:00
|
|
|
if (!gtk_widget_get_mapped (widget))
|
2002-06-12 20:42:44 +00:00
|
|
|
viewable = FALSE;
|
2010-08-11 21:08:21 +00:00
|
|
|
|
|
|
|
widget = gtk_widget_get_parent (widget);
|
2002-06-12 20:42:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (viewable)
|
|
|
|
viewable_menu_bars = g_list_prepend (viewable_menu_bars, menu_bars->data);
|
|
|
|
}
|
|
|
|
|
|
|
|
return g_list_reverse (viewable_menu_bars);
|
|
|
|
}
|
|
|
|
|
2002-03-01 01:05:11 +00:00
|
|
|
static void
|
|
|
|
set_menu_bars (GtkWindow *window,
|
|
|
|
GList *menubars)
|
|
|
|
{
|
2005-09-01 05:11:46 +00:00
|
|
|
g_object_set_data (G_OBJECT (window), I_("gtk-menu-bar-list"), menubars);
|
2002-03-01 01:05:11 +00:00
|
|
|
}
|
|
|
|
|
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
|
|
|
static void
|
|
|
|
add_to_window (GtkWindow *window,
|
|
|
|
GtkMenuBar *menubar)
|
|
|
|
{
|
2002-03-01 01:05:11 +00:00
|
|
|
GList *menubars = get_menu_bars (window);
|
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
|
|
|
|
2002-03-01 01:05:11 +00:00
|
|
|
set_menu_bars (window, g_list_prepend (menubars, menubar));
|
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
remove_from_window (GtkWindow *window,
|
|
|
|
GtkMenuBar *menubar)
|
|
|
|
{
|
2002-03-01 01:05:11 +00:00
|
|
|
GList *menubars = get_menu_bars (window);
|
|
|
|
|
|
|
|
menubars = g_list_remove (menubars, menubar);
|
|
|
|
set_menu_bars (window, menubars);
|
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-07-01 00:57:21 +00:00
|
|
|
gtk_menu_bar_hierarchy_changed (GtkWidget *widget,
|
|
|
|
GtkWidget *old_toplevel)
|
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
|
|
|
{
|
|
|
|
GtkWidget *toplevel;
|
|
|
|
GtkMenuBar *menubar;
|
|
|
|
|
|
|
|
menubar = GTK_MENU_BAR (widget);
|
|
|
|
|
|
|
|
toplevel = gtk_widget_get_toplevel (widget);
|
|
|
|
|
2001-07-05 02:58:34 +00:00
|
|
|
if (old_toplevel)
|
2001-07-18 04:31:11 +00:00
|
|
|
remove_from_window (GTK_WINDOW (old_toplevel), menubar);
|
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
|
|
|
|
2010-01-04 06:49:26 +00:00
|
|
|
if (gtk_widget_is_toplevel (toplevel))
|
2001-07-01 00:57:21 +00:00
|
|
|
add_to_window (GTK_WINDOW (toplevel), menubar);
|
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
|
|
|
}
|
|
|
|
|
2002-03-03 22:15:39 +00:00
|
|
|
/**
|
|
|
|
* _gtk_menu_bar_cycle_focus:
|
|
|
|
* @menubar: a #GtkMenuBar
|
|
|
|
* @dir: direction in which to cycle the focus
|
|
|
|
*
|
|
|
|
* Move the focus between menubars in the toplevel.
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
_gtk_menu_bar_cycle_focus (GtkMenuBar *menubar,
|
|
|
|
GtkDirectionType dir)
|
2002-03-01 01:05:11 +00:00
|
|
|
{
|
|
|
|
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (menubar));
|
2002-07-25 18:17:28 +00:00
|
|
|
GtkMenuItem *to_activate = NULL;
|
2002-03-01 01:05:11 +00:00
|
|
|
|
2010-01-04 06:49:26 +00:00
|
|
|
if (gtk_widget_is_toplevel (toplevel))
|
2002-03-01 01:05:11 +00:00
|
|
|
{
|
2014-03-04 11:06:30 +00:00
|
|
|
GList *tmp_menubars = _gtk_menu_bar_get_viewable_menu_bars (GTK_WINDOW (toplevel));
|
2002-06-12 20:42:44 +00:00
|
|
|
GList *menubars;
|
2002-03-01 01:05:11 +00:00
|
|
|
GList *current;
|
|
|
|
|
2002-06-12 20:42:44 +00:00
|
|
|
menubars = _gtk_container_focus_sort (GTK_CONTAINER (toplevel), tmp_menubars,
|
2002-03-01 01:05:11 +00:00
|
|
|
dir, GTK_WIDGET (menubar));
|
2002-06-12 20:42:44 +00:00
|
|
|
g_list_free (tmp_menubars);
|
2002-03-01 01:05:11 +00:00
|
|
|
|
|
|
|
if (menubars)
|
|
|
|
{
|
|
|
|
current = g_list_find (menubars, menubar);
|
2002-07-25 18:17:28 +00:00
|
|
|
|
2002-03-01 01:05:11 +00:00
|
|
|
if (current && current->next)
|
|
|
|
{
|
2002-07-25 18:17:28 +00:00
|
|
|
GtkMenuShell *new_menushell = GTK_MENU_SHELL (current->next->data);
|
2010-12-23 23:21:53 +00:00
|
|
|
if (new_menushell->priv->children)
|
|
|
|
to_activate = new_menushell->priv->children->data;
|
2002-03-01 01:05:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_list_free (menubars);
|
|
|
|
}
|
2002-07-25 18:17:28 +00:00
|
|
|
|
2003-12-21 00:59:46 +00:00
|
|
|
gtk_menu_shell_cancel (GTK_MENU_SHELL (menubar));
|
2002-07-25 18:17:28 +00:00
|
|
|
|
|
|
|
if (to_activate)
|
|
|
|
g_signal_emit_by_name (to_activate, "activate_item");
|
2002-03-01 01:05:11 +00:00
|
|
|
}
|
|
|
|
|
gtkmenu.c, gtkmenubar.c, gtkmenuitem.c, gtkmenushell.c, gtkmenushell.h,
Sun Oct 20 23:58:03 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtkmenu.c, gtkmenubar.c, gtkmenuitem.c, gtkmenushell.c,
gtkmenushell.h, gtkmenushell.h
- make the delay before submenus appear below menu bars a
GtkSetting
- make the delay before submenus pops up a GtkSetting
- make the stay up triangle slightly larger
- don't pop up the first submenu immediately.
- make the default delay for submenus 225 ms, and 0 for menubars.
- make the default delay before popping down inside the stay-up
triangle 1000 ms
Fixes #74950
2002-10-20 22:29:57 +00:00
|
|
|
static gint
|
|
|
|
gtk_menu_bar_get_popup_delay (GtkMenuShell *menu_shell)
|
|
|
|
{
|
2013-06-26 18:08:37 +00:00
|
|
|
return MENU_BAR_POPUP_DELAY;
|
gtkmenu.c, gtkmenubar.c, gtkmenuitem.c, gtkmenushell.c, gtkmenushell.h,
Sun Oct 20 23:58:03 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtkmenu.c, gtkmenubar.c, gtkmenuitem.c, gtkmenushell.c,
gtkmenushell.h, gtkmenushell.h
- make the delay before submenus appear below menu bars a
GtkSetting
- make the delay before submenus pops up a GtkSetting
- make the stay up triangle slightly larger
- don't pop up the first submenu immediately.
- make the default delay for submenus 225 ms, and 0 for menubars.
- make the default delay before popping down inside the stay-up
triangle 1000 ms
Fixes #74950
2002-10-20 22:29:57 +00:00
|
|
|
}
|
2005-02-11 07:15:11 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_menu_bar_move_current (GtkMenuShell *menu_shell,
|
2007-09-14 09:17:59 +00:00
|
|
|
GtkMenuDirectionType direction)
|
2005-02-11 07:15:11 +00:00
|
|
|
{
|
|
|
|
GtkMenuBar *menubar = GTK_MENU_BAR (menu_shell);
|
|
|
|
GtkTextDirection text_dir;
|
|
|
|
GtkPackDirection pack_dir;
|
|
|
|
|
|
|
|
text_dir = gtk_widget_get_direction (GTK_WIDGET (menubar));
|
|
|
|
pack_dir = gtk_menu_bar_get_pack_direction (menubar);
|
|
|
|
|
|
|
|
if (pack_dir == GTK_PACK_DIRECTION_LTR || pack_dir == GTK_PACK_DIRECTION_RTL)
|
|
|
|
{
|
|
|
|
if ((text_dir == GTK_TEXT_DIR_RTL) == (pack_dir == GTK_PACK_DIRECTION_LTR))
|
|
|
|
{
|
|
|
|
switch (direction)
|
|
|
|
{
|
|
|
|
case GTK_MENU_DIR_PREV:
|
|
|
|
direction = GTK_MENU_DIR_NEXT;
|
|
|
|
break;
|
|
|
|
case GTK_MENU_DIR_NEXT:
|
|
|
|
direction = GTK_MENU_DIR_PREV;
|
|
|
|
break;
|
|
|
|
default: ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch (direction)
|
|
|
|
{
|
|
|
|
case GTK_MENU_DIR_PARENT:
|
|
|
|
if ((text_dir == GTK_TEXT_DIR_LTR) == (pack_dir == GTK_PACK_DIRECTION_TTB))
|
|
|
|
direction = GTK_MENU_DIR_PREV;
|
|
|
|
else
|
|
|
|
direction = GTK_MENU_DIR_NEXT;
|
|
|
|
break;
|
|
|
|
case GTK_MENU_DIR_CHILD:
|
|
|
|
if ((text_dir == GTK_TEXT_DIR_LTR) == (pack_dir == GTK_PACK_DIRECTION_TTB))
|
|
|
|
direction = GTK_MENU_DIR_NEXT;
|
|
|
|
else
|
|
|
|
direction = GTK_MENU_DIR_PREV;
|
|
|
|
break;
|
|
|
|
case GTK_MENU_DIR_PREV:
|
|
|
|
if (text_dir == GTK_TEXT_DIR_RTL)
|
|
|
|
direction = GTK_MENU_DIR_CHILD;
|
|
|
|
else
|
|
|
|
direction = GTK_MENU_DIR_PARENT;
|
|
|
|
break;
|
|
|
|
case GTK_MENU_DIR_NEXT:
|
|
|
|
if (text_dir == GTK_TEXT_DIR_RTL)
|
|
|
|
direction = GTK_MENU_DIR_PARENT;
|
|
|
|
else
|
|
|
|
direction = GTK_MENU_DIR_CHILD;
|
|
|
|
break;
|
|
|
|
default: ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-05-03 17:07:09 +00:00
|
|
|
GTK_MENU_SHELL_CLASS (gtk_menu_bar_parent_class)->move_current (menu_shell, direction);
|
2005-02-11 07:15:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_menu_bar_get_pack_direction:
|
|
|
|
* @menubar: a #GtkMenuBar
|
|
|
|
*
|
2008-12-30 20:47:03 +00:00
|
|
|
* Retrieves the current pack direction of the menubar.
|
|
|
|
* See gtk_menu_bar_set_pack_direction().
|
2005-02-11 07:15:11 +00:00
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
* Returns: the pack direction
|
2005-02-11 07:15:11 +00:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
2008-12-30 20:47:03 +00:00
|
|
|
*/
|
2005-02-11 07:15:11 +00:00
|
|
|
GtkPackDirection
|
|
|
|
gtk_menu_bar_get_pack_direction (GtkMenuBar *menubar)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_MENU_BAR (menubar),
|
|
|
|
GTK_PACK_DIRECTION_LTR);
|
|
|
|
|
2010-06-28 21:21:58 +00:00
|
|
|
return menubar->priv->pack_direction;
|
2005-02-11 07:15:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_menu_bar_set_pack_direction:
|
2008-12-30 20:47:03 +00:00
|
|
|
* @menubar: a #GtkMenuBar
|
|
|
|
* @pack_dir: a new #GtkPackDirection
|
2005-02-11 07:15:11 +00:00
|
|
|
*
|
|
|
|
* Sets how items should be packed inside a menubar.
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
2008-12-30 20:47:03 +00:00
|
|
|
*/
|
2007-09-14 09:17:59 +00:00
|
|
|
void
|
|
|
|
gtk_menu_bar_set_pack_direction (GtkMenuBar *menubar,
|
|
|
|
GtkPackDirection pack_dir)
|
2005-02-11 07:15:11 +00:00
|
|
|
{
|
|
|
|
GtkMenuBarPrivate *priv;
|
2005-07-04 06:51:57 +00:00
|
|
|
GList *l;
|
2005-02-11 07:15:11 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_MENU_BAR (menubar));
|
|
|
|
|
2010-06-28 21:21:58 +00:00
|
|
|
priv = menubar->priv;
|
2005-02-11 07:15:11 +00:00
|
|
|
|
|
|
|
if (priv->pack_direction != pack_dir)
|
|
|
|
{
|
|
|
|
priv->pack_direction = pack_dir;
|
|
|
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (menubar));
|
2005-07-04 06:51:57 +00:00
|
|
|
|
2010-12-23 23:21:53 +00:00
|
|
|
for (l = GTK_MENU_SHELL (menubar)->priv->children; l; l = l->next)
|
2005-07-04 06:51:57 +00:00
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (l->data));
|
|
|
|
|
2005-02-11 07:15:11 +00:00
|
|
|
g_object_notify (G_OBJECT (menubar), "pack-direction");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_menu_bar_get_child_pack_direction:
|
|
|
|
* @menubar: a #GtkMenuBar
|
|
|
|
*
|
2008-12-30 20:47:03 +00:00
|
|
|
* Retrieves the current child pack direction of the menubar.
|
|
|
|
* See gtk_menu_bar_set_child_pack_direction().
|
2005-02-11 07:15:11 +00:00
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
* Returns: the child pack direction
|
2005-02-11 07:15:11 +00:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
2008-12-30 20:47:03 +00:00
|
|
|
*/
|
2005-02-11 07:15:11 +00:00
|
|
|
GtkPackDirection
|
|
|
|
gtk_menu_bar_get_child_pack_direction (GtkMenuBar *menubar)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_MENU_BAR (menubar),
|
|
|
|
GTK_PACK_DIRECTION_LTR);
|
|
|
|
|
2010-06-28 21:21:58 +00:00
|
|
|
return menubar->priv->child_pack_direction;
|
2005-02-11 07:15:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_menu_bar_set_child_pack_direction:
|
2008-12-30 20:47:03 +00:00
|
|
|
* @menubar: a #GtkMenuBar
|
|
|
|
* @child_pack_dir: a new #GtkPackDirection
|
2005-02-11 07:15:11 +00:00
|
|
|
*
|
|
|
|
* Sets how widgets should be packed inside the children of a menubar.
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
2008-12-30 20:47:03 +00:00
|
|
|
*/
|
2007-09-14 09:17:59 +00:00
|
|
|
void
|
|
|
|
gtk_menu_bar_set_child_pack_direction (GtkMenuBar *menubar,
|
|
|
|
GtkPackDirection child_pack_dir)
|
2005-02-11 07:15:11 +00:00
|
|
|
{
|
|
|
|
GtkMenuBarPrivate *priv;
|
2005-07-04 06:51:57 +00:00
|
|
|
GList *l;
|
2005-02-11 07:15:11 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_MENU_BAR (menubar));
|
|
|
|
|
2010-06-28 21:21:58 +00:00
|
|
|
priv = menubar->priv;
|
2005-02-11 07:15:11 +00:00
|
|
|
|
|
|
|
if (priv->child_pack_direction != child_pack_dir)
|
|
|
|
{
|
|
|
|
priv->child_pack_direction = child_pack_dir;
|
|
|
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (menubar));
|
2005-07-04 06:51:57 +00:00
|
|
|
|
2010-12-23 23:21:53 +00:00
|
|
|
for (l = GTK_MENU_SHELL (menubar)->priv->children; l; l = l->next)
|
2005-07-04 06:51:57 +00:00
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (l->data));
|
|
|
|
|
2005-02-11 07:15:11 +00:00
|
|
|
g_object_notify (G_OBJECT (menubar), "child-pack-direction");
|
|
|
|
}
|
|
|
|
}
|
2012-09-11 15:38:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_menu_bar_new_from_model:
|
|
|
|
* @model: a #GMenuModel
|
|
|
|
*
|
|
|
|
* Creates a new #GtkMenuBar and populates it with menu items
|
|
|
|
* and submenus according to @model.
|
|
|
|
*
|
|
|
|
* The created menu items are connected to actions found in the
|
|
|
|
* #GtkApplicationWindow to which the menu bar belongs - typically
|
|
|
|
* by means of being contained within the #GtkApplicationWindows
|
|
|
|
* widget hierarchy.
|
|
|
|
*
|
|
|
|
* Returns: a new #GtkMenuBar
|
|
|
|
*
|
|
|
|
* Since: 3.4
|
|
|
|
*/
|
|
|
|
GtkWidget *
|
|
|
|
gtk_menu_bar_new_from_model (GMenuModel *model)
|
|
|
|
{
|
|
|
|
GtkWidget *menubar;
|
|
|
|
|
|
|
|
g_return_val_if_fail (G_IS_MENU_MODEL (model), NULL);
|
|
|
|
|
|
|
|
menubar = gtk_menu_bar_new ();
|
|
|
|
gtk_menu_shell_bind_model (GTK_MENU_SHELL (menubar), model, NULL, FALSE);
|
|
|
|
|
|
|
|
return menubar;
|
|
|
|
}
|