fixed stuff with theming, should look the same on windows and linux now!

This commit is contained in:
2025-11-27 17:21:03 +01:00
parent a2ef1bf2d5
commit 0c7b2d3bdb
3 changed files with 84 additions and 20 deletions

View File

@@ -14,15 +14,18 @@ class IRCPanel(wx.Panel):
self.parent = parent
self.main_frame = main_frame
self.messages = []
self.theme = getattr(self.main_frame, "theme", None)
self.default_text_colour = self.theme["text"] if self.theme else wx.Colour(0, 0, 0)
sizer = wx.BoxSizer(wx.VERTICAL)
# Use a better font for chat with white theme
self.text_ctrl = wx.TextCtrl(self, style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2 | wx.TE_AUTO_URL)
# White theme colors
self.text_ctrl.SetBackgroundColour(wx.Colour(255, 255, 255)) # White background
self.text_ctrl.SetForegroundColour(wx.Colour(0, 0, 0)) # Black text
if self.theme:
self.text_ctrl.SetBackgroundColour(self.theme["content_bg"])
self.text_ctrl.SetForegroundColour(self.theme["text"])
self.SetBackgroundColour(self.theme["content_bg"])
# Load appropriate font
self.font = self.load_system_font()
@@ -143,7 +146,7 @@ class IRCPanel(wx.Panel):
if message_color:
attr.SetTextColour(message_color)
else:
attr.SetTextColour(wx.Colour(0, 0, 0)) # Black text for white theme
attr.SetTextColour(self.default_text_colour)
attr.SetFont(self.font)
self.text_ctrl.SetDefaultStyle(attr)
@@ -169,7 +172,7 @@ class IRCPanel(wx.Panel):
self.add_message(message, f"* {username}", username_color, wx.Colour(128, 0, 128), italic=True) # Dark purple for actions
else:
message = f"{timestamp}<{username}> {content}"
self.add_message(message, f"<{username}>", username_color, wx.Colour(0, 0, 0)) # Black text
self.add_message(message, f"<{username}>", username_color, self.default_text_colour)
except Exception as e:
logger.error(f"Error adding formatted message: {e}")