[polari/wip/gsv] Use GtkSourceView



commit 3cbf18cdd6be3fc30eb243f6aa2376e4f4cddbfd
Author: Ignacio Casal Quinteiro <ignacio casal nice-software com>
Date:   Thu Aug 8 16:39:00 2013 +0200

    Use GtkSourceView

 configure.ac    |    1 +
 src/chatView.js |    9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 0aa1014..56a9850 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,6 +23,7 @@ PKG_CHECK_MODULES(POLARI,
                   gio-2.0
                   gobject-introspection-1.0
                   gtk+-3.0
+                  gtksourceview-3.0
                   telepathy-glib);
 
 GJS_CONSOLE=`$PKG_CONFIG --variable=gjs_console gjs-1.0`
diff --git a/src/chatView.js b/src/chatView.js
index 576cfba..fc53843 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -1,6 +1,7 @@
 const Gdk = imports.gi.Gdk;
 const Gio = imports.gi.Gio;
 const Gtk = imports.gi.Gtk;
+const GtkSource = imports.gi.GtkSource;
 const Pango = imports.gi.Pango;
 const Tp = imports.gi.TelepathyGLib;
 
@@ -153,9 +154,11 @@ const ChatView = new Lang.Class({
         this.widget.hscrollbar_policy = Gtk.PolicyType.NEVER;
         this.widget.resize_mode = Gtk.ResizeMode.QUEUE;
 
-        this._view = new Gtk.TextView({ editable: false, cursor_visible: false,
-                                        margin: 6, visible: true,
-                                        wrap_mode: Gtk.WrapMode.WORD_CHAR });
+        let buffer = new GtkSource.Buffer();
+        this._view = new GtkSource.View({ editable: false, cursor_visible: false,
+                                          margin: 6, visible: true,
+                                          wrap_mode: Gtk.WrapMode.WORD_CHAR,
+                                          buffer: buffer });
         this.widget.add(this._view);
         this.widget.show_all();
 


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