mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-01-19 00:40:42 -06:00
Added a base mastodon buffer GUI
This commit is contained in:
parent
5687cf6a62
commit
6b9540a0a8
@ -1,3 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import twitter
|
||||
from . import twitter, mastodon
|
||||
from .panels import accountPanel, emptyPanel
|
||||
|
2
src/wxUI/buffers/mastodon/__init__.py
Normal file
2
src/wxUI/buffers/mastodon/__init__.py
Normal file
@ -0,0 +1,2 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from .base import basePanel
|
45
src/wxUI/buffers/mastodon/base.py
Normal file
45
src/wxUI/buffers/mastodon/base.py
Normal file
@ -0,0 +1,45 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import wx
|
||||
from multiplatform_widgets import widgets
|
||||
|
||||
class basePanel(wx.Panel):
|
||||
|
||||
def set_focus_function(self, f):
|
||||
self.list.list.Bind(wx.EVT_LIST_ITEM_FOCUSED, f)
|
||||
|
||||
def create_list(self):
|
||||
self.list = widgets.list(self, _(u"User"), _(u"Text"), _(u"Date"), _(u"Client"), style=wx.LC_REPORT|wx.LC_SINGLE_SEL|wx.LC_VRULES)
|
||||
self.list.set_windows_size(0, 60)
|
||||
self.list.set_windows_size(1, 320)
|
||||
self.list.set_windows_size(2, 110)
|
||||
self.list.set_windows_size(3, 84)
|
||||
self.list.set_size()
|
||||
|
||||
def __init__(self, parent, name):
|
||||
super(basePanel, self).__init__(parent)
|
||||
self.name = name
|
||||
self.type = "baseBuffer"
|
||||
self.sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
self.create_list()
|
||||
self.toot = wx.Button(self, -1, _("Toot"))
|
||||
self.retoot = wx.Button(self, -1, _("Retoot"))
|
||||
self.reply = wx.Button(self, -1, _(u"Reply"))
|
||||
self.dm = wx.Button(self, -1, _(u"Direct message"))
|
||||
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
btnSizer.Add(self.tweet, 0, wx.ALL, 5)
|
||||
btnSizer.Add(self.retweet, 0, wx.ALL, 5)
|
||||
btnSizer.Add(self.reply, 0, wx.ALL, 5)
|
||||
btnSizer.Add(self.dm, 0, wx.ALL, 5)
|
||||
self.sizer.Add(btnSizer, 0, wx.ALL, 5)
|
||||
self.sizer.Add(self.list.list, 0, wx.ALL|wx.EXPAND, 5)
|
||||
self.SetSizer(self.sizer)
|
||||
self.SetClientSize(self.sizer.CalcMin())
|
||||
|
||||
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()
|
Loading…
x
Reference in New Issue
Block a user