|
|
@ -18,7 +18,7 @@ from Items import Item
|
|
|
|
|
|
|
|
|
|
|
|
HEIGHT = int(1440 / 2)
|
|
|
|
HEIGHT = int(1440 / 2)
|
|
|
|
BTN_HEIGHT = 40
|
|
|
|
BTN_HEIGHT = 40
|
|
|
|
SIZE = wx.Size(100, 68)
|
|
|
|
SIZE = wx.Size(68,100)
|
|
|
|
MYPATH = path.dirname(path.abspath(__file__))
|
|
|
|
MYPATH = path.dirname(path.abspath(__file__))
|
|
|
|
SCREEN_WIDTH = int(720 / 2)
|
|
|
|
SCREEN_WIDTH = int(720 / 2)
|
|
|
|
BASEPATH = path.join(str(environ.get("HOME")), '.config/cast')
|
|
|
|
BASEPATH = path.join(str(environ.get("HOME")), '.config/cast')
|
|
|
@ -228,7 +228,7 @@ def import_from_newpipe(filename) -> None:
|
|
|
|
def make_sized_button(parent_pnl: wx.Panel, bitmap_or_str: Union[wx.Bitmap,
|
|
|
|
def make_sized_button(parent_pnl: wx.Panel, bitmap_or_str: Union[wx.Bitmap,
|
|
|
|
str],
|
|
|
|
str],
|
|
|
|
text: str, callback: Callable) -> wx.BoxSizer:
|
|
|
|
text: str, callback: Callable) -> wx.BoxSizer:
|
|
|
|
btn_sizer = wx.BoxSizer(wx.HORIZONTAL)
|
|
|
|
btn_sizer = wx.StaticBoxSizer(wx.HORIZONTAL,parent_pnl)
|
|
|
|
if type(bitmap_or_str) == type(str):
|
|
|
|
if type(bitmap_or_str) == type(str):
|
|
|
|
if bitmap_or_str.startswith('http'): # type: ignore
|
|
|
|
if bitmap_or_str.startswith('http'): # type: ignore
|
|
|
|
bitmap = make_bitmap_from_url(bitmap_or_str) # type: ignore
|
|
|
|
bitmap = make_bitmap_from_url(bitmap_or_str) # type: ignore
|
|
|
@ -241,18 +241,18 @@ def make_sized_button(parent_pnl: wx.Panel, bitmap_or_str: Union[wx.Bitmap,
|
|
|
|
wx.ID_ANY,
|
|
|
|
wx.ID_ANY,
|
|
|
|
bitmap,
|
|
|
|
bitmap,
|
|
|
|
style=btn_style,
|
|
|
|
style=btn_style,
|
|
|
|
size=bitmap.GetSize())
|
|
|
|
size=wx.Size(100,68))
|
|
|
|
btn_logo.SetToolTip(text)
|
|
|
|
btn_logo.SetToolTip(text)
|
|
|
|
btn_sizer.Add(btn_logo, 0, wx.BOTTOM | wx.EXPAND | wx.LEFT | wx.TOP, 1)
|
|
|
|
btn_sizer.Add(btn_logo, 0, wx.EXPAND, 1)
|
|
|
|
|
|
|
|
|
|
|
|
btn_text = wx.Button(parent_pnl,
|
|
|
|
btn_text = wx.Button(parent_pnl,
|
|
|
|
wx.ID_ANY,
|
|
|
|
wx.ID_ANY,
|
|
|
|
text,
|
|
|
|
text,
|
|
|
|
style=wx.BORDER_NONE | wx.BU_AUTODRAW,
|
|
|
|
style=wx.BORDER_NONE | wx.BU_AUTODRAW,
|
|
|
|
size=wx.Size(SCREEN_WIDTH - SIZE.GetWidth(),
|
|
|
|
size=wx.Size(SCREEN_WIDTH - 100,
|
|
|
|
SIZE.GetHeight()))
|
|
|
|
SIZE.GetHeight()))
|
|
|
|
btn_text.SetToolTip(text)
|
|
|
|
btn_text.SetToolTip(text)
|
|
|
|
btn_sizer.Add(btn_text, 0, wx.BOTTOM | wx.RIGHT | wx.TOP | wx.EXPAND, 1)
|
|
|
|
btn_sizer.Add(btn_text, 0, wx.EXPAND, 1)
|
|
|
|
parent_pnl.Bind(wx.EVT_BUTTON, callback, btn_logo)
|
|
|
|
parent_pnl.Bind(wx.EVT_BUTTON, callback, btn_logo)
|
|
|
|
parent_pnl.Bind(wx.EVT_BUTTON, callback, btn_text)
|
|
|
|
parent_pnl.Bind(wx.EVT_BUTTON, callback, btn_text)
|
|
|
|
|
|
|
|
|
|
|
|