Example #1
0
static void
gimp_dynamics_editor_add_icon_editor (GimpDynamics *dynamics,
                                      Gimp         *gimp,
                                      GtkWidget    *vbox)
{
  GtkWidget *hbox;
  GtkWidget *label;
  GtkWidget *button;

  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
  gtk_widget_show (hbox);

  label = gtk_label_new (_("Icon:"));
  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
  gtk_widget_show (label);

  button = gimp_prop_icon_picker_new (GIMP_VIEWABLE (dynamics), gimp);
  gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
  gtk_widget_show (button);
}
static void
gimp_tool_preset_editor_constructed (GObject *object)
{
    GimpToolPresetEditor *editor      = GIMP_TOOL_PRESET_EDITOR (object);
    GimpDataEditor       *data_editor = GIMP_DATA_EDITOR (editor);
    GimpToolPreset       *preset;
    GtkWidget            *hbox;
    GtkWidget            *label;
    GtkWidget            *button;

    if (G_OBJECT_CLASS (parent_class)->constructed)
        G_OBJECT_CLASS (parent_class)->constructed (object);

    preset = editor->tool_preset_model =
                 g_object_new (GIMP_TYPE_TOOL_PRESET,
                               "gimp", data_editor->context->gimp,
                               NULL);

    g_signal_connect (preset, "notify",
                      G_CALLBACK (gimp_tool_preset_editor_notify_model),
                      editor);

    hbox = gtk_hbox_new (FALSE, 2);
    gtk_box_pack_start (GTK_BOX (data_editor), hbox, FALSE, FALSE, 0);
    gtk_widget_show (hbox);

    editor->tool_icon = gtk_image_new ();
    gtk_box_pack_start (GTK_BOX (hbox), editor->tool_icon,
                        FALSE, FALSE, 0);
    gtk_widget_show (editor->tool_icon);

    editor->tool_label = gtk_label_new ("");
    gimp_label_set_attributes (GTK_LABEL (editor->tool_label),
                               PANGO_ATTR_STYLE, PANGO_STYLE_ITALIC,
                               -1);
    gtk_box_pack_start (GTK_BOX (hbox), editor->tool_label,
                        FALSE, FALSE, 0);
    gtk_widget_show (editor->tool_label);

    hbox = gtk_hbox_new (FALSE, 2);
    gtk_box_pack_start (GTK_BOX (data_editor), hbox, FALSE, FALSE, 0);
    gtk_widget_show (hbox);

    label = gtk_label_new (_("Icon:"));
    gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
    gtk_widget_show (label);

    button = gimp_prop_icon_picker_new (G_OBJECT (preset), "stock-id",
                                        data_editor->context->gimp);
    gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
    gtk_widget_show (button);

    button = gimp_prop_check_button_new (G_OBJECT (preset), "use-fg-bg",
                                         _("Apply stored FG/BG"));
    gtk_box_pack_start (GTK_BOX (data_editor), button, FALSE, FALSE, 0);
    gtk_widget_show (button);

    button = gimp_prop_check_button_new (G_OBJECT (preset), "use-brush",
                                         _("Apply stored brush"));
    gtk_box_pack_start (GTK_BOX (data_editor), button, FALSE, FALSE, 0);
    gtk_widget_show (button);

    button = gimp_prop_check_button_new (G_OBJECT (preset), "use-dynamics",
                                         _("Apply stored dynamics"));
    gtk_box_pack_start (GTK_BOX (data_editor), button, FALSE, FALSE, 0);
    gtk_widget_show (button);

    button = gimp_prop_check_button_new (G_OBJECT (preset), "use-gradient",
                                         _("Apply stored gradient"));
    gtk_box_pack_start (GTK_BOX (data_editor), button, FALSE, FALSE, 0);
    gtk_widget_show (button);

    button = gimp_prop_check_button_new (G_OBJECT (preset), "use-pattern",
                                         _("Apply stored pattern"));
    gtk_box_pack_start (GTK_BOX (data_editor), button, FALSE, FALSE, 0);
    gtk_widget_show (button);

    button = gimp_prop_check_button_new (G_OBJECT (preset), "use-palette",
                                         _("Apply stored palette"));
    gtk_box_pack_start (GTK_BOX (data_editor), button, FALSE, FALSE, 0);
    gtk_widget_show (button);

    button = gimp_prop_check_button_new (G_OBJECT (preset), "use-font",
                                         _("Apply stored font"));
    gtk_box_pack_start (GTK_BOX (data_editor), button, FALSE, FALSE, 0);
    gtk_widget_show (button);
}