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

tooltipUtil.py (1763B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\tooltips\tooltipUtil.py
      2 from eve.client.script.ui.control.pointerPanel import FadeOutPanelAndClose
      3 from eve.client.script.ui.tooltips.tooltipsWrappers import TooltipHeaderDescriptionWrapper, TooltipDescriptionWrapper
      4 from carbonui.uicore import uicore
      5 
      6 def RefreshTooltipForOwner(owner):
      7     if not uicore.uilib.tooltipHandler:
      8         return
      9     tooltipHandler = uicore.uilib.tooltipHandler
     10     doUpdate = uicore.uilib.mouseOver is owner
     11     if tooltipHandler.tooltipPanel and not (tooltipHandler.tooltipPanel.destroyed or tooltipHandler.tooltipPanel.beingDestroyed):
     12         if tooltipHandler.tooltipPanel.owner is owner and not tooltipHandler.tooltipPanel.owner.destroyed:
     13             FadeOutPanelAndClose(tooltipHandler.tooltipPanel, duration=0.1)
     14             tooltipHandler.tooltipPanel = None
     15             doUpdate = True
     16     if tooltipHandler.tooltipHint and not (tooltipHandler.tooltipHint.destroyed or tooltipHandler.tooltipHint.beingDestroyed):
     17         if tooltipHandler.tooltipHint.owner is owner and not tooltipHandler.tooltipHint.owner.destroyed:
     18             FadeOutPanelAndClose(tooltipHandler.tooltipHint, duration=0.1)
     19             tooltipHandler.tooltipHint = None
     20             doUpdate = True
     21     if doUpdate:
     22         tooltipHandler.lastMouseOver = None
     23         tooltipHandler.UpdateTooltip()
     24 
     25 
     26 def SetTooltipHeaderAndDescription(targetObject, headerText, descriptionText):
     27     targetObject.tooltipPanelClassInfo = TooltipHeaderDescriptionWrapper(header=headerText, description=descriptionText)
     28 
     29 
     30 def SetTooltipDescription(targetObject, descriptionText):
     31     targetObject.tooltipPanelClassInfo = TooltipDescriptionWrapper(description=descriptionText)