From 2b06998c477d66b8eb3df3048abb7669c950eb61 Mon Sep 17 00:00:00 2001
From: Michael Danilov <mike.d.ft402@gmail.com>
Date: Tue, 9 Feb 2021 13:48:48 +0100
Subject: [PATCH] Add option to move chat to the left and align left.

---
 gui/dialogs/view.xml | 44 +++++++++++++++++++-------------------------
 1 file changed, 19 insertions(+), 25 deletions(-)

diff --git a/gui/dialogs/view.xml b/gui/dialogs/view.xml
index b505f0249..ca6422a11 100644
--- a/gui/dialogs/view.xml
+++ b/gui/dialogs/view.xml
@@ -48,12 +48,6 @@
           target.getNode("property").setValue(enabled.getPath());
         }
       }
-
-      if (getprop("/sim/gui/chat-box-location") == "left") {
-        setprop("/sim/gui/dialogs/view/chat-box-left-checked", 1);
-      } else {
-        setprop("/sim/gui/dialogs/view/chat-box-left-checked", 0);
-      }
     </open>
   </nasal>
 
@@ -153,25 +147,25 @@
         </binding>
       </checkbox>
 
-      <checkbox>
-        <live>true</live>
-        <halign>left</halign>
-        <label>Chat and event log on the left (requires restart)</label>
-        <property>/sim/gui/dialogs/view/chat-box-left-checked</property>
-        <binding>
-          <command>dialog-apply</command>
-        </binding>
-        <binding>
-          <command>nasal</command>
-          <script>
-           if (getprop("/sim/gui/dialogs/view/chat-box-left-checked")) {
-             setprop("/sim/gui/chat-box-location", "left");
-           } else {
-             setprop("/sim/gui/chat-box-location", "default");
-           }
-          </script>
-        </binding>
-      </checkbox>
+      <group>
+        <layout>hbox</layout>
+
+        <text>
+          <label>Chat and event log position (requires restart):</label>
+        </text>
+
+        <combo>
+          <name>chatlocation</name>
+          <property>/sim/gui/chat-box-location</property>
+          <value>default</value>
+          <value>left</value>
+          <binding>
+            <command>dialog-apply</command>
+            <object-name>chatlocation</object-name>
+          </binding>
+        </combo>
+
+      </group>
 
       <checkbox>
         <halign>left</halign>