Fix border around buttonsizer
This commit is contained in:
parent
73ffe573fb
commit
67589b5def
2 changed files with 8 additions and 8 deletions
|
@ -18,7 +18,7 @@ from Items import Item
|
|||
|
||||
HEIGHT = int(1440 / 2)
|
||||
BTN_HEIGHT = 40
|
||||
SIZE = wx.Size(100, 68)
|
||||
SIZE = wx.Size(68,100)
|
||||
MYPATH = path.dirname(path.abspath(__file__))
|
||||
SCREEN_WIDTH = int(720 / 2)
|
||||
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,
|
||||
str],
|
||||
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 bitmap_or_str.startswith('http'): # 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,
|
||||
bitmap,
|
||||
style=btn_style,
|
||||
size=bitmap.GetSize())
|
||||
size=wx.Size(100,68))
|
||||
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,
|
||||
wx.ID_ANY,
|
||||
text,
|
||||
style=wx.BORDER_NONE | wx.BU_AUTODRAW,
|
||||
size=wx.Size(SCREEN_WIDTH - SIZE.GetWidth(),
|
||||
size=wx.Size(SCREEN_WIDTH - 100,
|
||||
SIZE.GetHeight()))
|
||||
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_text)
|
||||
|
||||
|
|
|
@ -226,7 +226,7 @@ class Cast(wx.Frame):
|
|||
label="Close",
|
||||
size=(WIDTH, BTN_HEIGHT))
|
||||
closebtn.Bind(wx.EVT_BUTTON, lambda event: self.Destroy())
|
||||
self.m_sizer.Add(closebtn)
|
||||
self.m_sizer.Add(closebtn, 0, wx.ALL,1)
|
||||
provider_index = 0
|
||||
|
||||
for provider in self.m_providers:
|
||||
|
@ -236,7 +236,7 @@ class Cast(wx.Frame):
|
|||
btn_sizer: wx.BoxSizer = make_sized_button(self.m_panel, bitmap,
|
||||
provider.get_name(),
|
||||
callback)
|
||||
self.m_sizer.Add(btn_sizer)
|
||||
self.m_sizer.Add(btn_sizer,0,wx.ALL,1)
|
||||
provider_index += 1
|
||||
|
||||
self.m_panel.SetupScrolling(rate_y=SCROLL_RATE, scrollToTop=True)
|
||||
|
|
Loading…
Add table
Reference in a new issue