1997-11-24 22:37:52 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
|
|
|
* 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
|
1998-04-13 02:02:47 +00:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
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/.
|
|
|
|
*/
|
|
|
|
|
2002-01-30 01:02:43 +00:00
|
|
|
#define GTK_MENU_INTERNALS
|
|
|
|
|
2004-03-06 03:38:59 +00:00
|
|
|
#include <config.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 "gdk/gdkkeysyms.h"
|
2004-08-09 16:59:53 +00:00
|
|
|
#include "gtkalias.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"
|
1997-11-24 22:37:52 +00:00
|
|
|
#include "gtkmain.h"
|
2002-03-01 01:05:11 +00:00
|
|
|
#include "gtkmarshalers.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
#include "gtkmenubar.h"
|
|
|
|
#include "gtkmenuitem.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"
|
|
|
|
#include "gtkintl.h"
|
|
|
|
#include "gtkwindow.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
|
1999-01-17 19:01:49 +00:00
|
|
|
#define BORDER_SPACING 0
|
2001-06-04 23:15:51 +00:00
|
|
|
#define DEFAULT_IPADDING 1
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2005-02-11 07:15:11 +00:00
|
|
|
/* Properties */
|
|
|
|
enum {
|
|
|
|
PROP_0,
|
|
|
|
PROP_PACK_DIRECTION,
|
|
|
|
PROP_CHILD_PACK_DIRECTION
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _GtkMenuBarPrivate GtkMenuBarPrivate;
|
|
|
|
struct _GtkMenuBarPrivate
|
|
|
|
{
|
|
|
|
GtkPackDirection pack_direction;
|
|
|
|
GtkPackDirection child_pack_direction;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define GTK_MENU_BAR_GET_PRIVATE(o) \
|
|
|
|
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_MENU_BAR, GtkMenuBarPrivate))
|
|
|
|
|
|
|
|
|
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_class_init (GtkMenuBarClass *klass);
|
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);
|
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_request (GtkWidget *widget,
|
|
|
|
GtkRequisition *requisition);
|
|
|
|
static void gtk_menu_bar_size_allocate (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation);
|
|
|
|
static void gtk_menu_bar_paint (GtkWidget *widget,
|
|
|
|
GdkRectangle *area);
|
|
|
|
static gint gtk_menu_bar_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event);
|
|
|
|
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
|
|
|
|
|
|
|
|
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 GtkShadowType get_shadow_type (GtkMenuBar *menubar);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2001-03-09 13:28:26 +00:00
|
|
|
static GtkMenuShellClass *parent_class = NULL;
|
|
|
|
|
2002-10-05 01:51:16 +00:00
|
|
|
GType
|
1998-05-03 22:41:32 +00:00
|
|
|
gtk_menu_bar_get_type (void)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2002-10-05 01:51:16 +00:00
|
|
|
static GType menu_bar_type = 0;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if (!menu_bar_type)
|
|
|
|
{
|
2002-10-05 01:51:16 +00:00
|
|
|
static const GTypeInfo menu_bar_info =
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
sizeof (GtkMenuBarClass),
|
2002-10-05 01:51:16 +00:00
|
|
|
NULL, /* base_init */
|
|
|
|
NULL, /* base_finalize */
|
|
|
|
(GClassInitFunc) gtk_menu_bar_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (GtkMenuBar),
|
|
|
|
0, /* n_preallocs */
|
|
|
|
NULL, /* instance_init */
|
1997-11-24 22:37:52 +00:00
|
|
|
};
|
|
|
|
|
2002-10-05 01:51:16 +00:00
|
|
|
menu_bar_type = g_type_register_static (GTK_TYPE_MENU_SHELL, "GtkMenuBar",
|
|
|
|
&menu_bar_info, 0);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return menu_bar_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_menu_bar_class_init (GtkMenuBarClass *class)
|
|
|
|
{
|
2005-02-11 07:15:11 +00:00
|
|
|
GObjectClass *gobject_class;
|
1998-11-16 09:05:26 +00:00
|
|
|
GtkObjectClass *object_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;
|
|
|
|
|
2001-03-09 13:28:26 +00:00
|
|
|
parent_class = g_type_class_peek_parent (class);
|
|
|
|
|
2005-02-11 07:15:11 +00:00
|
|
|
gobject_class = (GObjectClass*) class;
|
1998-11-16 09:05:26 +00:00
|
|
|
object_class = (GtkObjectClass*) 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;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
widget_class->size_request = gtk_menu_bar_size_request;
|
|
|
|
widget_class->size_allocate = gtk_menu_bar_size_allocate;
|
|
|
|
widget_class->expose_event = gtk_menu_bar_expose;
|
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;
|
|
|
|
|
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,
|
|
|
|
GDK_Left, 0,
|
|
|
|
"move_current", 1,
|
|
|
|
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,
|
|
|
|
GDK_KP_Left, 0,
|
|
|
|
"move_current", 1,
|
|
|
|
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,
|
|
|
|
GDK_Right, 0,
|
|
|
|
"move_current", 1,
|
|
|
|
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,
|
|
|
|
GDK_KP_Right, 0,
|
|
|
|
"move_current", 1,
|
|
|
|
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,
|
|
|
|
GDK_Up, 0,
|
|
|
|
"move_current", 1,
|
|
|
|
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,
|
|
|
|
GDK_KP_Up, 0,
|
|
|
|
"move_current", 1,
|
|
|
|
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,
|
|
|
|
GDK_Down, 0,
|
|
|
|
"move_current", 1,
|
|
|
|
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,
|
|
|
|
GDK_KP_Down, 0,
|
|
|
|
"move_current", 1,
|
|
|
|
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,
|
|
|
|
PROP_PACK_DIRECTION,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_enum ("pack-direction",
|
2005-02-11 07:15:11 +00:00
|
|
|
P_("Pack direction"),
|
|
|
|
P_("The pack direction of the menubar"),
|
|
|
|
GTK_TYPE_PACK_DIRECTION,
|
|
|
|
GTK_PACK_DIRECTION_LTR,
|
|
|
|
G_PARAM_READWRITE));
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GtkMenuBar:child-pack-direction:
|
|
|
|
*
|
|
|
|
* The pack direction of the menubar. It determines how
|
|
|
|
* the widgets contained in child menuitems are arranged.
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_CHILD_PACK_DIRECTION,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_enum ("child-pack-direction",
|
2005-02-11 07:15:11 +00:00
|
|
|
P_("Child Pack direction"),
|
|
|
|
P_("The child pack direction of the menubar"),
|
|
|
|
GTK_TYPE_PACK_DIRECTION,
|
|
|
|
GTK_PACK_DIRECTION_LTR,
|
|
|
|
G_PARAM_READWRITE));
|
|
|
|
|
|
|
|
|
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
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_enum ("shadow-type",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Shadow type"),
|
|
|
|
P_("Style of bevel around the 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
|
|
|
GTK_TYPE_SHADOW_TYPE,
|
|
|
|
GTK_SHADOW_OUT,
|
|
|
|
G_PARAM_READABLE));
|
2001-06-04 23:15:51 +00:00
|
|
|
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_int ("internal-padding",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Internal padding"),
|
|
|
|
P_("Amount of border space between the menubar shadow and the menu items"),
|
2001-06-04 23:15:51 +00:00
|
|
|
0,
|
|
|
|
G_MAXINT,
|
|
|
|
DEFAULT_IPADDING,
|
|
|
|
G_PARAM_READABLE));
|
|
|
|
|
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
|
|
|
gtk_settings_install_property (g_param_spec_int ("gtk-menu-bar-popup-delay",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Delay before drop down menus appear"),
|
|
|
|
P_("Delay before the submenus of a menu bar appear"),
|
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
|
|
|
0,
|
|
|
|
G_MAXINT,
|
|
|
|
0,
|
|
|
|
G_PARAM_READWRITE));
|
2005-02-11 07:15:11 +00:00
|
|
|
|
|
|
|
g_type_class_add_private (gobject_class, sizeof (GtkMenuBarPrivate));
|
1998-11-16 09:05:26 +00:00
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
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
|
|
|
|
gtk_menu_bar_size_request (GtkWidget *widget,
|
|
|
|
GtkRequisition *requisition)
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
gint nchildren;
|
1999-02-10 02:35:09 +00:00
|
|
|
GtkRequisition child_requisition;
|
2001-06-04 23:15:51 +00:00
|
|
|
gint ipadding;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_MENU_BAR (widget));
|
|
|
|
g_return_if_fail (requisition != NULL);
|
|
|
|
|
|
|
|
requisition->width = 0;
|
|
|
|
requisition->height = 0;
|
2001-06-04 23:15:51 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (GTK_WIDGET_VISIBLE (widget))
|
|
|
|
{
|
|
|
|
menu_bar = GTK_MENU_BAR (widget);
|
|
|
|
menu_shell = GTK_MENU_SHELL (widget);
|
2005-02-11 07:15:11 +00:00
|
|
|
priv = GTK_MENU_BAR_GET_PRIVATE (menu_bar);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
nchildren = 0;
|
|
|
|
children = menu_shell->children;
|
|
|
|
|
|
|
|
while (children)
|
|
|
|
{
|
|
|
|
child = children->data;
|
|
|
|
children = children->next;
|
|
|
|
|
|
|
|
if (GTK_WIDGET_VISIBLE (child))
|
|
|
|
{
|
2001-02-13 05:44:47 +00:00
|
|
|
gint toggle_size;
|
2005-02-11 07:15:11 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
GTK_MENU_ITEM (child)->show_submenu_indicator = FALSE;
|
1999-02-10 02:35:09 +00:00
|
|
|
gtk_widget_size_request (child, &child_requisition);
|
2001-02-13 05:44:47 +00:00
|
|
|
gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child),
|
|
|
|
&toggle_size);
|
2005-02-11 07:15:11 +00:00
|
|
|
|
|
|
|
if (priv->child_pack_direction == GTK_PACK_DIRECTION_LTR ||
|
|
|
|
priv->child_pack_direction == GTK_PACK_DIRECTION_RTL)
|
|
|
|
child_requisition.width += toggle_size;
|
|
|
|
else
|
|
|
|
child_requisition.height += toggle_size;
|
|
|
|
|
|
|
|
if (priv->pack_direction == GTK_PACK_DIRECTION_LTR ||
|
|
|
|
priv->pack_direction == GTK_PACK_DIRECTION_RTL)
|
|
|
|
{
|
|
|
|
requisition->width += child_requisition.width;
|
|
|
|
requisition->height = MAX (requisition->height, child_requisition.height);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
requisition->width = MAX (requisition->width, child_requisition.width);
|
|
|
|
requisition->height += child_requisition.height;
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
nchildren += 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-06-04 23:15:51 +00:00
|
|
|
gtk_widget_style_get (widget, "internal_padding", &ipadding, NULL);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
requisition->width += (GTK_CONTAINER (menu_bar)->border_width +
|
2001-06-04 23:15:51 +00:00
|
|
|
ipadding +
|
1997-11-24 22:37:52 +00:00
|
|
|
BORDER_SPACING) * 2;
|
|
|
|
requisition->height += (GTK_CONTAINER (menu_bar)->border_width +
|
2001-06-04 23:15:51 +00:00
|
|
|
ipadding +
|
1997-11-24 22:37:52 +00:00
|
|
|
BORDER_SPACING) * 2;
|
|
|
|
|
2002-02-27 21:57:27 +00:00
|
|
|
if (get_shadow_type (menu_bar) != GTK_SHADOW_NONE)
|
|
|
|
{
|
|
|
|
requisition->width += widget->style->xthickness * 2;
|
|
|
|
requisition->height += widget->style->ythickness * 2;
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_menu_bar_size_allocate (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation)
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
GtkAllocation child_allocation;
|
1999-02-10 02:35:09 +00:00
|
|
|
GtkRequisition child_requisition;
|
1997-11-24 22:37:52 +00:00
|
|
|
guint offset;
|
2002-11-02 00:18:14 +00:00
|
|
|
GtkTextDirection direction;
|
2005-02-11 07:15:11 +00:00
|
|
|
gint ltr_x, ltr_y;
|
2004-02-26 22:29:24 +00:00
|
|
|
gint ipadding;
|
2002-11-02 00:18:14 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_if_fail (GTK_IS_MENU_BAR (widget));
|
|
|
|
g_return_if_fail (allocation != NULL);
|
|
|
|
|
|
|
|
menu_bar = GTK_MENU_BAR (widget);
|
|
|
|
menu_shell = GTK_MENU_SHELL (widget);
|
2005-02-11 07:15:11 +00:00
|
|
|
priv = GTK_MENU_BAR_GET_PRIVATE (menu_bar);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2002-11-02 00:18:14 +00:00
|
|
|
direction = gtk_widget_get_direction (widget);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
widget->allocation = *allocation;
|
|
|
|
if (GTK_WIDGET_REALIZED (widget))
|
|
|
|
gdk_window_move_resize (widget->window,
|
|
|
|
allocation->x, allocation->y,
|
|
|
|
allocation->width, allocation->height);
|
|
|
|
|
2001-06-04 23:15:51 +00:00
|
|
|
gtk_widget_style_get (widget, "internal_padding", &ipadding, NULL);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (menu_shell->children)
|
|
|
|
{
|
|
|
|
child_allocation.x = (GTK_CONTAINER (menu_bar)->border_width +
|
2004-02-26 22:29:24 +00:00
|
|
|
ipadding +
|
1997-11-24 22:37:52 +00:00
|
|
|
BORDER_SPACING);
|
|
|
|
child_allocation.y = (GTK_CONTAINER (menu_bar)->border_width +
|
|
|
|
BORDER_SPACING);
|
2005-02-11 07:15:11 +00:00
|
|
|
|
2002-02-27 21:57:27 +00:00
|
|
|
if (get_shadow_type (menu_bar) != GTK_SHADOW_NONE)
|
|
|
|
{
|
|
|
|
child_allocation.x += widget->style->xthickness;
|
|
|
|
child_allocation.y += widget->style->ythickness;
|
|
|
|
}
|
|
|
|
|
2005-02-11 07:15:11 +00:00
|
|
|
if (priv->pack_direction == GTK_PACK_DIRECTION_LTR ||
|
|
|
|
priv->pack_direction == GTK_PACK_DIRECTION_RTL)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2005-02-11 07:15:11 +00:00
|
|
|
child_allocation.height = MAX (1, (gint)allocation->height - child_allocation.y * 2);
|
|
|
|
|
|
|
|
offset = child_allocation.x; /* Window edge to menubar start */
|
|
|
|
ltr_x = child_allocation.x;
|
|
|
|
|
|
|
|
children = menu_shell->children;
|
|
|
|
while (children)
|
1998-04-06 02:00:48 +00:00
|
|
|
{
|
2005-02-11 07:15:11 +00:00
|
|
|
gint toggle_size;
|
|
|
|
|
|
|
|
child = children->data;
|
|
|
|
children = children->next;
|
|
|
|
|
|
|
|
gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child),
|
|
|
|
&toggle_size);
|
|
|
|
gtk_widget_get_child_requisition (child, &child_requisition);
|
|
|
|
|
|
|
|
if (priv->child_pack_direction == GTK_PACK_DIRECTION_LTR ||
|
|
|
|
priv->child_pack_direction == GTK_PACK_DIRECTION_RTL)
|
|
|
|
child_requisition.width += toggle_size;
|
|
|
|
else
|
|
|
|
child_requisition.height += toggle_size;
|
|
|
|
|
|
|
|
/* Support for the right justified help menu */
|
|
|
|
if ((children == NULL) && (GTK_IS_MENU_ITEM(child))
|
|
|
|
&& (GTK_MENU_ITEM(child)->right_justify))
|
|
|
|
{
|
|
|
|
ltr_x = allocation->width -
|
|
|
|
child_requisition.width - offset;
|
|
|
|
}
|
|
|
|
if (GTK_WIDGET_VISIBLE (child))
|
|
|
|
{
|
|
|
|
if ((direction == GTK_TEXT_DIR_LTR) == (priv->pack_direction == GTK_PACK_DIRECTION_LTR))
|
|
|
|
child_allocation.x = ltr_x;
|
|
|
|
else
|
|
|
|
child_allocation.x = allocation->width -
|
|
|
|
child_requisition.width - ltr_x;
|
|
|
|
|
|
|
|
child_allocation.width = child_requisition.width;
|
|
|
|
|
|
|
|
gtk_menu_item_toggle_size_allocate (GTK_MENU_ITEM (child),
|
|
|
|
toggle_size);
|
|
|
|
gtk_widget_size_allocate (child, &child_allocation);
|
|
|
|
|
|
|
|
ltr_x += child_allocation.width;
|
|
|
|
}
|
1998-04-06 02:00:48 +00:00
|
|
|
}
|
2005-02-11 07:15:11 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
child_allocation.width = MAX (1, (gint)allocation->width - child_allocation.x * 2);
|
|
|
|
|
|
|
|
offset = child_allocation.y; /* Window edge to menubar start */
|
|
|
|
ltr_y = child_allocation.y;
|
|
|
|
|
|
|
|
children = menu_shell->children;
|
|
|
|
while (children)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2005-02-11 07:15:11 +00:00
|
|
|
gint toggle_size;
|
|
|
|
|
|
|
|
child = children->data;
|
|
|
|
children = children->next;
|
|
|
|
|
|
|
|
gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child),
|
|
|
|
&toggle_size);
|
|
|
|
gtk_widget_get_child_requisition (child, &child_requisition);
|
|
|
|
|
|
|
|
if (priv->child_pack_direction == GTK_PACK_DIRECTION_LTR ||
|
|
|
|
priv->child_pack_direction == GTK_PACK_DIRECTION_RTL)
|
|
|
|
child_requisition.width += toggle_size;
|
2002-11-02 00:18:14 +00:00
|
|
|
else
|
2005-02-11 07:15:11 +00:00
|
|
|
child_requisition.height += toggle_size;
|
|
|
|
|
|
|
|
/* Support for the right justified help menu */
|
|
|
|
if ((children == NULL) && (GTK_IS_MENU_ITEM(child))
|
|
|
|
&& (GTK_MENU_ITEM(child)->right_justify))
|
|
|
|
{
|
|
|
|
ltr_y = allocation->height -
|
|
|
|
child_requisition.height - offset;
|
|
|
|
}
|
|
|
|
if (GTK_WIDGET_VISIBLE (child))
|
|
|
|
{
|
|
|
|
if ((direction == GTK_TEXT_DIR_LTR) ==
|
|
|
|
(priv->pack_direction == GTK_PACK_DIRECTION_TTB))
|
|
|
|
child_allocation.y = ltr_y;
|
|
|
|
else
|
|
|
|
child_allocation.y = allocation->height -
|
|
|
|
child_requisition.height - ltr_y;
|
|
|
|
child_allocation.height = child_requisition.height;
|
|
|
|
|
|
|
|
gtk_menu_item_toggle_size_allocate (GTK_MENU_ITEM (child),
|
|
|
|
toggle_size);
|
|
|
|
gtk_widget_size_allocate (child, &child_allocation);
|
|
|
|
|
|
|
|
ltr_y += child_allocation.height;
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-11-06 22:05:02 +00:00
|
|
|
gtk_menu_bar_paint (GtkWidget *widget, GdkRectangle *area)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_MENU_BAR (widget));
|
|
|
|
|
|
|
|
if (GTK_WIDGET_DRAWABLE (widget))
|
|
|
|
{
|
2001-06-04 23:15:51 +00:00
|
|
|
gint border;
|
|
|
|
|
|
|
|
border = GTK_CONTAINER (widget)->border_width;
|
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
gtk_paint_box (widget->style,
|
|
|
|
widget->window,
|
2001-06-04 23:15:51 +00:00
|
|
|
GTK_WIDGET_STATE (widget),
|
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
|
|
|
get_shadow_type (GTK_MENU_BAR (widget)),
|
1998-11-06 22:05:02 +00:00
|
|
|
area, widget, "menubar",
|
2001-06-04 23:15:51 +00:00
|
|
|
border, border,
|
|
|
|
widget->allocation.width - border * 2,
|
|
|
|
widget->allocation.height - border * 2);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_menu_bar_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_MENU_BAR (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_DRAWABLE (widget))
|
|
|
|
{
|
1998-11-06 22:05:02 +00:00
|
|
|
gtk_menu_bar_paint (widget, &event->area);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2001-03-09 13:28:26 +00:00
|
|
|
(* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event);
|
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
|
|
|
|
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");
|
|
|
|
}
|
|
|
|
|
2002-06-12 20:42:44 +00:00
|
|
|
static GList *
|
|
|
|
get_viewable_menu_bars (GtkWindow *window)
|
|
|
|
{
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
if (!GTK_WIDGET_MAPPED (widget))
|
|
|
|
viewable = FALSE;
|
|
|
|
|
|
|
|
widget = widget->parent;
|
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
g_object_set_data (G_OBJECT (window), "gtk-menu-bar-list", 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 gboolean
|
|
|
|
window_key_press_handler (GtkWidget *widget,
|
|
|
|
GdkEventKey *event,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gchar *accel = NULL;
|
|
|
|
gboolean retval = FALSE;
|
|
|
|
|
2003-02-28 01:45:51 +00:00
|
|
|
g_object_get (gtk_widget_get_settings (widget),
|
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
|
|
|
"gtk-menu-bar-accel",
|
|
|
|
&accel,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
if (accel)
|
|
|
|
{
|
|
|
|
guint keyval = 0;
|
|
|
|
GdkModifierType mods = 0;
|
|
|
|
|
|
|
|
gtk_accelerator_parse (accel, &keyval, &mods);
|
|
|
|
|
|
|
|
if (keyval == 0)
|
|
|
|
g_warning ("Failed to parse menu bar accelerator '%s'\n", accel);
|
|
|
|
|
|
|
|
/* FIXME this is wrong, needs to be in the global accel resolution
|
|
|
|
* thing, to properly consider i18n etc., but that probably requires
|
|
|
|
* AccelGroup changes etc.
|
|
|
|
*/
|
|
|
|
if (event->keyval == keyval &&
|
2001-12-12 19:30:01 +00:00
|
|
|
((event->state & gtk_accelerator_get_default_mod_mask ()) ==
|
|
|
|
(mods & gtk_accelerator_get_default_mod_mask ())))
|
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-06-12 20:42:44 +00:00
|
|
|
GList *tmp_menubars = get_viewable_menu_bars (GTK_WINDOW (widget));
|
|
|
|
GList *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
|
|
|
|
2002-06-12 20:42:44 +00:00
|
|
|
menubars = _gtk_container_focus_sort (GTK_CONTAINER (widget), tmp_menubars,
|
2002-03-01 01:05:11 +00:00
|
|
|
GTK_DIR_TAB_FORWARD, NULL);
|
2002-06-12 20:42:44 +00:00
|
|
|
g_list_free (tmp_menubars);
|
|
|
|
|
2002-03-01 01:05:11 +00:00
|
|
|
if (menubars)
|
|
|
|
{
|
2002-04-11 14:28:11 +00:00
|
|
|
GtkMenuShell *menu_shell = GTK_MENU_SHELL (menubars->data);
|
2002-03-01 01:05:11 +00:00
|
|
|
|
2002-04-11 14:28:11 +00:00
|
|
|
_gtk_menu_shell_activate (menu_shell);
|
2002-09-23 21:53:20 +00:00
|
|
|
gtk_menu_shell_select_first (menu_shell, FALSE);
|
2002-03-01 01:05:11 +00:00
|
|
|
|
|
|
|
g_list_free (menubars);
|
2002-04-11 14:28:11 +00:00
|
|
|
|
|
|
|
retval = TRUE;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
g_free (accel);
|
|
|
|
}
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
if (!menubars)
|
|
|
|
{
|
2002-10-05 01:51:16 +00:00
|
|
|
g_signal_connect (window,
|
2002-03-01 01:05:11 +00:00
|
|
|
"key_press_event",
|
|
|
|
G_CALLBACK (window_key_press_handler),
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
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_object_get_data (G_OBJECT (window),
|
|
|
|
"gtk-menu-bar-list");
|
|
|
|
|
|
|
|
menubars = g_list_remove (menubars, menubar);
|
|
|
|
|
|
|
|
if (!menubars)
|
|
|
|
{
|
2002-10-05 01:51:16 +00:00
|
|
|
g_signal_handlers_disconnect_by_func (window,
|
|
|
|
window_key_press_handler,
|
2002-03-01 01:05:11 +00:00
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
2001-07-05 02:58:34 +00:00
|
|
|
if (GTK_WIDGET_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
|
|
|
|
|
|
|
if (GTK_WIDGET_TOPLEVEL (toplevel))
|
|
|
|
{
|
2002-06-12 20:42:44 +00:00
|
|
|
GList *tmp_menubars = get_viewable_menu_bars (GTK_WINDOW (toplevel));
|
|
|
|
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);
|
2002-03-01 01:05:11 +00:00
|
|
|
if (new_menushell->children)
|
2002-07-25 18:17:28 +00:00
|
|
|
to_activate = new_menushell->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
|
|
|
}
|
|
|
|
|
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 GtkShadowType
|
|
|
|
get_shadow_type (GtkMenuBar *menubar)
|
|
|
|
{
|
|
|
|
GtkShadowType shadow_type = GTK_SHADOW_OUT;
|
|
|
|
|
|
|
|
gtk_widget_style_get (GTK_WIDGET (menubar),
|
|
|
|
"shadow_type", &shadow_type,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
return shadow_type;
|
|
|
|
}
|
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)
|
|
|
|
{
|
|
|
|
gint popup_delay;
|
|
|
|
|
2003-02-28 01:45:51 +00:00
|
|
|
g_object_get (gtk_widget_get_settings (GTK_WIDGET (menu_shell)),
|
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
|
|
|
"gtk-menu-bar-popup-delay", &popup_delay,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
return popup_delay;
|
|
|
|
}
|
2005-02-11 07:15:11 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_menu_bar_move_current (GtkMenuShell *menu_shell,
|
|
|
|
GtkMenuDirectionType direction)
|
|
|
|
{
|
|
|
|
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: ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GTK_MENU_SHELL_CLASS (parent_class)->move_current (menu_shell, direction);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_menu_bar_get_pack_direction:
|
|
|
|
* @menubar: a #GtkMenuBar
|
|
|
|
*
|
|
|
|
* Retrieves the current pack direction of the menubar. See
|
|
|
|
* gtk_menu_bar_set_pack_direction().
|
|
|
|
*
|
|
|
|
* Return value: the pack direction
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
GtkPackDirection
|
|
|
|
gtk_menu_bar_get_pack_direction (GtkMenuBar *menubar)
|
|
|
|
{
|
|
|
|
GtkMenuBarPrivate *priv;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_MENU_BAR (menubar),
|
|
|
|
GTK_PACK_DIRECTION_LTR);
|
|
|
|
|
|
|
|
priv = GTK_MENU_BAR_GET_PRIVATE (menubar);
|
|
|
|
|
|
|
|
return priv->pack_direction;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_menu_bar_set_pack_direction:
|
|
|
|
* @menubar: a #GtkMenuBar.
|
|
|
|
* @pack_dir: a new #GtkPackDirection.
|
|
|
|
*
|
|
|
|
* Sets how items should be packed inside a menubar.
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
void gtk_menu_bar_set_pack_direction (GtkMenuBar *menubar,
|
|
|
|
GtkPackDirection pack_dir)
|
|
|
|
{
|
|
|
|
GtkMenuBarPrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_MENU_BAR (menubar));
|
|
|
|
|
|
|
|
priv = GTK_MENU_BAR_GET_PRIVATE (menubar);
|
|
|
|
|
|
|
|
if (priv->pack_direction != pack_dir)
|
|
|
|
{
|
|
|
|
priv->pack_direction = pack_dir;
|
|
|
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (menubar));
|
|
|
|
g_object_notify (G_OBJECT (menubar), "pack-direction");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_menu_bar_get_child_pack_direction:
|
|
|
|
* @menubar: a #GtkMenuBar
|
|
|
|
*
|
|
|
|
* Retrieves the current child pack direction of the menubar. See
|
|
|
|
* gtk_menu_bar_set_child_pack_direction().
|
|
|
|
*
|
|
|
|
* Return value: the child pack direction
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
GtkPackDirection
|
|
|
|
gtk_menu_bar_get_child_pack_direction (GtkMenuBar *menubar)
|
|
|
|
{
|
|
|
|
GtkMenuBarPrivate *priv;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_MENU_BAR (menubar),
|
|
|
|
GTK_PACK_DIRECTION_LTR);
|
|
|
|
|
|
|
|
priv = GTK_MENU_BAR_GET_PRIVATE (menubar);
|
|
|
|
|
|
|
|
return priv->child_pack_direction;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_menu_bar_set_child_pack_direction:
|
|
|
|
* @menubar: a #GtkMenuBar.
|
|
|
|
* @child_pack_dir: a new #GtkPackDirection.
|
|
|
|
*
|
|
|
|
* Sets how widgets should be packed inside the children of a menubar.
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
void gtk_menu_bar_set_child_pack_direction (GtkMenuBar *menubar,
|
|
|
|
GtkPackDirection child_pack_dir)
|
|
|
|
{
|
|
|
|
GtkMenuBarPrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_MENU_BAR (menubar));
|
|
|
|
|
|
|
|
priv = GTK_MENU_BAR_GET_PRIVATE (menubar);
|
|
|
|
|
|
|
|
if (priv->child_pack_direction != child_pack_dir)
|
|
|
|
{
|
|
|
|
priv->child_pack_direction = child_pack_dir;
|
|
|
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (menubar));
|
|
|
|
g_object_notify (G_OBJECT (menubar), "child-pack-direction");
|
|
|
|
}
|
|
|
|
}
|