src/MetadataTreeView.vala (1101B) - raw
1 /* 2 * xmpedit 3 * Copyright 2010 Dan Callaghan <djc@djc.id.au> 4 * Released under GPLv2 5 */ 6 7 namespace Xmpedit { 8 9 private class PropertySummaryCellRenderer : Gtk.CellRendererText { 10 11 private ImageProperty _image_property; 12 public ImageProperty image_property { 13 get { 14 return _image_property; 15 } 16 set { 17 _image_property = value; 18 markup = value.list_markup(); 19 } 20 } 21 22 } 23 24 public class MetadataTreeView : Gtk.TreeView { 25 26 public MetadataTreeView.connected_to(ImageMetadata metadata) { 27 Object(model: metadata); 28 } 29 30 construct { 31 Gtk.TreeViewColumn column = new Gtk.TreeViewColumn(); 32 column.title = "Image properties"; 33 column.sizing = Gtk.TreeViewColumnSizing.FIXED; 34 column.fixed_width = 300; 35 var cell_renderer = new PropertySummaryCellRenderer(); 36 column.pack_start(cell_renderer, /* expand */ true); 37 column.add_attribute(cell_renderer, "image_property", 0); 38 append_column(column); 39 get_selection().set_mode(Gtk.SelectionMode.BROWSE); 40 } 41 42 } 43 44 }