From c99d493755048c5929568c1f263395c83388eeab Mon Sep 17 00:00:00 2001
From: Marko Mecina <marko.mecina@univie.ac.at>
Date: Wed, 14 Dec 2022 12:44:11 +0100
Subject: [PATCH] minor GUI fixes

---
 Ccs/editor.py        | 13 ++++++-------
 Tst/tst/app_menu.xml |  5 +++--
 Tst/tst/tst.py       |  8 ++++++--
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/Ccs/editor.py b/Ccs/editor.py
index ec8519c..40cbceb 100644
--- a/Ccs/editor.py
+++ b/Ccs/editor.py
@@ -169,8 +169,12 @@ class CcsEditor(Gtk.Window):
         menubar = self.create_menus()
         self.grid.attach(menubar, 0, 0, 3, 1)
 
+        toolbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
         toolbar = self.create_toolbar()
-        self.grid.attach(toolbar, 0, 1, 2, 1)
+        toolbox.pack_start(toolbar, 1, 1, 0)
+        self.univie_box = self.create_univie_box()
+        toolbox.pack_end(self.univie_box, 0, 0, 0)
+        self.grid.attach(toolbox, 0, 1, 3, 1)
 
         self.search_context = None
         self.editor_notebook = Gtk.Notebook()
@@ -180,9 +184,6 @@ class CcsEditor(Gtk.Window):
         self.searchbar = self.create_searchbar()
         self.grid.attach(self.searchbar, 0, 2, 3, 1)
 
-        self.univie_box = self.create_univie_box()
-        self.grid.attach(self.univie_box, 2, 1, 1, 1)
-
         self.sourcemarks = {}
         self.create_mark_attributes()
 
@@ -1110,8 +1111,6 @@ class CcsEditor(Gtk.Window):
         # button_reload_config.connect("clicked", self.reload_config)
         # toolbar.add(button_reload_config)
 
-        toolbar.add(Gtk.SeparatorToolItem())
-
         return toolbar
 
     def create_action_buttons(self, toolbar, targets, nbutt=10):
@@ -1426,7 +1425,7 @@ class CcsEditor(Gtk.Window):
         manage communication
         :return:
         """
-        univie_box = Gtk.HBox()
+        univie_box = Gtk.Toolbar()
         univie_button = Gtk.ToolButton()
         # button_run_nextline.set_icon_name("media-playback-start-symbolic")
         pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(os.path.join(pixmap_folder, 'Icon_Space_blau_en.png'), 48, 48)
diff --git a/Tst/tst/app_menu.xml b/Tst/tst/app_menu.xml
index db4430c..155f5ba 100644
--- a/Tst/tst/app_menu.xml
+++ b/Tst/tst/app_menu.xml
@@ -11,6 +11,7 @@
                 <item>
                     <attribute name="label" translatable="yes">Open</attribute>
                     <attribute name="action">win.open</attribute>
+                    <attribute name="accel">&lt;Primary&gt;o</attribute>
                 </item>
                 <item>
                     <attribute name="label" translatable="yes">Save</attribute>
@@ -95,10 +96,10 @@
                     <attribute name="label" translatable="yes">Show JSON of the model</attribute>
                     <attribute name="action">win.model_viewer_toggle_hide</attribute>
                 </item>
-                <item>
+<!--                <item>
                     <attribute name="label" translatable="yes">Apply CSS</attribute>
                     <attribute name="action">win.apply_css</attribute>
-                </item>
+                </item>-->
                 <item>
                     <attribute name="label" translatable="yes">About</attribute>
                     <attribute name="action">win.about_us</attribute>
diff --git a/Tst/tst/tst.py b/Tst/tst/tst.py
index 67455c4..3c44e82 100755
--- a/Tst/tst/tst.py
+++ b/Tst/tst/tst.py
@@ -331,6 +331,7 @@ class TstAppWindow(Gtk.ApplicationWindow):
 
         # add the notebook for the test specifications
         self.notebook = Gtk.Notebook()
+        self.notebook.set_scrollable(True)
         self.notebook.connect('switch-page', self.update_model_viewer)
         self.work_desk.pack1(self.notebook)
 
@@ -482,6 +483,8 @@ class TstAppWindow(Gtk.ApplicationWindow):
             label_text = 'New test'
         label = self.notebook_page_label(label_text=label_text)
         page_index = self.notebook.append_page(child=test_instance.view, tab_label=label)
+        self.notebook.set_tab_reorderable(test_instance.view, True)
+
         # reload the data of the widgets, in order to display it
         test_instance.view.update_widget_data()
         self.show_all()
@@ -493,10 +496,11 @@ class TstAppWindow(Gtk.ApplicationWindow):
         label = Gtk.Label()
         label.set_text(label_text)
         btn_close = Gtk.Button.new_from_icon_name('window-close-symbolic', Gtk.IconSize.BUTTON)
-        btn_close.set_tooltip_text('Close')
+        btn_close.set_tooltip_text('close')
+        btn_close.set_relief(Gtk.ReliefStyle.NONE)
         btn_close.connect('clicked', self.on_close_clicked)
         box.pack_start(label, True, True, 0)
-        box.pack_start(btn_close, True, True, 0)
+        box.pack_start(btn_close, True, True, 3)
         box.show_all()
         return box
 
-- 
GitLab