[latexila] DocumentTab: inherit from TeplTab



commit 00df459c20118121afebe0dbe5455293979e6872
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Jun 23 19:18:35 2017 +0200

    DocumentTab: inherit from TeplTab

 configure.ac          |    2 +-
 src/document_tab.vala |   27 +++++++++++----------------
 2 files changed, 12 insertions(+), 17 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 0101b7f..0d507c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,7 +32,7 @@ LT_INIT
 GLIB_REQUIRED_VERSION="2.50"
 GTK_REQUIRED_VERSION="3.22"
 GTKSOURCEVIEW_REQUIRED_VERSION="3.24"
-TEPL_REQUIRED_VERSION="2.99.0"
+TEPL_REQUIRED_VERSION="2.99.2"
 GSPELL_REQUIRED_VERSION="1.0"
 VALA_REQUIRED_VERSION="0.34"
 GEE_REQUIRED_VERSION="0.10"
diff --git a/src/document_tab.vala b/src/document_tab.vala
index 440eb2f..3bf481e 100644
--- a/src/document_tab.vala
+++ b/src/document_tab.vala
@@ -1,7 +1,7 @@
 /*
  * This file is part of LaTeXila.
  *
- * Copyright © 2010-2011 Sébastien Wilmet
+ * Copyright © 2010, 2011, 2017 Sébastien Wilmet
  *
  * LaTeXila is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,13 +19,16 @@
 
 using Gtk;
 
-public class DocumentTab : Grid
+public class DocumentTab : Tepl.Tab
 {
-    public DocumentView document_view { get; construct; }
+    public DocumentView document_view
+    {
+        get { return get_view () as DocumentView; }
+    }
 
     public Document document
     {
-        get { return document_view.buffer as Document; }
+        get { return get_buffer () as Document; }
     }
 
     private bool ask_if_externally_modified = false;
@@ -115,7 +118,7 @@ public class DocumentTab : Grid
     public DocumentTab ()
     {
         DocumentView document_view = new DocumentView (new Document ());
-        Object (document_view: document_view);
+        Object (view: document_view);
         initialize ();
     }
 
@@ -127,7 +130,7 @@ public class DocumentTab : Grid
 
     public DocumentTab.with_view (DocumentView document_view)
     {
-        Object (document_view: document_view);
+        Object (view: document_view);
         initialize ();
     }
 
@@ -152,15 +155,7 @@ public class DocumentTab : Grid
 
         document_view.focus_in_event.connect (view_focused_in);
 
-        // with a scrollbar
-        ScrolledWindow sw = new ScrolledWindow (null, null);
-        sw.overlay_scrolling = false;
-        sw.add (document_view);
-        sw.show_all ();
-
-        // pack at the end so we can display message above
-        sw.expand = true;
-        attach (sw, 0, 0, 1, 1);
+        view.show_all ();
 
         update_label_text ();
 
@@ -202,7 +197,7 @@ public class DocumentTab : Grid
     {
         Tepl.InfoBar infobar = new Tepl.InfoBar.simple (msg_type, primary_msg,
             secondary_msg);
-        attach_next_to (infobar, get_child_at (0, 0), PositionType.TOP, 1, 1);
+        add_info_bar (infobar);
         infobar.show ();
 
         return infobar;


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