diff --git a/ChangeLog b/ChangeLog index 8ea14a6779..e439770b4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2003-09-24 Michael Natterer + + * app/gui/dialogs-constructors.c (dialogs_get_view_menu_func): + using gimp_container_view_get_by_dockable() was a bad idea since + not all our GimpEditor subclasses actually are GimpContainerViews. + Find the right GimpEditor manually instead (fixes missing popup + menus). + + * app/gui/colormap-editor-menu.c (colormap_editor_menu_update): + make the menu entries insensitive if the image is not indexed. + fixes bug #123066. + 2003-09-24 Michael Natterer * app/widgets/gimpwidgets-utils.c (gimp_menu_position) diff --git a/app/dialogs/dialogs-constructors.c b/app/dialogs/dialogs-constructors.c index 0603cdb682..04b5a32c68 100644 --- a/app/dialogs/dialogs-constructors.c +++ b/app/dialogs/dialogs-constructors.c @@ -1328,12 +1328,20 @@ static GimpItemFactory * dialogs_get_view_menu_func (GimpDockable *dockable, gpointer *item_factory_data) { - GimpContainerView *view = gimp_container_view_get_by_dockable (dockable); + GtkWidget *widget = GTK_BIN (dockable)->child; + GimpEditor *editor = NULL; - if (view) + if (GIMP_IS_EDITOR (widget)) { - GimpEditor *editor = GIMP_EDITOR (view); + editor = GIMP_EDITOR (widget); + } + else if (GIMP_IS_CONTAINER_EDITOR (widget)) + { + editor = GIMP_EDITOR (GIMP_CONTAINER_EDITOR (widget)->view); + } + if (editor) + { if (item_factory_data) *item_factory_data = editor->item_factory_data; diff --git a/app/gui/colormap-editor-menu.c b/app/gui/colormap-editor-menu.c index 0d0bb411c7..0d2adaa940 100644 --- a/app/gui/colormap-editor-menu.c +++ b/app/gui/colormap-editor-menu.c @@ -59,6 +59,7 @@ colormap_editor_menu_update (GtkItemFactory *factory, { GimpColormapEditor *editor; GimpImage *gimage; + gboolean indexed = FALSE; gint num_colors = 0; editor = GIMP_COLORMAP_EDITOR (data); @@ -66,14 +67,15 @@ colormap_editor_menu_update (GtkItemFactory *factory, if (gimage) { + indexed = gimp_image_base_type (gimage) == GIMP_INDEXED; num_colors = gimage->num_cols; } #define SET_SENSITIVE(menu,condition) \ gimp_item_factory_set_sensitive (factory, menu, (condition) != 0) - SET_SENSITIVE ("/Edit Color...", gimage); - SET_SENSITIVE ("/Add Color", gimage && num_colors < 256); + SET_SENSITIVE ("/Edit Color...", gimage && indexed); + SET_SENSITIVE ("/Add Color", gimage && indexed && num_colors < 256); #undef SET_SENSITIVE } diff --git a/app/gui/dialogs-constructors.c b/app/gui/dialogs-constructors.c index 0603cdb682..04b5a32c68 100644 --- a/app/gui/dialogs-constructors.c +++ b/app/gui/dialogs-constructors.c @@ -1328,12 +1328,20 @@ static GimpItemFactory * dialogs_get_view_menu_func (GimpDockable *dockable, gpointer *item_factory_data) { - GimpContainerView *view = gimp_container_view_get_by_dockable (dockable); + GtkWidget *widget = GTK_BIN (dockable)->child; + GimpEditor *editor = NULL; - if (view) + if (GIMP_IS_EDITOR (widget)) { - GimpEditor *editor = GIMP_EDITOR (view); + editor = GIMP_EDITOR (widget); + } + else if (GIMP_IS_CONTAINER_EDITOR (widget)) + { + editor = GIMP_EDITOR (GIMP_CONTAINER_EDITOR (widget)->view); + } + if (editor) + { if (item_factory_data) *item_factory_data = editor->item_factory_data;