From 4c58a718a28b2ec43680e094d9dd52fbc1544316 Mon Sep 17 00:00:00 2001
From: Marko Mecina <marko.mecina@univie.ac.at>
Date: Wed, 23 Nov 2022 14:59:20 +0100
Subject: [PATCH] add paned view to TM/TC tables in TST

---
 Tst/tst/tc_management.py | 11 +++++++++--
 Tst/tst/tm_management.py | 11 +++++++++--
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/Tst/tst/tc_management.py b/Tst/tst/tc_management.py
index 8ea27a8..684dd01 100644
--- a/Tst/tst/tc_management.py
+++ b/Tst/tst/tc_management.py
@@ -198,7 +198,13 @@ class TcTable(Gtk.Grid):
         self.scrollable_treelist = Gtk.ScrolledWindow()
         self.scrollable_treelist.set_vexpand(True)
         self.scrollable_treelist.set_hexpand(True)
-        self.attach(self.scrollable_treelist, 0, 1, 8, 10)
+        self.paned = Gtk.Paned(orientation=Gtk.Orientation.VERTICAL)
+        self.paned.set_wide_handle(True)
+        self.paned.set_position(int(cfl.cfg['tst-preferences']['main-window-height']) * 0.6)
+        # self.attach(self.scrollable_treelist, 0, 1, 8, 10)
+        self.attach(self.paned, 0, 1, 8, 10)
+
+        self.paned.add1(self.scrollable_treelist)
 
         self.scrollable_treelist.add(self.treeview)
 
@@ -207,7 +213,8 @@ class TcTable(Gtk.Grid):
         self.attach_next_to(self.command_entry, self.scrollable_treelist, Gtk.PositionType.BOTTOM, 8, 1)
 
         self.variable_box = CommandDescriptionBox()
-        self.attach_next_to(self.variable_box, self.command_entry, Gtk.PositionType.BOTTOM, 8, 5)
+        # self.attach_next_to(self.variable_box, self.command_entry, Gtk.PositionType.BOTTOM, 8, 5)
+        self.paned.add2(self.variable_box)
 
         # Set up Drag and Drop
         self.treeview.drag_source_set(Gdk.ModifierType.BUTTON1_MASK, [], Gdk.DragAction.COPY)
diff --git a/Tst/tst/tm_management.py b/Tst/tst/tm_management.py
index 7105be0..a6c6d5b 100644
--- a/Tst/tst/tm_management.py
+++ b/Tst/tst/tm_management.py
@@ -120,7 +120,13 @@ class TmTable(Gtk.Grid):
         self.scrollable_treelist = Gtk.ScrolledWindow()
         self.scrollable_treelist.set_vexpand(True)
         self.scrollable_treelist.set_hexpand(True)
-        self.attach(self.scrollable_treelist, 0, 1, 8, 10)
+        self.paned = Gtk.Paned(orientation=Gtk.Orientation.VERTICAL)
+        self.paned.set_wide_handle(True)
+        self.paned.set_position(int(cfl.cfg['tst-preferences']['main-window-height']) * 0.6)
+        # self.attach(self.scrollable_treelist, 0, 1, 8, 10)
+        self.attach(self.paned, 0, 1, 8, 10)
+
+        self.paned.add1(self.scrollable_treelist)
 
         self.scrollable_treelist.add(self.treeview)
 
@@ -129,7 +135,8 @@ class TmTable(Gtk.Grid):
         # self.attach_next_to(self.telemetry_entry, self.scrollable_treelist, Gtk.PositionType.BOTTOM, 8, 1)
 
         self.secondary_box = TmSecondaryTable()
-        self.attach_next_to(self.secondary_box, self.scrollable_treelist, Gtk.PositionType.BOTTOM, 8, 5)
+        # self.attach_next_to(self.secondary_box, self.scrollable_treelist, Gtk.PositionType.BOTTOM, 8, 5)
+        self.paned.add2(self.secondary_box)
 
         # Set up Drag and Drop
         self.treeview.drag_source_set(Gdk.ModifierType.BUTTON1_MASK, [], Gdk.DragAction.COPY)
-- 
GitLab