MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / TabHitTest

Method TabHitTest

gui/chrome_tabs.py:1091–1101  ·  view source on GitHub ↗

Test if x and y are contained within a tabs region

(self, tab, x, y)

Source from the content-addressed store, hash-verified

1089 return None
1090
1091 def TabHitTest(self, tab, x, y):
1092 """ Test if x and y are contained within a tabs region """
1093 tabRegion = tab.GetTabRegion()
1094 tabPos = tab.GetPosition()
1095 tabPosX, tabPosY = tabPos
1096 tabRegion.Offset(round(tabPosX), round(tabPosY))
1097
1098 if tabRegion.Contains(x, y):
1099 return True
1100
1101 return False
1102
1103 def GetTabAtLeft(self, tab_index):
1104 return self.tabs[tab_index - 1] if tab_index > 0 else None

Callers 3

CheckTabSelectedMethod · 0.95
FindTabAtPosMethod · 0.95
CheckTabPreviewMethod · 0.95

Calls 2

GetTabRegionMethod · 0.80
GetPositionMethod · 0.45

Tested by

no test coverage detected