diff --git a/gui/shipBrowser.py b/gui/shipBrowser.py index 4a681cd73..4d27f20de 100644 --- a/gui/shipBrowser.py +++ b/gui/shipBrowser.py @@ -1106,24 +1106,6 @@ class PFBitmapFrame(wx.Frame): mdc.DrawRectangle( 0,0,rect.width,rect.height) -def GetRoundBitmap( w, h, r ): - maskColor = wx.Color(0,0,0) - shownColor = wx.Color(5,5,5) - b = wx.EmptyBitmap(w,h) - dc = wx.MemoryDC(b) - dc.SetBrush(wx.Brush(maskColor)) - dc.DrawRectangle(0,0,w,h) - dc.SetBrush(wx.Brush(shownColor)) - dc.SetPen(wx.Pen(shownColor)) - dc.DrawRoundedRectangle(0,0,w,h,r) - dc.SelectObject(wx.NullBitmap) - b.SetMaskColour(maskColor) - return b - -def GetRoundShape( w, h, r ): - return wx.RegionFromBitmap( GetRoundBitmap(w,h,r) ) - - class FitItem(SFItem.SFBrowserItem): def __init__(self, parent, fitID=None, shipFittingInfo=("Test", "cnc's avatar", 0 ), shipID = None, itemData=None, id=wx.ID_ANY, pos=wx.DefaultPosition, diff --git a/gui/utils/drawUtils.py b/gui/utils/drawUtils.py index 67eeff80f..752bd4c62 100644 --- a/gui/utils/drawUtils.py +++ b/gui/utils/drawUtils.py @@ -81,3 +81,20 @@ def GetPartialText(dc, text , maxWidth): return drawntext + ellipsis else: return text + +def GetRoundBitmap( w, h, r ): + maskColor = wx.Color(0,0,0) + shownColor = wx.Color(5,5,5) + b = wx.EmptyBitmap(w,h) + dc = wx.MemoryDC(b) + dc.SetBrush(wx.Brush(maskColor)) + dc.DrawRectangle(0,0,w,h) + dc.SetBrush(wx.Brush(shownColor)) + dc.SetPen(wx.Pen(shownColor)) + dc.DrawRoundedRectangle(0,0,w,h,r) + dc.SelectObject(wx.NullBitmap) + b.SetMaskColour(maskColor) + return b + +def GetRoundShape( w, h, r ): + return wx.RegionFromBitmap( GetRoundBitmap(w,h,r) )