[polari/wip/fmuellner/combined-gsoc: 33/137] dirty fork
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/combined-gsoc: 33/137] dirty fork
- Date: Thu, 28 Jul 2016 16:18:11 +0000 (UTC)
commit acadfc4fcbe8875406acd7d6120541178e243b0d
Author: Kunaal Jain <kunaalus gmail com>
Date: Sat Jul 9 15:37:28 2016 +0530
dirty fork
data/resources/main-window.ui | 14 +--------
src/mainWindow.js | 6 ++-
src/org.gnome.Polari.src.gresource.xml | 1 +
src/resultView.js | 48 ++++++++++++++++++++++++++++++++
4 files changed, 55 insertions(+), 14 deletions(-)
---
diff --git a/data/resources/main-window.ui b/data/resources/main-window.ui
index adc4f87..3e2a7ea 100644
--- a/data/resources/main-window.ui
+++ b/data/resources/main-window.ui
@@ -309,18 +309,8 @@
</packing>
</child>
<child>
- <object class="GtkScrolledWindow" id="resultscroll">
- <child>
- <object class="GtkTextView" id="resultStack">
- <property name="visible">True</property>
- <!-- <property name="use-markup">true</property> -->
- <!-- <property name="homogeneous">True</property> -->
- <!-- <property name="transition-type">crossfade</property> -->
- </object>
- <packing>
- <property name="name">result1</property>
- </packing>
- </child>
+ <object class="Gjs_ResultView" id="resultscroll">
+ <property name="visible">True</property>
</object>
<packing>
<property name="name">result</property>
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 20966f8..63fb3eb 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -20,6 +20,7 @@ const Utils = imports.utils;
const Pango = imports.gi.Pango;
const ChatView = imports.chatView;
const ResultList = imports.resultList;
+const ResultView = imports.resultView;
const CONFIGURE_TIMEOUT = 100; /* ms */
@@ -110,7 +111,6 @@ const MainWindow = new Lang.Class({
'mainStack',
'results',
'mainStack1',
- 'resultStack',
'resultscroll'],
Properties: {
subtitle: GObject.ParamSpec.string('subtitle',
@@ -252,7 +252,9 @@ const MainWindow = new Lang.Class({
}));
this._results.connect('row-activated', Lang.bind(this, this._rowactivated));
-
+ this._resultStack = this._resultscroll._view;
+ print(this._resultStack);
+ print(this._resultscroll);
this._resultscroll.connect('edge-reached', Lang.bind(this, this._onScroll));
//test
diff --git a/src/org.gnome.Polari.src.gresource.xml b/src/org.gnome.Polari.src.gresource.xml
index 78da23f..441772b 100644
--- a/src/org.gnome.Polari.src.gresource.xml
+++ b/src/org.gnome.Polari.src.gresource.xml
@@ -16,6 +16,7 @@
<file>networksManager.js</file>
<file>pasteManager.js</file>
<file>resultList.js</file>
+ <file>resultView.js</file>
<file>roomList.js</file>
<file>roomStack.js</file>
<file>resultStack.js</file>
diff --git a/src/resultView.js b/src/resultView.js
new file mode 100644
index 0000000..846496b
--- /dev/null
+++ b/src/resultView.js
@@ -0,0 +1,48 @@
+const Gdk = imports.gi.Gdk;
+const GLib = imports.gi.GLib;
+const Gio = imports.gi.Gio;
+const GObject = imports.gi.GObject;
+const Gtk = imports.gi.Gtk;
+const Pango = imports.gi.Pango;
+const PangoCairo = imports.gi.PangoCairo;
+const Polari = imports.gi.Polari;
+const Tp = imports.gi.TelepathyGLib;
+const Tpl = imports.gi.TelepathyLogger;
+
+const Lang = imports.lang;
+const LogManager = imports.logManager;
+const Mainloop = imports.mainloop;
+const PasteManager = imports.pasteManager;
+const Signals = imports.signals;
+const Utils = imports.utils;
+
+const MARGIN = 14;
+
+const ResultTextView = new Lang.Class({
+ Name: 'ResultTextView',
+ Extends: Gtk.TextView,
+
+ _init: function(params) {
+ this.parent(params);
+ }
+});
+
+const ResultView = new Lang.Class({
+ Name: 'ResultView',
+ Extends: Gtk.ScrolledWindow,
+
+ _init: function() {
+ //this.parent();
+ print("HELLO");
+ this.parent({ hscrollbar_policy: Gtk.PolicyType.NEVER, vexpand: true });
+
+ this._view = new ResultTextView({ editable: false, cursor_visible: false,
+ wrap_mode: Gtk.WrapMode.WORD_CHAR,
+ right_margin: MARGIN });
+ print(this._view);
+ this._view.add_events(Gdk.EventMask.LEAVE_NOTIFY_MASK |
+ Gdk.EventMask.ENTER_NOTIFY_MASK);
+ this.add(this._view);
+ this.show_all();
+ }
+});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]