mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 01:43:24 +00:00
libgimp: show the newly introspectable stuff in GimpProcView
This commit is contained in:
parent
5c16fc205d
commit
d7e69b2bbb
1 changed files with 73 additions and 45 deletions
|
@ -55,6 +55,10 @@
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
|
||||||
|
static gint gimp_proc_view_add_label (GtkGrid *grid,
|
||||||
|
gint row,
|
||||||
|
const gchar *left_label,
|
||||||
|
const gchar *right_label);
|
||||||
static GtkWidget * gimp_proc_view_create_args (GimpProcedure *procedure,
|
static GtkWidget * gimp_proc_view_create_args (GimpProcedure *procedure,
|
||||||
gboolean return_values,
|
gboolean return_values,
|
||||||
GtkSizeGroup *name_group,
|
GtkSizeGroup *name_group,
|
||||||
|
@ -167,6 +171,35 @@ gimp_proc_view_new (const gchar *procedure_name,
|
||||||
gtk_widget_show (label);
|
gtk_widget_show (label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type != GIMP_PDB_PROC_TYPE_INTERNAL)
|
||||||
|
{
|
||||||
|
GList *list;
|
||||||
|
|
||||||
|
grid = gtk_grid_new ();
|
||||||
|
gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
|
||||||
|
gtk_grid_set_row_spacing (GTK_GRID (grid), 4);
|
||||||
|
gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (grid);
|
||||||
|
|
||||||
|
row = 0;
|
||||||
|
|
||||||
|
row = gimp_proc_view_add_label (GTK_GRID (grid), row,
|
||||||
|
_("Image types:"),
|
||||||
|
gimp_procedure_get_image_types (procedure));
|
||||||
|
row = gimp_proc_view_add_label (GTK_GRID (grid), row,
|
||||||
|
_("Menu label:"),
|
||||||
|
gimp_procedure_get_menu_label (procedure));
|
||||||
|
|
||||||
|
for (list = gimp_procedure_get_menu_paths (procedure);
|
||||||
|
list;
|
||||||
|
list = g_list_next (list))
|
||||||
|
{
|
||||||
|
row = gimp_proc_view_add_label (GTK_GRID (grid), row,
|
||||||
|
_("Menu path:"),
|
||||||
|
list->data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
name_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
name_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
||||||
type_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
type_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
||||||
desc_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
desc_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
||||||
|
@ -227,9 +260,8 @@ gimp_proc_view_new (const gchar *procedure_name,
|
||||||
|
|
||||||
/* show the authors & the copyright */
|
/* show the authors & the copyright */
|
||||||
|
|
||||||
if (! authors && ! date && ! copyright)
|
if (authors || date || copyright)
|
||||||
return main_vbox;
|
{
|
||||||
|
|
||||||
grid = gtk_grid_new ();
|
grid = gtk_grid_new ();
|
||||||
gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
|
gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
|
||||||
gtk_grid_set_row_spacing (GTK_GRID (grid), 4);
|
gtk_grid_set_row_spacing (GTK_GRID (grid), 4);
|
||||||
|
@ -238,43 +270,15 @@ gimp_proc_view_new (const gchar *procedure_name,
|
||||||
|
|
||||||
row = 0;
|
row = 0;
|
||||||
|
|
||||||
if (authors)
|
row = gimp_proc_view_add_label (GTK_GRID (grid), row,
|
||||||
{
|
_("Authors:"),
|
||||||
label = gtk_label_new (authors);
|
authors);
|
||||||
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
|
row = gimp_proc_view_add_label (GTK_GRID (grid), row,
|
||||||
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
|
_("Date:"),
|
||||||
gtk_label_set_yalign (GTK_LABEL (label), 0.0);
|
date);
|
||||||
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
|
row = gimp_proc_view_add_label (GTK_GRID (grid), row,
|
||||||
|
_("Copyright:"),
|
||||||
gimp_grid_attach_aligned (GTK_GRID (grid), 0, row++,
|
copyright);
|
||||||
_("Authors:"), 0.0, 0.0,
|
|
||||||
label, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (date)
|
|
||||||
{
|
|
||||||
label = gtk_label_new (date);
|
|
||||||
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
|
|
||||||
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
|
|
||||||
gtk_label_set_yalign (GTK_LABEL (label), 0.0);
|
|
||||||
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
|
|
||||||
|
|
||||||
gimp_grid_attach_aligned (GTK_GRID (grid), 0, row++,
|
|
||||||
_("Date:"), 0.0, 0.0,
|
|
||||||
label, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (copyright)
|
|
||||||
{
|
|
||||||
label = gtk_label_new (copyright);
|
|
||||||
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
|
|
||||||
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
|
|
||||||
gtk_label_set_yalign (GTK_LABEL (label), 0.0);
|
|
||||||
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
|
|
||||||
|
|
||||||
gimp_grid_attach_aligned (GTK_GRID (grid), 0, row++,
|
|
||||||
_("Copyright:"), 0.0, 0.0,
|
|
||||||
label, 3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return main_vbox;
|
return main_vbox;
|
||||||
|
@ -283,6 +287,30 @@ gimp_proc_view_new (const gchar *procedure_name,
|
||||||
|
|
||||||
/* private functions */
|
/* private functions */
|
||||||
|
|
||||||
|
static gint
|
||||||
|
gimp_proc_view_add_label (GtkGrid *grid,
|
||||||
|
gint row,
|
||||||
|
const gchar *left_label,
|
||||||
|
const gchar *right_label)
|
||||||
|
{
|
||||||
|
if (right_label && strlen (right_label))
|
||||||
|
{
|
||||||
|
GtkWidget *label;
|
||||||
|
|
||||||
|
label = gtk_label_new (right_label);
|
||||||
|
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
|
||||||
|
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
|
||||||
|
gtk_label_set_yalign (GTK_LABEL (label), 0.0);
|
||||||
|
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
|
||||||
|
|
||||||
|
gimp_grid_attach_aligned (GTK_GRID (grid), 0, row++,
|
||||||
|
left_label, 0.0, 0.0,
|
||||||
|
label, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
gimp_proc_view_create_args (GimpProcedure *procedure,
|
gimp_proc_view_create_args (GimpProcedure *procedure,
|
||||||
gboolean return_values,
|
gboolean return_values,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue