NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

megaMenuEntries.py (1858B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\podGuide\megaMenuEntries.py
      2 import carbonui.const as uiconst
      3 from carbonui.primitives.container import Container
      4 from carbonui.primitives.fill import Fill
      5 from eve.client.script.ui.control.eveLabel import EveLabelLarge, EveLabelSmall
      6 
      7 class MegaMenuHeader(Container):
      8     default_align = uiconst.TOPLEFT
      9     default_height = 30
     10     sidePadding = 30
     11 
     12     def ApplyAttributes(self, attributes):
     13         Container.ApplyAttributes(self, attributes)
     14         headerInfoDict = attributes.headerInfo
     15         text = headerInfoDict['groupName']
     16         textLabel = EveLabelLarge(parent=self, text=text, align=uiconst.CENTER)
     17         self.width = textLabel.textwidth + self.sidePadding
     18 
     19 
     20 class MegaMenuEntry(Container):
     21     default_align = uiconst.TOPLEFT
     22     default_state = uiconst.UI_NORMAL
     23     default_height = 24
     24     sidePadding = 30
     25 
     26     def ApplyAttributes(self, attributes):
     27         Container.ApplyAttributes(self, attributes)
     28         self.hiliteFill = Fill(bgParent=self, opacity=0.0)
     29         entryInfo = attributes.entryInfo
     30         self.callback = entryInfo['callback']
     31         self.callbackArgs = entryInfo['args']
     32         entryInfoDict = attributes.entryInfo
     33         text = entryInfoDict['text']
     34         self.textLabel = EveLabelSmall(parent=self, text=text, align=uiconst.CENTER)
     35         self.width = self.textLabel.textwidth + self.sidePadding
     36         self.height = max(self.default_height, self.textLabel.textheight + 4)
     37 
     38     def OnMouseEnter(self, *args):
     39         self.hiliteFill.opacity = 0.2
     40         self.textLabel.SetRGBA(1, 0, 0, 1)
     41 
     42     def OnMouseExit(self, *args):
     43         self.hiliteFill.opacity = 0.0
     44         self.textLabel.SetRGBA(1, 1, 1, 1)
     45 
     46     def OnClick(self, *args):
     47         if self.callback:
     48             self.callback(self.callbackArgs)