~ubuntu-branches/ubuntu/saucy/geary/saucy-updates

« back to all changes in this revision

Viewing changes to src/client/views/formatted-conversation-data.vala

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2013-10-10 17:40:37 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20131010174037-5p5o4dlsoewek2kg
Tags: 0.4.0-0ubuntu1
New stable version

Show diffs side-by-side

added added

removed removed

Lines of Context:
272
272
    private void render_internal(Gtk.Widget widget, Gdk.Rectangle? cell_area, 
273
273
        Cairo.Context? ctx, Gtk.CellRendererState flags, bool recalc_dims,
274
274
        bool hover_select) {
 
275
        bool display_preview = GearyApplication.instance.config.display_preview;
275
276
        int y = LINE_SPACING + (cell_area != null ? cell_area.y : 0);
276
277
        
277
278
        bool selected = (flags & Gtk.CellRendererState.SELECTED) != 0;
294
295
        int counter_x = cell_area != null ? cell_area.width - cell_area.x - counter_width +
295
296
            (LINE_SPACING / 2) : 0;
296
297
        
297
 
        if (GearyApplication.instance.config.display_preview) {
 
298
        if (display_preview) {
298
299
            // Subject field.
299
300
            render_subject(widget, cell_area, ctx, y, selected);
300
301
            y += ink_rect.height + ink_rect.y + LINE_SPACING;
327
328
            FormattedConversationData.preview_height = preview_height;
328
329
            FormattedConversationData.cell_height = y + preview_height;
329
330
        } else {
330
 
            int unread_y = GearyApplication.instance.config.display_preview ?
331
 
                cell_area.y + LINE_SPACING * 2 : cell_area.y + LINE_SPACING;
 
331
            int unread_y = display_preview ? cell_area.y + LINE_SPACING * 2 : cell_area.y +
 
332
                LINE_SPACING;
332
333
            
333
334
            // Unread indicator.
334
335
            if (is_unread || hover) {
340
341
            
341
342
            // Starred indicator.
342
343
            if (is_flagged || hover) {
 
344
                int star_y = cell_area.y + (cell_area.height / 2) + (display_preview ? LINE_SPACING : 0);
 
345
                
343
346
                Gdk.Pixbuf starred_icon = is_flagged ? IconFactory.instance.starred_colored
344
347
                    : IconFactory.instance.unstarred_colored;
345
 
                Gdk.cairo_set_source_pixbuf(ctx, starred_icon, cell_area.x + LINE_SPACING, cell_area.y +
346
 
                    (cell_area.height / 2) + LINE_SPACING);
 
348
                Gdk.cairo_set_source_pixbuf(ctx, starred_icon, cell_area.x + LINE_SPACING, star_y);
347
349
                ctx.paint();
348
350
            }
349
351
        }
382
384
        layout_from.set_markup(from_markup, -1);
383
385
        layout_from.set_ellipsize(Pango.EllipsizeMode.END);
384
386
        if (ctx != null && cell_area != null) {
385
 
            layout_from.set_width((cell_area.width - ink_rect.width - ink_rect.x - LINE_SPACING -
 
387
            layout_from.set_width((cell_area.width - ink_rect.width - ink_rect.x - (LINE_SPACING * 3) -
386
388
                TEXT_LEFT)
387
389
            * Pango.SCALE);
388
390
            ctx.move_to(cell_area.x + TEXT_LEFT, y);
429
431
        layout_preview.set_wrap(Pango.WrapMode.WORD);
430
432
        layout_preview.set_ellipsize(Pango.EllipsizeMode.END);
431
433
        if (ctx != null && cell_area != null) {
432
 
            layout_preview.set_width((cell_area.width - TEXT_LEFT - counter_width) * Pango.SCALE);
 
434
            layout_preview.set_width((cell_area.width - TEXT_LEFT - counter_width - LINE_SPACING) * Pango.SCALE);
433
435
            layout_preview.set_height(preview_height * Pango.SCALE);
434
436
            
435
437
            ctx.move_to(cell_area.x + TEXT_LEFT, y);