Chats, plantillas, movidas varias.

This commit is contained in:
Jesús Pavón Abián
2026-02-03 13:28:12 +01:00
parent 5f9cf2c25b
commit 7754cccc2e
10 changed files with 596 additions and 133 deletions
+22 -4
View File
@@ -105,27 +105,44 @@ class UserPanel(wx.Panel):
self.list.list.SetFocus()
class ChatPanel(wx.Panel):
"""Panel for conversation list, similar to Mastodon's conversationListPanel."""
def __init__(self, parent, name, account="Unknown"):
super().__init__(parent, name=name)
self.name = name
self.account = account
self.type = "chat"
self.sizer = wx.BoxSizer(wx.VERTICAL)
# List: Participants, Last Message, Date
self.list = widgets.list(self, _("Participants"), _("Last Message"), _("Date"), style=wx.LC_REPORT | wx.LC_SINGLE_SEL | wx.LC_VRULES)
# List: User, Text, Date (like Mastodon)
self.list = widgets.list(self, _("User"), _("Text"), _("Date"), style=wx.LC_REPORT | wx.LC_SINGLE_SEL | wx.LC_VRULES)
self.list.set_windows_size(0, 200)
self.list.set_windows_size(1, 600)
self.list.set_windows_size(2, 200)
self.list.set_size()
# Buttons (like Mastodon: Post, Reply)
self.post = wx.Button(self, -1, _("Post"))
self.reply = wx.Button(self, -1, _("Reply"))
self.new_chat = wx.Button(self, -1, _("New Chat"))
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
btnSizer.Add(self.post, 0, wx.ALL, 5)
btnSizer.Add(self.reply, 0, wx.ALL, 5)
btnSizer.Add(self.new_chat, 0, wx.ALL, 5)
self.sizer.Add(btnSizer, 0, wx.ALL, 5)
self.sizer.Add(self.list.list, 1, wx.EXPAND | wx.ALL, 5)
self.SetSizer(self.sizer)
def set_focus_function(self, func):
self.list.list.Bind(wx.EVT_LIST_ITEM_FOCUSED, func)
def set_position(self, reversed=False):
if reversed == False:
self.list.select_item(self.list.get_count()-1)
else:
self.list.select_item(0)
def set_focus_in_list(self):
self.list.list.SetFocus()
@@ -136,6 +153,7 @@ class ChatMessagePanel(HomePanel):
# Adjust buttons for chat
self.repost.Hide()
self.like.Hide()
self.dm.Hide() # Hide Chat button since we're already in a chat
self.reply.SetLabel(_("Send Message"))
# Refresh columns