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

Method CheckCloseHighlighted

gui/chrome_tabs.py:1051–1073  ·  view source on GitHub ↗

Checks if mouse pos at x, y is over a close button. If so, set the close hovering flag for that tab

(self, x, y)

Source from the content-addressed store, hash-verified

1049 return True
1050
1051 def CheckCloseHighlighted(self, x, y):
1052 """
1053 Checks if mouse pos at x, y is over a close button. If so, set the
1054 close hovering flag for that tab
1055 """
1056 dirty = False
1057
1058 for tab in self.tabs:
1059 region = tab.GetCloseButtonRegion()
1060 posx, posy = tab.GetPosition()
1061 region.Offset(round(posx), round(posy))
1062
1063 if region.Contains(x, y):
1064 if not tab.GetCloseButtonHoverStatus():
1065 tab.ShowCloseButtonHovering(True)
1066 dirty = True
1067 else:
1068 if tab.GetCloseButtonHoverStatus():
1069 tab.ShowCloseButtonHovering(False)
1070 dirty = True
1071 if dirty:
1072 self.Refresh()
1073 break
1074
1075 def FindTabAtPos(self, x, y):
1076 if self.GetTabsCount() == 0:

Callers 1

OnMotionMethod · 0.95

Calls 5

GetCloseButtonRegionMethod · 0.80
GetPositionMethod · 0.45
RefreshMethod · 0.45

Tested by

no test coverage detected