[gnome-documents] presentation: Frame the list and give each row a header



commit 35ac9057487a19afa3e7d6483faee9b4b90ea084
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Sep 29 18:47:41 2014 +0200

    presentation: Frame the list and give each row a header
    
    https://bugzilla.gnome.org/show_bug.cgi?id=737580

 src/presentation.js |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/src/presentation.js b/src/presentation.js
index 4ee28a1..e19418d 100644
--- a/src/presentation.js
+++ b/src/presentation.js
@@ -194,16 +194,35 @@ const PresentationOutputChooser = new Lang.Class({
                                         title: _("Present On"),
                                         default_width: 300,
                                         default_height: 150,
+                                        border_width: 5,
                                         hexpand: true });
         this.window.connect('response', Lang.bind(this,
             function(widget, response) {
                 this.emit('output-activated', null);
             }));
 
-        this._box = new Gtk.ListBox({ valign: Gtk.Align.CENTER });
+        let frame = new Gtk.Frame({ shadow_type: Gtk.ShadowType.IN });
+
+        this._box = new Gtk.ListBox({ hexpand: true,
+                                      valign: Gtk.Align.CENTER,
+                                      selection_mode: Gtk.SelectionMode.NONE });
+        frame.add(this._box);
         this._box.connect('row-activated', Lang.bind(this, this._onActivated));
+        this._box.set_header_func(Lang.bind(this,
+            function(row, before) {
+                if (!before)
+                    return;
+
+                let current = row.get_header();
+                if (!current) {
+                    current = new Gtk.Separator({ orientation: Gtk.Orientation.HORIZONTAL });
+                    current.show();
+                    row.set_header(current);
+                }
+            }));
+
         let contentArea = this.window.get_content_area();
-        contentArea.pack_start(this._box, true, false, 0);
+        contentArea.pack_start(frame, true, false, 0);
     }
 });
 Signals.addSignalMethods(PresentationOutputChooser.prototype);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]