[polari/wip/kunaljain/polari-search] working UI for search left bar



commit 50c758e0007d9bd4fbd81654a96c2e9af47a9d1b
Author: Kunaal Jain <kunaalus gmail com>
Date:   Thu Jun 9 03:46:58 2016 +0530

    working UI for search left bar

 data/resources/main-window.ui |    8 +++++---
 src/mainWindow.js             |   17 +++++++++++++++--
 2 files changed, 20 insertions(+), 5 deletions(-)
---
diff --git a/data/resources/main-window.ui b/data/resources/main-window.ui
index a3df24e..a60fe13 100644
--- a/data/resources/main-window.ui
+++ b/data/resources/main-window.ui
@@ -248,10 +248,12 @@
               </packing>
                     </child>
                     <child>
-                  <object class="GtkImage">
+                  <object class="GtkListBox" id="results">
                     <property name="visible">True</property>
-                    <property name="icon-name">list-add-symbolic</property>
-                    <property name="icon-size">1</property>
+                    <property name="selection-mode">browse</property>
+                        <style>
+                          <class name="sidebar"/>
+                        </style>
                   </object>
                   <packing>
                 <property name="name">image</property>
diff --git a/src/mainWindow.js b/src/mainWindow.js
index a640a0e..25e7111 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -16,6 +16,7 @@ const RoomList = imports.roomList;
 const RoomStack = imports.roomStack;
 const UserList = imports.userList;
 const Utils = imports.utils;
+const Pango = imports.gi.Pango;
 
 const CONFIGURE_TIMEOUT = 100; /* ms */
 
@@ -103,7 +104,8 @@ const MainWindow = new Lang.Class({
                        'roomListRevealer',
                        'overlay',
                        'roomStack',
-                       'mainStack'],
+                       'mainStack',
+                       'results'],
     Properties: {
         subtitle: GObject.ParamSpec.string('subtitle',
                                            'subtitle',
@@ -257,8 +259,19 @@ const MainWindow = new Lang.Class({
 
     _Log: function(events) {
         log(events);
-        for (let i = 0; i < events.length; i++)
+        for (let i = 0; i < events.length; i++) {
             log(events[i].mms);
+            let row = new Gtk.ListBoxRow({visible: true});
+            let label = new Gtk.Label({ label: events[i].mms,
+                                        halign: Gtk.Align.START,
+                                        margin_start: 6,
+                                        margin_end: 6,
+                                        visible: true,
+                                        ellipsize: Pango.EllipsizeMode.END,
+                                        max_width_chars: 18  });
+            row.add(label);
+            this._results.add(row);
+        }
     },
 
     get subtitle() {


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