From f2983da0eff856a84dacf35b4e039786916bf245 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Thu, 6 Jan 2022 17:59:24 +0100 Subject: [PATCH] Set scrollrate --- src/main.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main.py b/src/main.py index ea01a87..5b6711d 100644 --- a/src/main.py +++ b/src/main.py @@ -17,6 +17,7 @@ WIDTH = 720 / 2 HEIGHT = 1440 / 2 BTN_HEIGHT = 40 SPACER_HEIGHT = 10 +SCROLL_RATE = 5 BM_BTN_STYLE = wx.BOTTOM | wx.EXPAND | wx.LEFT | wx.TOP BTN_STYLE = wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT @@ -40,7 +41,7 @@ class Cast(wx.Frame): self, -1, style=wx.VSCROLL ) self.m_control = None - self.m_panel.SetupScrolling() + self.m_panel.SetupScrolling(rate_y=SCROLL_RATE,scrollToTop=True) self.m_panel.SetSizer(self.m_sizer) self.m_providers: list[ChannelProvider] = [ ChannelProvider( @@ -97,7 +98,7 @@ class Cast(wx.Frame): self.m_sizer.Add(btn_sizer) provider_index += 1 - self.m_panel.SetupScrolling() + self.m_panel.SetupScrolling(rate_y=SCROLL_RATE,scrollToTop=True) self.m_panel.SetSizer(self.m_sizer) self.m_sizer.Fit(self) self.m_sizer.Layout() @@ -118,7 +119,7 @@ class Cast(wx.Frame): self.m_sizer.Add(btn_sizer) channel_index += 1 - self.m_panel.SetupScrolling() + self.m_panel.SetupScrolling(rate_y=SCROLL_RATE,scrollToTop=True) self.m_panel.SetSizer(self.m_sizer) self.m_sizer.Fit(self) self.m_sizer.Layout() @@ -159,7 +160,7 @@ class Cast(wx.Frame): self.m_sizer.Add(inner_sizer) self.m_sizer.AddSpacer(SPACER_HEIGHT) self.m_index = self.m_index + 1 - self.m_panel.SetupScrolling() + self.m_panel.SetupScrolling(rate_y=SCROLL_RATE,scrollToTop=True) self.m_panel.SetSizer(self.m_sizer) self.m_sizer.Fit(self) self.m_sizer.Layout() @@ -222,7 +223,7 @@ class Cast(wx.Frame): self.Bind(wx.media.EVT_MEDIA_FINISHED, self.show_video_list) self.load_uri(uri) - self.m_panel.SetupScrolling() + self.m_panel.SetupScrolling(rate_y=SCROLL_RATE,scrollToTop=True) self.m_panel.SetSizer(self.m_sizer) self.m_sizer.Fit(self) self.m_sizer.Layout() @@ -249,7 +250,7 @@ class Cast(wx.Frame): ), ) self.m_sizer.Add(btn)#, wx.ALIGN_CENTER_VERTICAL) - self.m_panel.SetupScrolling() + self.m_panel.SetupScrolling(rate_y=SCROLL_RATE,scrollToTop=True) self.m_panel.SetSizer(self.m_sizer) self.m_sizer.Fit(self) self.m_sizer.Layout()