From 047a01e24f6d5e0a993b2e6078bc69ed274ff999 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 17 Aug 2005 01:25:20 +0000 Subject: [PATCH] when focussing the widget, select the palette's first entry if none is 2005-08-17 Michael Natterer * app/widgets/gimppaletteview.c (gimp_palette_view_focus): when focussing the widget, select the palette's first entry if none is selected. Enables cursor navigation after tabbing in. --- ChangeLog | 6 ++++++ app/widgets/gimppaletteview.c | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index eafd78af13..c71b56c808 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-08-17 Michael Natterer + + * app/widgets/gimppaletteview.c (gimp_palette_view_focus): when + focussing the widget, select the palette's first entry if none is + selected. Enables cursor navigation after tabbing in. + 2005-08-17 Sven Neumann * plug-ins/common/deinterlace.c: fixed boundary conditions. diff --git a/app/widgets/gimppaletteview.c b/app/widgets/gimppaletteview.c index e4c30c7687..7ac0152de5 100644 --- a/app/widgets/gimppaletteview.c +++ b/app/widgets/gimppaletteview.c @@ -315,10 +315,17 @@ gimp_palette_view_focus (GtkWidget *widget, GtkDirectionType direction) { GimpPaletteView *view = GIMP_PALETTE_VIEW (widget); + GimpPalette *palette; + + palette = GIMP_PALETTE (GIMP_VIEW (view)->renderer->viewable); if (GTK_WIDGET_CAN_FOCUS (widget) && ! GTK_WIDGET_HAS_FOCUS (widget)) { gtk_widget_grab_focus (widget); + + if (! view->selected && palette->colors) + gimp_palette_view_select_entry (view, palette->colors->data); + return TRUE; } @@ -351,12 +358,9 @@ gimp_palette_view_focus (GtkWidget *widget, if (skip != 0) { - GimpPalette *palette; GimpPaletteEntry *entry; gint position; - palette = GIMP_PALETTE (GIMP_VIEW (view)->renderer->viewable); - position = view->selected->position + skip; entry = g_list_nth_data (palette->colors, position);