Disabled loading animation in shipbrowser, it will be soon be replaced with a proper custom control (using animated gifs isn't such a great idea because it looks ugly on darker themes)
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import wx
|
import wx
|
||||||
import wx.animate
|
|
||||||
import copy
|
import copy
|
||||||
from gui import bitmapLoader
|
from gui import bitmapLoader
|
||||||
import gui.mainFrame
|
import gui.mainFrame
|
||||||
@@ -145,7 +144,7 @@ class ShipBrowser(wx.Panel):
|
|||||||
|
|
||||||
self.lpane.RefreshList()
|
self.lpane.RefreshList()
|
||||||
self.Show()
|
self.Show()
|
||||||
self.lpane.ShowLoading(False)
|
# self.lpane.ShowLoading(False)
|
||||||
|
|
||||||
def stage2(self, event):
|
def stage2(self, event):
|
||||||
back = event.back
|
back = event.back
|
||||||
@@ -158,7 +157,7 @@ class ShipBrowser(wx.Panel):
|
|||||||
|
|
||||||
content = self.stage2Cache.get(categoryID,None)
|
content = self.stage2Cache.get(categoryID,None)
|
||||||
if not content:
|
if not content:
|
||||||
self.lpane.ShowLoading(True)
|
# self.lpane.ShowLoading(True)
|
||||||
self.lpane.RemoveAllChildren()
|
self.lpane.RemoveAllChildren()
|
||||||
sMarket = service.Market.getInstance()
|
sMarket = service.Market.getInstance()
|
||||||
sMarket.getShipListDelayed(self.stage2Callback, categoryID)
|
sMarket.getShipListDelayed(self.stage2Callback, categoryID)
|
||||||
@@ -740,23 +739,23 @@ class ListPane (wx.ScrolledWindow):
|
|||||||
self.Bind(wx.EVT_SCROLLWIN_LINEUP, self.MScrollUp)
|
self.Bind(wx.EVT_SCROLLWIN_LINEUP, self.MScrollUp)
|
||||||
self.Bind(wx.EVT_SCROLLWIN_LINEDOWN, self.MScrollDown)
|
self.Bind(wx.EVT_SCROLLWIN_LINEDOWN, self.MScrollDown)
|
||||||
self.Bind(wx.EVT_CHILD_FOCUS, self.OnChildFocus)
|
self.Bind(wx.EVT_CHILD_FOCUS, self.OnChildFocus)
|
||||||
self.loadingAnim = wx.animate.Animation(os.path.join(config.path,"icons/fit_loading.gif"))
|
# self.loadingAnim = wx.animate.Animation(os.path.join(config.path,"icons/fit_loading.gif"))
|
||||||
self.animCtrl = wx.animate.AnimationCtrl(self, -1, self.loadingAnim)
|
# self.animCtrl = wx.animate.AnimationCtrl(self, -1, self.loadingAnim)
|
||||||
self.animCtrl.SetUseWindowBackgroundColour()
|
# self.animCtrl.SetUseWindowBackgroundColour()
|
||||||
self.animCtrl.Hide()
|
# self.animCtrl.Hide()
|
||||||
|
|
||||||
def ShowLoading(self, mode = True):
|
# def ShowLoading(self, mode = True):
|
||||||
if mode:
|
# if mode:
|
||||||
aweight,aheight = self.animCtrl.GetSize()
|
# aweight,aheight = self.animCtrl.GetSize()
|
||||||
cweight,cheight = self.GetSize()
|
# cweight,cheight = self.GetSize()
|
||||||
ax = (cweight - aweight)/2
|
# ax = (cweight - aweight)/2
|
||||||
ay = (cheight - aheight)/2
|
# ay = (cheight - aheight)/2
|
||||||
self.animCtrl.SetPosition((ax,ay))
|
# self.animCtrl.SetPosition((ax,ay))
|
||||||
self.animCtrl.Show()
|
# self.animCtrl.Show()
|
||||||
self.animCtrl.Play()
|
# self.animCtrl.Play()
|
||||||
else:
|
# else:
|
||||||
self.animCtrl.Stop()
|
# self.animCtrl.Stop()
|
||||||
self.animCtrl.Hide()
|
# self.animCtrl.Hide()
|
||||||
|
|
||||||
def OnChildFocus(self, event):
|
def OnChildFocus(self, event):
|
||||||
event.Skip()
|
event.Skip()
|
||||||
|
|||||||
Reference in New Issue
Block a user