Skip to content

Commit c293d04

Browse files
committed
chat: fix reply window colour display
also fix background colour on windows
1 parent a6402fe commit c293d04

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

MAVProxy/modules/mavproxy_chat/chat_window.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def __init__(self, mpstate):
2626
# create chat window
2727
self.app = wx.App()
2828
self.frame = wx.Frame(None, title="Chat", size=(650, 200))
29+
self.frame.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW))
2930

3031
# add menu
3132
self.menu = wx.Menu()
@@ -63,7 +64,7 @@ def __init__(self, mpstate):
6364
self.horiz_sizer.Add(self.send_button, proportion = 0, flag = wx.ALIGN_TOP | wx.ALL, border = 5)
6465

6566
# add a reply box and read-only text box
66-
self.text_reply = wx.TextCtrl(self.frame, id=-1, size=(600, 80), style=wx.TE_READONLY | wx.TE_MULTILINE)
67+
self.text_reply = wx.TextCtrl(self.frame, id=-1, size=(600, 80), style=wx.TE_READONLY | wx.TE_MULTILINE | wx.TE_RICH)
6768

6869
# add a read-only status text box at the bottom
6970
self.text_status = wx.TextCtrl(self.frame, id=-1, size=(600, -1), style=wx.TE_READONLY)
@@ -158,7 +159,7 @@ def send_text_to_assistant(self):
158159

159160
# copy user input text to reply box
160161
orig_text_attr = self.text_reply.GetDefaultStyle()
161-
wx.CallAfter(self.text_reply.SetDefaultStyle, wx.TextAttr(wx.RED, alignment=wx.TEXT_ALIGNMENT_RIGHT))
162+
wx.CallAfter(self.text_reply.SetDefaultStyle, wx.TextAttr(wx.RED))
162163
wx.CallAfter(self.text_reply.AppendText, send_text + "\n")
163164

164165
# send text to assistant and place reply in reply box

0 commit comments

Comments
 (0)