~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/dialogs/stroke-dialog.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2008-10-06 13:30:41 UTC
  • mto: This revision was merged to the branch mainline in revision 35.
  • Revision ID: james.westby@ubuntu.com-20081006133041-3panbkcanaymfsmp
Tags: upstream-2.6.0
ImportĀ upstreamĀ versionĀ 2.6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
151
151
    font_desc = pango_font_description_new ();
152
152
    pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
153
153
 
154
 
    gtk_widget_modify_font (GTK_BIN (libart_radio)->child, font_desc);
155
 
    gtk_widget_modify_font (GTK_BIN (paint_radio)->child,  font_desc);
 
154
    gtk_widget_modify_font (gtk_bin_get_child (GTK_BIN (libart_radio)),
 
155
                            font_desc);
 
156
    gtk_widget_modify_font (gtk_bin_get_child (GTK_BIN (paint_radio)),
 
157
                            font_desc);
156
158
 
157
159
    pango_font_description_free (font_desc);
158
160
  }
173
175
 
174
176
  {
175
177
    GtkWidget *stroke_editor;
176
 
 
177
 
    stroke_editor = gimp_stroke_editor_new (desc->stroke_options,
178
 
                                            image->yresolution);
 
178
    gdouble    xres;
 
179
    gdouble    yres;
 
180
 
 
181
    gimp_image_get_resolution (image, &xres, &yres);
 
182
 
 
183
    stroke_editor = gimp_stroke_editor_new (desc->stroke_options, yres);
179
184
    gtk_container_add (GTK_CONTAINER (frame), stroke_editor);
180
185
    gtk_widget_show (stroke_editor);
181
186
 
199
204
                    NULL);
200
205
 
201
206
  {
 
207
    GtkWidget *vbox;
202
208
    GtkWidget *hbox;
203
209
    GtkWidget *label;
204
210
    GtkWidget *combo;
 
211
    GtkWidget *button;
 
212
 
 
213
    vbox = gtk_vbox_new (FALSE, 6);
 
214
    gtk_container_add (GTK_CONTAINER (frame), vbox);
 
215
    gtk_widget_show (vbox);
 
216
 
 
217
    gtk_widget_set_sensitive (vbox,
 
218
                              desc->method == GIMP_STROKE_METHOD_PAINT_CORE);
 
219
    g_object_set_data (G_OBJECT (paint_radio), "set_sensitive", vbox);
205
220
 
206
221
    hbox = gtk_hbox_new (FALSE, 6);
207
 
    gtk_container_add (GTK_CONTAINER (frame), hbox);
 
222
    gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
208
223
    gtk_widget_show (hbox);
209
224
 
210
 
    gtk_widget_set_sensitive (hbox,
211
 
                              desc->method == GIMP_STROKE_METHOD_PAINT_CORE);
212
 
    g_object_set_data (G_OBJECT (paint_radio), "set_sensitive", hbox);
213
 
 
214
225
    label = gtk_label_new (_("Paint tool:"));
215
226
    gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
216
227
    gtk_widget_show (label);
229
240
 
230
241
 
231
242
    g_object_set_data (G_OBJECT (dialog), "gimp-tool-menu", combo);
 
243
 
 
244
    button = gimp_prop_check_button_new (G_OBJECT (desc),
 
245
                                         "emulate-brush-dynamics",
 
246
                                         _("_Emulate brush dynamics"));
 
247
    gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
 
248
    gtk_widget_show (button);
232
249
  }
233
250
 
234
251
  return dialog;
273
290
      {
274
291
        GimpDrawable   *drawable = gimp_image_get_active_drawable (image);
275
292
        GimpStrokeDesc *saved_desc;
 
293
        GError         *error    = NULL;
276
294
 
277
295
        if (! drawable)
278
296
          {
297
315
                                saved_desc,
298
316
                                (GDestroyNotify) g_object_unref);
299
317
 
300
 
        gimp_item_stroke (item, drawable, context, desc, FALSE, NULL);
 
318
        if (! gimp_item_stroke (item, drawable, context, desc, FALSE, NULL,
 
319
                                &error))
 
320
          {
 
321
            gimp_message (context->gimp, G_OBJECT (widget),
 
322
                          GIMP_MESSAGE_WARNING,
 
323
                          error->message);
 
324
            g_clear_error (&error);
 
325
            return;
 
326
          }
 
327
 
301
328
        gimp_image_flush (image);
302
329
      }
303
330
      /* fallthrough */