Commit 8d3c38c9 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Enabled closing docks with Ctrl-W:

2005-01-24  Michael Natterer  <mitch@gimp.org>

	Enabled closing docks with Ctrl-W:

	* app/actions/Makefile.am
	* app/actions/dock-actions.[ch]
	* app/actions/dock-commands.[ch]: added new action group which
	holds a single action, "dock-close".

	* app/actions/actions.c: register the "dock" group.

	* app/menus/menus.c: add it to the "<Dock>" UI manager.

	* app/widgets/gimphelp-ids.h: added GIMP_HELP_DOCK_CLOSE.
parent 46346bb9
2005-01-24 Michael Natterer <mitch@gimp.org>
Enabled closing docks with Ctrl-W:
* app/actions/Makefile.am
* app/actions/dock-actions.[ch]
* app/actions/dock-commands.[ch]: added new action group which
holds a single action, "dock-close".
* app/actions/actions.c: register the "dock" group.
* app/menus/menus.c: add it to the "<Dock>" UI manager.
* app/widgets/gimphelp-ids.h: added GIMP_HELP_DOCK_CLOSE.
2005-01-23 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/tools/gimpcroptool.c (crop_aspect_changed): don't
......
......@@ -35,6 +35,10 @@ libappactions_a_SOURCES = \
dialogs-actions.h \
dialogs-commands.c \
dialogs-commands.h \
dock-actions.c \
dock-actions.h \
dock-commands.c \
dock-commands.h \
dockable-actions.c \
dockable-actions.h \
dockable-commands.c \
......
......@@ -52,6 +52,7 @@
#include "context-actions.h"
#include "debug-actions.h"
#include "dialogs-actions.h"
#include "dock-actions.h"
#include "dockable-actions.h"
#include "documents-actions.h"
#include "drawable-actions.h"
......@@ -111,6 +112,9 @@ static GimpActionFactoryEntry action_groups[] =
{ "dialogs", N_("Dialogs"), NULL,
dialogs_actions_setup,
dialogs_actions_update },
{ "dock", N_("Dock"), NULL,
dock_actions_setup,
dock_actions_update },
{ "dockable", N_("Dockable"), NULL,
dockable_actions_setup,
dockable_actions_update },
......
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimpdock.h"
#include "widgets/gimpdockbook.h"
#include "widgets/gimpdocked.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpimagedock.h"
#include "dock-actions.h"
#include "dock-commands.h"
#include "gimp-intl.h"
static GimpActionEntry dock_actions[] =
{
{ "dock-close", GTK_STOCK_CLOSE,
N_("Close Dock"), "<control>W", NULL,
G_CALLBACK (dock_close_cmd_callback),
GIMP_HELP_DOCK_CLOSE }
};
void
dock_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
dock_actions,
G_N_ELEMENTS (dock_actions));
}
void
dock_actions_update (GimpActionGroup *group,
gpointer data)
{
}
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DOCK_ACTIONS_H__
#define __DOCK_ACTIONS_H__
void dock_actions_setup (GimpActionGroup *group);
void dock_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __DOCK_ACTIONS_H__ */
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "actions-types.h"
#include "actions.h"
#include "dock-commands.h"
/* public functions */
void
dock_close_cmd_callback (GtkAction *action,
gpointer data)
{
GtkWidget *widget;
GtkWidget *toplevel;
return_if_no_widget (widget, data);
toplevel = gtk_widget_get_toplevel (widget);
if (toplevel && toplevel->window)
{
GdkEvent *event = gdk_event_new (GDK_DELETE);
event->any.window = g_object_ref (toplevel->window);
event->any.send_event = TRUE;
gtk_main_do_event (event);
gdk_event_free (event);
}
}
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DOCK_COMMANDS_H__
#define __DOCK_COMMANDS_H__
void dock_close_cmd_callback (GtkAction *action,
gpointer data);
#endif /* __DOCK_COMMANDS_H__ */
......@@ -125,6 +125,7 @@ menus_init (Gimp *gimp,
"dialogs",
"plug-in",
"qmask",
"dock",
NULL,
NULL);
......
......@@ -406,6 +406,7 @@
#define GIMP_HELP_INDEXED_PALETTE_ADD "gimp-indexed-palette-add"
#define GIMP_HELP_DOCK "gimp-dock"
#define GIMP_HELP_DOCK_CLOSE "gimp-dock-close"
#define GIMP_HELP_DOCK_IMAGE_MENU "gimp-dock-image-menu"
#define GIMP_HELP_DOCK_AUTO_BUTTON "gimp-dock-auto-button"
#define GIMP_HELP_DOCK_TAB_ADD "gimp-dock-tab-add"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment