Commit 5a726a02 authored by Ell's avatar Ell

app: use a propgui for display filters that return a NULL config widget

When a display filter's configure() function returns NULL, use a
propgui for the filter, instead of not showing a widget at all, to
spare filters the need to manually construct a configuration gui.
parent bcb7545f
......@@ -118,7 +118,8 @@ gimp_display_shell_filter_dialog_new (GimpDisplayShell *shell)
g_object_unref (stack);
editor = gimp_color_display_editor_new (shell->filter_stack,
editor = gimp_color_display_editor_new (shell->display->gimp,
gimp_display_shell_get_color_config (shell),
gtk_container_set_border_width (GTK_CONTAINER (editor), 12);
......@@ -29,6 +29,12 @@
#include "widgets-types.h"
#include "propgui/propgui-types.h"
#include "core/gimp.h"
#include "propgui/gimppropgui.h"
#include "gimpcolordisplayeditor.h"
#include "gimpeditor.h"
......@@ -355,7 +361,8 @@ gimp_color_display_editor_dispose (GObject *object)
GtkWidget *
gimp_color_display_editor_new (GimpColorDisplayStack *stack,
gimp_color_display_editor_new (Gimp *gimp,
GimpColorDisplayStack *stack,
GimpColorConfig *config,
GimpColorManaged *managed)
......@@ -365,12 +372,14 @@ gimp_color_display_editor_new (GimpColorDisplayStack *stack,
gint i;
GList *list;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (GIMP_IS_COLOR_DISPLAY_STACK (stack), NULL);
g_return_val_if_fail (GIMP_IS_COLOR_CONFIG (config), NULL);
g_return_val_if_fail (GIMP_IS_COLOR_MANAGED (managed), NULL);
editor = g_object_new (GIMP_TYPE_COLOR_DISPLAY_EDITOR, NULL);
editor->gimp = gimp;
editor->stack = g_object_ref (stack);
editor->config = g_object_ref (config);
editor->managed = g_object_ref (managed);
......@@ -573,6 +582,16 @@ gimp_color_display_editor_dest_changed (GtkTreeSelection *sel,
editor->config_widget = gimp_color_display_configure (display);
if (! editor->config_widget)
editor->config_widget =
gimp_prop_gui_new (G_OBJECT (display),
G_TYPE_FROM_INSTANCE (display), 0,
gimp_get_user_context (editor->gimp),
gtk_frame_set_label (GTK_FRAME (editor->config_frame),
......@@ -36,6 +36,7 @@ struct _GimpColorDisplayEditor
GtkBox parent_instance;
Gimp *gimp;
GimpColorDisplayStack *stack;
GimpColorConfig *config;
GimpColorManaged *managed;
......@@ -69,7 +70,8 @@ struct _GimpColorDisplayEditorClass
GType gimp_color_display_editor_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_color_display_editor_new (GimpColorDisplayStack *stack,
GtkWidget * gimp_color_display_editor_new (Gimp *gimp,
GimpColorDisplayStack *stack,
GimpColorConfig *config,
GimpColorManaged *managed);
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