Ticket #3956: 0001-Journal-details-view-correct-spacing-of-metadata-SL-.patch

File 0001-Journal-details-view-correct-spacing-of-metadata-SL-.patch, 2.7 KB (added by manuq, 11 years ago)

Candidate patch.

  • src/jarabe/journal/expandedentry.py

    From 2c08d3dfb61bb69fd3aad58ea762334279f78cc0 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
    Date: Fri, 26 Oct 2012 15:32:36 -0300
    Subject: [PATCH shell] Journal details view: correct spacing of metadata - SL
     #3956
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
    
    - Align the metadata next to the preview image, packing it with
      expand=False.
    
    - Get back style.DEFAULT_SPACING between the metadata lines.  This was
      introduced in the hippo removal, d9fbf9db.
    
    Signed-off-by: Manuel Quiñones <manuq@laptop.org>
    ---
     src/jarabe/journal/expandedentry.py | 24 +++++++++++++-----------
     1 file changed, 13 insertions(+), 11 deletions(-)
    
    diff --git a/src/jarabe/journal/expandedentry.py b/src/jarabe/journal/expandedentry.py
    index eda4c4e..19e8144 100644
    a b class ExpandedEntry(Gtk.EventBox): 
    112112        first_column.pack_start(self._preview_box, False, True, 0)
    113113
    114114        self._technical_box = Gtk.VBox()
    115         first_column.pack_start(self._technical_box, True, False, 0)
     115        first_column.pack_start(self._technical_box, False, False, 0)
    116116
    117117        # Second body column
    118118        description_box, self._description = self._create_description()
    class ExpandedEntry(Gtk.EventBox): 
    265265        vbox = Gtk.VBox()
    266266        vbox.props.spacing = style.DEFAULT_SPACING
    267267
    268         label = \
    269             _('Kind: %s') % (self._metadata.get('mime_type') or \
    270                                  _('Unknown'),) + '\n' + \
    271             _('Date: %s') % (self._format_date(),) + '\n' + \
     268        lines = [
     269            _('Kind: %s') % (self._metadata.get('mime_type') or _('Unknown'),),
     270            _('Date: %s') % (self._format_date(),),
    272271            _('Size: %s') % (format_size(int(self._metadata.get(
    273272                        'filesize',
    274273                        model.get_file_size(self._metadata['uid'])))))
     274            ]
    275275
    276         text = Gtk.Label()
    277         text.set_markup('<span foreground="%s">%s</span>' % (
    278                 style.COLOR_BUTTON_GREY.get_html(), label))
    279         halign = Gtk.Alignment.new(0, 0, 0, 0)
    280         halign.add(text)
    281         vbox.pack_start(halign, False, False, 0)
     276        for line in lines:
     277            linebox = Gtk.HBox()
     278            vbox.pack_start(linebox, False, False, 0)
     279
     280            text = Gtk.Label()
     281            text.set_markup('<span foreground="%s">%s</span>' % (
     282                    style.COLOR_BUTTON_GREY.get_html(), line))
     283            linebox.pack_start(text, False, False, 0)
    282284
    283285        return vbox
    284286