baseWalletTab.py (3790B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\neocom\wallet\tabs\baseWalletTab.py 2 import trinity 3 from carbonui import uiconst 4 from carbonui.primitives.container import Container 5 from carbonui.primitives.fill import Fill 6 from carbonui.primitives.line import Line 7 from carbonui.primitives.sprite import Sprite 8 from carbonui.util.color import Color 9 from eve.client.script.ui.control.eveLabel import EveHeaderMediumBold, Label 10 from eve.client.script.ui.control.infoIcon import MoreInfoIcon 11 from carbonui.control.tab import Tab 12 from eve.client.script.ui.shared.neocom.wallet.walletTabUnderlay import WalletTabUnderlay 13 from localization import GetByLabel 14 ICON_CONTAINER_SIZE = 64 15 ICON_SIZE = 56 16 INFO_ICON_SIZE = 16 17 DEFAULT_PAD = 6 18 19 class BaseWalletTab(Tab): 20 default_texturePath = None 21 tabNamePath = None 22 default_state = uiconst.UI_NORMAL 23 default_align = uiconst.TOLEFT_PROP 24 default_width = 0.33333 25 default_underlayColor = Color.GRAY 26 labelColor = Color.WHITE 27 iconSize = ICON_SIZE 28 iconContainerSize = ICON_CONTAINER_SIZE 29 amountFontSize = 17 30 31 def ConstructLayout(self): 32 self.tabName = GetByLabel(self.tabNamePath) if self.tabNamePath else '' 33 self.ConstructMainContainer() 34 self.ConstructIcon() 35 self.ConstructDataContainer() 36 self.PopulateBottomContainer() 37 super(BaseWalletTab, self).ConstructLayout() 38 39 def ConstructDataContainer(self): 40 self.ConstructTopContainer() 41 self.ConstructDividerLine() 42 self.ConstructBottomContainer() 43 44 def ConstructDividerLine(self): 45 Line(name='dividerLine', parent=self.mainContainer, height=1, padLeft=DEFAULT_PAD, padRight=DEFAULT_PAD) 46 47 def _ConstructUnderlay(self): 48 self.selectedBG = WalletTabUnderlay(name='underlay', parent=self, fillColor=self.default_underlayColor) 49 50 def ConstructIcon(self): 51 iconContainer = Container(name='iconContainer', parent=self.mainContainer, align=uiconst.TOLEFT, width=self.iconContainerSize, idx=0) 52 self.icon = Sprite(name='icon', parent=iconContainer, align=uiconst.CENTER, texturePath=self.default_texturePath, width=self.iconSize, height=self.iconSize, state=uiconst.UI_DISABLED) 53 Fill(name='iconBackground', bgParent=iconContainer, color=Color.BLACK, opacity=0.25, padding=4) 54 55 def ConstructMainContainer(self): 56 self.mainContainer = Container(name='mainContainer', parent=self) 57 58 def ConstructTopContainer(self): 59 self.topContainer = Container(name='topContainer', parent=self.mainContainer, align=uiconst.TOTOP, height=32) 60 self.ConstructTabNameLabel() 61 self.ConstructInfoIcon(self.topContainer) 62 63 def ConstructInfoIcon(self, container): 64 self.infoIcon = MoreInfoIcon(name='infoIcon', parent=container, align=uiconst.CENTERRIGHT, width=INFO_ICON_SIZE, height=INFO_ICON_SIZE, left=DEFAULT_PAD, hint=self.default_hint) 65 66 def ConstructTabNameLabel(self): 67 self.tabNameLabel = EveHeaderMediumBold(name='tabNameLabel', parent=self.topContainer, align=uiconst.CENTERLEFT, left=DEFAULT_PAD, text=self.tabName) 68 69 def ConstructBottomContainer(self): 70 self.bottomContainer = Container(name='bottomContainer', parent=self.mainContainer) 71 self.bottomLabel = Label(parent=self.bottomContainer, name='bottomLabel', state=uiconst.UI_DISABLED, align=uiconst.CENTERLEFT, left=6, blendMode=trinity.TR2_SBM_NONE, color=self.labelColor, fontsize=self.amountFontSize) 72 73 def PopulateBottomContainer(self): 74 pass 75 76 def UpdateTabSize(self): 77 pass 78 79 def GetHeight(self): 80 return 0 81 82 def SetIcon(self, iconNo, shiftLabel = 14, hint = None, menufunc = None): 83 pass 84 85 def SetLabel(self, label, hint = None): 86 pass