Merge branch 'master' of evefit.org:pyfa
This commit is contained in:
@@ -162,20 +162,22 @@ class PFNotebook(wx.Panel):
|
||||
def SetPageText(self, i, text, refresh=False):
|
||||
tab = self.tabsContainer.tabs[i]
|
||||
tab.text = text
|
||||
tab._Render()
|
||||
if refresh:
|
||||
self.Refresh()
|
||||
# tab._Render()
|
||||
# if refresh:
|
||||
# self.Refresh()
|
||||
|
||||
def SetPageIcon(self, i, icon, refresh=False):
|
||||
tab = self.tabsContainer.tabs[i]
|
||||
tab.img = icon
|
||||
tab._Render()
|
||||
if refresh:
|
||||
self.Refresh()
|
||||
tab.tabImg = icon
|
||||
# tab._Render()
|
||||
# if refresh:
|
||||
# self.Refresh()
|
||||
|
||||
def SetPageTextIcon(self, i, text=wx.EmptyString, icon=None):
|
||||
self.SetPageText(i, text)
|
||||
self.SetPageIcon(i, icon)
|
||||
print icon
|
||||
self.tabsContainer.AdjustTabsSize()
|
||||
self.Refresh()
|
||||
|
||||
def Refresh(self):
|
||||
@@ -214,7 +216,6 @@ class PFTabRenderer:
|
||||
|
||||
self.inclination = inclination
|
||||
self.text = text
|
||||
self.img = img
|
||||
self.tabSize = (width, height)
|
||||
self.closeButton = closeButton
|
||||
self.fontSize = fontSize
|
||||
@@ -430,7 +431,6 @@ class PFTabRenderer:
|
||||
r.height = height
|
||||
mdc.DrawBitmap(self.tabBackBitmap, 0, 0, True)
|
||||
|
||||
|
||||
if self.tabImg:
|
||||
bmp = wx.BitmapFromImage(self.tabImg)
|
||||
if self.contentWidth > 16:
|
||||
@@ -577,12 +577,12 @@ class PFAddRenderer:
|
||||
|
||||
|
||||
class PFTabsContainer(wx.Panel):
|
||||
def __init__(self, parent, pos = (0,0), size = (100,27), id = wx.ID_ANY):
|
||||
def __init__(self, parent, pos = (0,0), size = (100,24), id = wx.ID_ANY):
|
||||
wx.Panel.__init__(self, parent, id , pos, size)
|
||||
self.tabs = []
|
||||
width, height = size
|
||||
self.width = width
|
||||
self.height = height - 3
|
||||
self.height = height
|
||||
self.containerHeight = height
|
||||
self.startDrag = False
|
||||
self.dragging = False
|
||||
|
||||
@@ -146,7 +146,7 @@ class FittingView(d.Display):
|
||||
def updateTab(self):
|
||||
cFit = service.Fit.getInstance()
|
||||
fit = cFit.getFit(self.getActiveFit())
|
||||
bitmap = bitmapLoader.getBitmap("race_%s_small", "icons")
|
||||
bitmap = bitmapLoader.getImage("race_%s_small" % fit.ship.item.race, "icons")
|
||||
text = "%s: %s" % (fit.ship.item.name, fit.name)
|
||||
self.parent.SetPageTextIcon(self.parent.GetSelection(), text, bitmap)
|
||||
|
||||
@@ -251,19 +251,17 @@ class FittingView(d.Display):
|
||||
cFit = service.Fit.getInstance()
|
||||
selection = []
|
||||
sel = self.GetFirstSelected()
|
||||
contexts = set()
|
||||
while sel != -1:
|
||||
contexts = []
|
||||
if sel != -1:
|
||||
mod = self.mods[self.GetItemData(sel)]
|
||||
if not mod.isEmpty:
|
||||
contexts.add("module")
|
||||
contexts.append("module")
|
||||
if mod.charge is not None and "ammo" not in contexts:
|
||||
contexts.add("ammo")
|
||||
contexts.append("ammo")
|
||||
|
||||
selection.append(mod)
|
||||
|
||||
sel = self.GetNextSelected(sel)
|
||||
|
||||
contexts.add("ship")
|
||||
contexts.append("ship")
|
||||
|
||||
menu = ContextMenu.getMenu(selection, *contexts)
|
||||
self.PopupMenu(menu)
|
||||
|
||||
Reference in New Issue
Block a user