added gimp_dockbook_help_func() which shows the help for the active page.

2003-08-26  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpdockbook.c: added gimp_dockbook_help_func()
	which shows the help for the active page.

	(gimp_dockbook_tab_button_press): grab the focus when a notebook
	tab is clicked. Still not perfect since GtkNotebook does it
	slightly different, but feels much better than before.
This commit is contained in:
Michael Natterer 2003-08-26 10:07:01 +00:00 committed by Michael Natterer
parent d90ee12388
commit 3b30a0b80a
2 changed files with 38 additions and 0 deletions

View File

@ -1,3 +1,12 @@
2003-08-26 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpdockbook.c: added gimp_dockbook_help_func()
which shows the help for the active page.
(gimp_dockbook_tab_button_press): grab the focus when a notebook
tab is clicked. Still not perfect since GtkNotebook does it
slightly different, but feels much better than before.
2003-08-26 Michael Natterer <mitch@gimp.org> 2003-08-26 Michael Natterer <mitch@gimp.org>
* app/gui/info-window.c * app/gui/info-window.c

View File

@ -36,6 +36,7 @@
#include "gimpdnd.h" #include "gimpdnd.h"
#include "gimpdockable.h" #include "gimpdockable.h"
#include "gimpdockbook.h" #include "gimpdockbook.h"
#include "gimphelp-ids.h"
#include "gimpimagedock.h" #include "gimpimagedock.h"
#include "gimpitemfactory.h" #include "gimpitemfactory.h"
#include "gimpmenufactory.h" #include "gimpmenufactory.h"
@ -91,6 +92,8 @@ static gboolean gimp_dockbook_tab_drag_drop (GtkWidget *widget,
gint y, gint y,
guint time, guint time,
gpointer data); gpointer data);
static void gimp_dockbook_help_func (const gchar *help_id,
gpointer help_data);
static GtkNotebookClass *parent_class = NULL; static GtkNotebookClass *parent_class = NULL;
@ -241,6 +244,9 @@ gimp_dockbook_new (GimpMenuFactory *menu_factory)
menu_factory->gimp, menu_factory->gimp,
FALSE); FALSE);
gimp_help_connect (GTK_WIDGET (dockbook), gimp_dockbook_help_func,
GIMP_HELP_DOCK, dockbook);
return GTK_WIDGET (dockbook); return GTK_WIDGET (dockbook);
} }
@ -572,6 +578,9 @@ gimp_dockbook_tab_button_press (GtkWidget *widget,
gtk_notebook_set_current_page (GTK_NOTEBOOK (dockbook), page_num); gtk_notebook_set_current_page (GTK_NOTEBOOK (dockbook), page_num);
if (! GTK_WIDGET_HAS_FOCUS (dockbook))
gtk_widget_grab_focus (GTK_WIDGET (dockbook));
if (bevent->button == 3) if (bevent->button == 3)
{ {
GtkWidget *add_widget; GtkWidget *add_widget;
@ -769,3 +778,23 @@ gimp_dockbook_tab_drag_drop (GtkWidget *widget,
return FALSE; return FALSE;
} }
static void
gimp_dockbook_help_func (const gchar *help_id,
gpointer help_data)
{
GimpDockbook *dockbook;
GtkWidget *dockable;
gint page_num;
dockbook = GIMP_DOCKBOOK (help_data);
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook));
dockable = gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num);
if (GIMP_IS_DOCKABLE (dockable))
gimp_standard_help_func (GIMP_DOCKABLE (dockable)->help_id, NULL);
else
gimp_standard_help_func (GIMP_HELP_DOCK, NULL);
}