[gnome-builder/editor-layout] add markdown preview using new tab system



commit 25758f60e4e7306ea3a25bdfaaa69d483e88d6b0
Author: Christian Hergert <christian hergert me>
Date:   Mon Dec 1 03:56:40 2014 -0800

    add markdown preview using new tab system

 src/editor/gb-editor-document.c           |   60 ++++-----
 src/editor/gb-editor-tab.c                |   49 +++++++
 src/editor/gb-editor-tab.h                |    1 +
 src/editor/gb-editor-workspace.c          |   43 ++++++
 src/gnome-builder.mk                      |    2 +
 src/markdown/gb-markdown-preview.c        |   17 ++-
 src/markdown/gb-markdown-tab.c            |  198 +++++++++++++++++++++++++++++
 src/markdown/gb-markdown-tab.h            |   56 ++++++++
 src/resources/gnome-builder.gresource.xml |    1 +
 src/resources/keybindings/default.ini     |    2 +-
 src/resources/ui/gb-markdown-tab.ui       |   17 +++
 11 files changed, 407 insertions(+), 39 deletions(-)
---
diff --git a/src/editor/gb-editor-document.c b/src/editor/gb-editor-document.c
index 1c2745f..e8c9695 100644
--- a/src/editor/gb-editor-document.c
+++ b/src/editor/gb-editor-document.c
@@ -106,33 +106,6 @@ gb_editor_document_get_file (GbEditorDocument *document)
   return document->priv->file;
 }
 
-void
-gb_editor_document_set_file (GbEditorDocument *document,
-                             GtkSourceFile    *file)
-{
-  GbEditorDocumentPrivate *priv;
-
-  g_return_if_fail (GB_IS_EDITOR_DOCUMENT (document));
-  g_return_if_fail (!file || GTK_SOURCE_IS_FILE (file));
-
-  priv = document->priv;
-
-  if (file != priv->file)
-    {
-      g_clear_object (&priv->file);
-
-      if (file)
-        {
-          priv->file = g_object_ref (file);
-          g_object_bind_property (priv->file, "location",
-                                  priv->change_monitor, "file",
-                                  G_BINDING_SYNC_CREATE);
-        }
-
-      g_object_notify_by_pspec (G_OBJECT (document), gParamSpecs [PROP_FILE]);
-    }
-}
-
 static void
 gb_editor_document_set_style_scheme_name (GbEditorDocument *document,
                                           const gchar      *style_scheme_name)
@@ -464,6 +437,25 @@ gb_editor_document_guess_language (GbEditorDocument *document)
 }
 
 static void
+gb_editor_document_notify_file_location (GbEditorDocument *document,
+                                         GParamSpec       *pspec,
+                                         GtkSourceFile    *file)
+{
+  GbEditorDocumentPrivate *priv;
+  GFile *location;
+
+  g_return_if_fail (GB_IS_EDITOR_DOCUMENT (document));
+  g_return_if_fail (GTK_SOURCE_IS_FILE (file));
+
+  priv = document->priv;
+
+  location = gtk_source_file_get_location (file);
+  gb_source_change_monitor_set_file (priv->change_monitor, location);
+
+  gb_editor_document_guess_language (document);
+}
+
+static void
 gb_editor_document_save_cb (GObject      *object,
                             GAsyncResult *result,
                             gpointer      user_data)
@@ -724,10 +716,6 @@ gb_editor_document_set_property (GObject      *object,
 
   switch (prop_id)
     {
-    case PROP_FILE:
-      gb_editor_document_set_file (self, g_value_get_object (value));
-      break;
-
     case PROP_STYLE_SCHEME_NAME:
       gb_editor_document_set_style_scheme_name (self,
                                                 g_value_get_string (value));
@@ -771,7 +759,7 @@ gb_editor_document_class_init (GbEditorDocumentClass *klass)
                          _("File"),
                          _("The backing file for the document."),
                          GTK_SOURCE_TYPE_FILE,
-                         (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+                         (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
   g_object_class_install_property (object_class, PROP_FILE,
                                    gParamSpecs [PROP_FILE]);
 
@@ -815,9 +803,11 @@ gb_editor_document_init (GbEditorDocument *document)
   document->priv->change_monitor = gb_source_change_monitor_new (GTK_TEXT_BUFFER (document));
   document->priv->code_assistant = gb_source_code_assistant_new (GTK_TEXT_BUFFER (document));
 
-  g_object_bind_property (document->priv->file, "location",
-                          document->priv->change_monitor, "file",
-                          G_BINDING_SYNC_CREATE);
+  g_signal_connect_object (document->priv->file,
+                           "notify::location",
+                           G_CALLBACK (gb_editor_document_notify_file_location),
+                           document,
+                           G_CONNECT_SWAPPED);
 
   g_signal_connect_object (document->priv->code_assistant,
                            "changed",
diff --git a/src/editor/gb-editor-tab.c b/src/editor/gb-editor-tab.c
index f60cac3..823fe10 100644
--- a/src/editor/gb-editor-tab.c
+++ b/src/editor/gb-editor-tab.c
@@ -27,6 +27,7 @@
 #include "gb-editor-file-mark.h"
 #include "gb-editor-file-marks.h"
 #include "gb-log.h"
+#include "gb-markdown-tab.h"
 #include "gb-widget.h"
 
 G_DEFINE_TYPE_WITH_PRIVATE (GbEditorTab, gb_editor_tab, GB_TYPE_TAB)
@@ -570,6 +571,54 @@ gb_editor_tab_reformat (GbEditorTab *tab)
   gb_editor_frame_reformat (frame);
 }
 
+static gboolean
+markdown_preview_title (GBinding     *binding,
+                        const GValue *from_value,
+                        GValue       *to_value,
+                        gpointer      user_data)
+{
+  gchar *str;
+
+  str = g_strdup_printf (_("%s (Markdown Preview)"),
+                         g_value_get_string (from_value));
+  g_value_take_string (to_value, str);
+
+  return TRUE;
+}
+
+
+GbTab *
+gb_editor_tab_preview (GbEditorTab *tab)
+{
+  GbEditorTabPrivate *priv;
+  GtkSourceLanguage *lang;
+  const gchar *lang_id;
+  GbTab *preview = NULL;
+
+  g_return_val_if_fail (GB_IS_EDITOR_TAB (tab), NULL);
+
+  priv = tab->priv;
+
+  lang = gtk_source_buffer_get_language (GTK_SOURCE_BUFFER (priv->document));
+
+  if (!lang || !(lang_id = gtk_source_language_get_id (lang)))
+    return NULL;
+
+  if (g_str_equal (lang_id, "markdown"))
+    {
+      preview = g_object_new (GB_TYPE_MARKDOWN_TAB,
+                              "buffer", priv->document,
+                              "visible", TRUE,
+                              NULL);
+      g_object_bind_property_full (tab, "title", preview, "title",
+                                   G_BINDING_SYNC_CREATE,
+                                   markdown_preview_title,
+                                   NULL, NULL, NULL);
+    }
+
+  return preview;
+}
+
 static void
 gb_editor_tab_constructed (GObject *object)
 {
diff --git a/src/editor/gb-editor-tab.h b/src/editor/gb-editor-tab.h
index 0d96771..6013923 100644
--- a/src/editor/gb-editor-tab.h
+++ b/src/editor/gb-editor-tab.h
@@ -66,6 +66,7 @@ void         gb_editor_tab_scroll_to_line    (GbEditorTab *tab,
                                               guint        line,
                                               guint        line_offset);
 void         gb_editor_tab_restore_file_mark (GbEditorTab *tab);
+GbTab       *gb_editor_tab_preview           (GbEditorTab *tab);
 
 G_END_DECLS
 
diff --git a/src/editor/gb-editor-workspace.c b/src/editor/gb-editor-workspace.c
index eeac693..8ab9721 100644
--- a/src/editor/gb-editor-workspace.c
+++ b/src/editor/gb-editor-workspace.c
@@ -143,6 +143,48 @@ reformat_tab (GSimpleAction *action,
 }
 
 static void
+preview_tab (GSimpleAction *action,
+             GVariant      *parameter,
+             gpointer       user_data)
+{
+  GbEditorWorkspacePrivate *priv;
+  GbEditorWorkspace *workspace = user_data;
+  GbTab *preview = NULL;
+  GbTab *tab;
+
+  g_return_if_fail (GB_IS_EDITOR_WORKSPACE (workspace));
+
+  priv = workspace->priv;
+
+  tab = gb_tab_grid_get_active (workspace->priv->tab_grid);
+
+  if (GB_IS_EDITOR_TAB (tab))
+    {
+      preview = gb_editor_tab_preview (GB_EDITOR_TAB (tab));
+
+      if (preview)
+        {
+          /*
+           * This widget might be already consumed in a stack somewhere.
+           * If so, we want to jump to it, otherwise we want to add it
+           * to a stack next to the current tab.
+           */
+          if (!gtk_widget_get_parent (GTK_WIDGET (preview)))
+            {
+              gtk_container_add (GTK_CONTAINER (priv->tab_grid),
+                                 GTK_WIDGET (preview));
+              gb_tab_grid_move_tab_right (priv->tab_grid, preview);
+              gb_tab_grid_focus_tab (priv->tab_grid, tab);
+            }
+          else
+            {
+              g_warning ("TODO: implement refocus tab.");
+            }
+        }
+    }
+}
+
+static void
 close_tab (GSimpleAction *action,
            GVariant      *parameter,
            gpointer       user_data)
@@ -305,6 +347,7 @@ gb_editor_workspace_init (GbEditorWorkspace *workspace)
       { "toggle-split", toggle_split_tab },
       { "find", find_tab },
       { "reformat", reformat_tab },
+      { "preview", preview_tab },
     };
 
   workspace->priv = gb_editor_workspace_get_instance_private (workspace);
diff --git a/src/gnome-builder.mk b/src/gnome-builder.mk
index 899eea7..0eb6b67 100644
--- a/src/gnome-builder.mk
+++ b/src/gnome-builder.mk
@@ -92,6 +92,8 @@ libgnome_builder_la_SOURCES = \
        src/markdown/gs-markdown.h \
        src/markdown/gb-markdown-preview.c \
        src/markdown/gb-markdown-preview.h \
+       src/markdown/gb-markdown-tab.c \
+       src/markdown/gb-markdown-tab.h \
        src/navigation/gb-navigation-list.h \
        src/navigation/gb-navigation-list.c \
        src/navigation/gb-navigation-item.h \
diff --git a/src/markdown/gb-markdown-preview.c b/src/markdown/gb-markdown-preview.c
index 8366628..b11021c 100644
--- a/src/markdown/gb-markdown-preview.c
+++ b/src/markdown/gb-markdown-preview.c
@@ -107,6 +107,9 @@ gb_markdown_preview_reload (GbMarkdownPreview *preview)
 
   priv = preview->priv;
 
+  if (!priv->buffer)
+    EXIT;
+
   gtk_text_buffer_get_bounds (priv->buffer, &begin, &end);
   text = gtk_text_buffer_get_text (priv->buffer, &begin, &end, TRUE);
 
@@ -158,12 +161,17 @@ gb_markdown_preview_set_buffer (GbMarkdownPreview *preview,
     {
       g_signal_handler_disconnect (priv->buffer, priv->buffer_changed_handler);
       priv->buffer_changed_handler = 0;
-      g_clear_object (&priv->buffer);
+
+      g_object_remove_weak_pointer (G_OBJECT (priv->buffer),
+                                    (gpointer *)&priv->buffer);
+      priv->buffer = NULL;
     }
 
   if (buffer)
     {
-      priv->buffer = g_object_ref (buffer);
+      priv->buffer = buffer;
+      g_object_add_weak_pointer (G_OBJECT (priv->buffer),
+                                 (gpointer *)&priv->buffer);
       priv->buffer_changed_handler =
         g_signal_connect_object (priv->buffer,
                                  "changed",
@@ -183,7 +191,8 @@ gb_markdown_preview_dispose (GObject *object)
     {
       g_signal_handler_disconnect (priv->buffer, priv->buffer_changed_handler);
       priv->buffer_changed_handler = 0;
-      g_clear_object (&priv->buffer);
+      g_object_remove_weak_pointer (G_OBJECT (priv->buffer),
+                                    (gpointer *)&priv->buffer);
     }
 
   G_OBJECT_CLASS (gb_markdown_preview_parent_class)->dispose (object);
@@ -202,6 +211,7 @@ gb_markdown_preview_get_property (GObject    *object,
     case PROP_BUFFER:
       g_value_set_object (value, gb_markdown_preview_get_buffer (self));
       break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
@@ -220,6 +230,7 @@ gb_markdown_preview_set_property (GObject      *object,
     case PROP_BUFFER:
       gb_markdown_preview_set_buffer (self, g_value_get_object (value));
       break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
diff --git a/src/markdown/gb-markdown-tab.c b/src/markdown/gb-markdown-tab.c
new file mode 100644
index 0000000..d5b78ef
--- /dev/null
+++ b/src/markdown/gb-markdown-tab.c
@@ -0,0 +1,198 @@
+/* gb-markdown-tab.c
+ *
+ * Copyright (C) 2014 Christian Hergert <christian hergert me>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <glib/gi18n.h>
+
+#include "gb-markdown-preview.h"
+#include "gb-markdown-tab.h"
+
+struct _GbMarkdownTabPrivate
+{
+  GtkTextBuffer     *buffer;
+  GbMarkdownPreview *preview;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (GbMarkdownTab, gb_markdown_tab, GB_TYPE_TAB)
+
+enum {
+  PROP_0,
+  PROP_BUFFER,
+  LAST_PROP
+};
+
+static GParamSpec *gParamSpecs [LAST_PROP];
+
+GbTab *
+gb_markdown_tab_new (GtkTextBuffer *buffer)
+{
+  return g_object_new (GB_TYPE_MARKDOWN_TAB,
+                       "buffer", buffer,
+                       NULL);
+}
+
+static gboolean
+remove_tab (gpointer user_data)
+{
+  GbTab *tab = user_data;
+
+  g_return_val_if_fail (GB_IS_TAB (tab), G_SOURCE_REMOVE);
+
+  gb_tab_close (tab);
+  g_object_unref (tab);
+
+  return G_SOURCE_REMOVE;
+}
+
+static void
+gb_markdown_tab_weak_unref (gpointer  data,
+                            GObject  *where_object_was)
+{
+  GbMarkdownTab *tab = data;
+
+  g_return_if_fail (GB_IS_MARKDOWN_TAB (tab));
+
+  /*
+   * Close the tab if we lose our buffer. This will happen with the tab owning
+   * the buffer is destroyed. This causes us to destroy with it.
+   */
+  if (where_object_was == (void *)tab->priv->buffer)
+    g_timeout_add (0, remove_tab, g_object_ref (tab));
+}
+
+GtkTextBuffer *
+gb_markdown_tab_get_buffer (GbMarkdownTab *tab)
+{
+  g_return_val_if_fail (GB_IS_MARKDOWN_TAB (tab), NULL);
+
+  return tab->priv->buffer;
+}
+
+static void
+gb_markdown_tab_set_buffer (GbMarkdownTab *tab,
+                            GtkTextBuffer *buffer)
+{
+  g_return_if_fail (GB_IS_MARKDOWN_TAB (tab));
+  g_return_if_fail (!buffer || GTK_IS_TEXT_BUFFER (buffer));
+
+  if (tab->priv->buffer != buffer)
+    {
+      if (tab->priv->buffer)
+        {
+          g_object_weak_unref (G_OBJECT (tab->priv->buffer),
+                               gb_markdown_tab_weak_unref,
+                               tab);
+          tab->priv->buffer = NULL;
+        }
+
+      if (buffer)
+        {
+          tab->priv->buffer = buffer;
+          g_object_weak_ref (G_OBJECT (tab->priv->buffer),
+                             gb_markdown_tab_weak_unref,
+                             tab);
+        }
+
+      gb_markdown_preview_set_buffer (tab->priv->preview, buffer);
+
+      g_object_notify_by_pspec (G_OBJECT (tab), gParamSpecs [PROP_BUFFER]);
+    }
+}
+
+static void
+gb_markdown_tab_finalize (GObject *object)
+{
+  GbMarkdownTab *tab = GB_MARKDOWN_TAB (object);
+
+  gb_markdown_tab_set_buffer (tab, NULL);
+
+  G_OBJECT_CLASS (gb_markdown_tab_parent_class)->finalize (object);
+}
+
+static void
+gb_markdown_tab_get_property (GObject    *object,
+                              guint       prop_id,
+                              GValue     *value,
+                              GParamSpec *pspec)
+{
+  GbMarkdownTab *self = GB_MARKDOWN_TAB (object);
+
+  switch (prop_id)
+    {
+    case PROP_BUFFER:
+      g_value_set_object (value, gb_markdown_tab_get_buffer (self));
+      break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    }
+}
+
+static void
+gb_markdown_tab_set_property (GObject      *object,
+                              guint         prop_id,
+                              const GValue *value,
+                              GParamSpec   *pspec)
+{
+  GbMarkdownTab *self = GB_MARKDOWN_TAB (object);
+
+  switch (prop_id)
+    {
+    case PROP_BUFFER:
+      gb_markdown_tab_set_buffer (self, g_value_get_object (value));
+      break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    }
+}
+
+static void
+gb_markdown_tab_class_init (GbMarkdownTabClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+  object_class->finalize = gb_markdown_tab_finalize;
+  object_class->get_property = gb_markdown_tab_get_property;
+  object_class->set_property = gb_markdown_tab_set_property;
+
+  gParamSpecs [PROP_BUFFER] =
+    g_param_spec_object ("buffer",
+                         _("Buffer"),
+                         _("The buffer to monitor."),
+                         GTK_TYPE_TEXT_BUFFER,
+                         (G_PARAM_READWRITE |
+                          G_PARAM_CONSTRUCT_ONLY |
+                          G_PARAM_STATIC_STRINGS));
+  g_object_class_install_property (object_class, PROP_BUFFER,
+                                   gParamSpecs [PROP_BUFFER]);
+
+  gtk_widget_class_set_template_from_resource (widget_class,
+                                               "/org/gnome/builder/ui/gb-markdown-tab.ui");
+  gtk_widget_class_bind_template_child_private (widget_class, GbMarkdownTab, preview);
+
+  g_type_ensure (GB_TYPE_MARKDOWN_PREVIEW);
+}
+
+static void
+gb_markdown_tab_init (GbMarkdownTab *self)
+{
+  self->priv = gb_markdown_tab_get_instance_private (self);
+
+  gtk_widget_init_template (GTK_WIDGET (self));
+}
diff --git a/src/markdown/gb-markdown-tab.h b/src/markdown/gb-markdown-tab.h
new file mode 100644
index 0000000..a7d06da
--- /dev/null
+++ b/src/markdown/gb-markdown-tab.h
@@ -0,0 +1,56 @@
+/* gb-markdown-tab.h
+ *
+ * Copyright (C) 2014 Christian Hergert <christian hergert me>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GB_MARKDOWN_TAB_H
+#define GB_MARKDOWN_TAB_H
+
+#include "gb-tab.h"
+
+G_BEGIN_DECLS
+
+#define GB_TYPE_MARKDOWN_TAB            (gb_markdown_tab_get_type())
+#define GB_MARKDOWN_TAB(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GB_TYPE_MARKDOWN_TAB, 
GbMarkdownTab))
+#define GB_MARKDOWN_TAB_CONST(obj)      (G_TYPE_CHECK_INSTANCE_CAST ((obj), GB_TYPE_MARKDOWN_TAB, 
GbMarkdownTab const))
+#define GB_MARKDOWN_TAB_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GB_TYPE_MARKDOWN_TAB, 
GbMarkdownTabClass))
+#define GB_IS_MARKDOWN_TAB(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GB_TYPE_MARKDOWN_TAB))
+#define GB_IS_MARKDOWN_TAB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GB_TYPE_MARKDOWN_TAB))
+#define GB_MARKDOWN_TAB_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GB_TYPE_MARKDOWN_TAB, 
GbMarkdownTabClass))
+
+typedef struct _GbMarkdownTab        GbMarkdownTab;
+typedef struct _GbMarkdownTabClass   GbMarkdownTabClass;
+typedef struct _GbMarkdownTabPrivate GbMarkdownTabPrivate;
+
+struct _GbMarkdownTab
+{
+  GbTab parent;
+
+  /*< private >*/
+  GbMarkdownTabPrivate *priv;
+};
+
+struct _GbMarkdownTabClass
+{
+  GbTabClass parent;
+};
+
+GType  gb_markdown_tab_get_type (void);
+GbTab *gb_markdown_tab_new      (GtkTextBuffer *buffer);
+
+G_END_DECLS
+
+#endif /* GB_MARKDOWN_TAB_H */
diff --git a/src/resources/gnome-builder.gresource.xml b/src/resources/gnome-builder.gresource.xml
index 07ad845..1f7afa9 100644
--- a/src/resources/gnome-builder.gresource.xml
+++ b/src/resources/gnome-builder.gresource.xml
@@ -26,6 +26,7 @@
     <file>ui/gb-editor-frame.ui</file>
     <file>ui/gb-editor-tab.ui</file>
     <file>ui/gb-editor-workspace.ui</file>
+    <file>ui/gb-markdown-tab.ui</file>
     <file>ui/gb-preferences-window.ui</file>
     <file>ui/gb-preferences-page-editor.ui</file>
     <file>ui/gb-preferences-page-git.ui</file>
diff --git a/src/resources/keybindings/default.ini b/src/resources/keybindings/default.ini
index 34db016..280b778 100644
--- a/src/resources/keybindings/default.ini
+++ b/src/resources/keybindings/default.ini
@@ -25,7 +25,7 @@ open = <Control><Shift>O
 reformat = <Control><Shift>R
 save = <Control>S
 save-as = <Control><Shift>S
-toggle-preview = <Control><Alt>P
+preview = <Control><Alt>P
 scroll-up = <Control>Y
 scroll-down = <Control>E
 toggle-split = <Control><Shift>J
diff --git a/src/resources/ui/gb-markdown-tab.ui b/src/resources/ui/gb-markdown-tab.ui
new file mode 100644
index 0000000..ec49413
--- /dev/null
+++ b/src/resources/ui/gb-markdown-tab.ui
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.8 -->
+  <template class="GbMarkdownTab" parent="GbTab">
+    <property name="visible">true</property>
+    <child internal-child="content">
+      <object class="GtkBox">
+        <child>
+          <object class="GbMarkdownPreview" id="preview">
+            <property name="visible">true</property>
+            <property name="expand">true</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </template>
+</interface>


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