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

Method UpdateTabsPosition

gui/chrome_tabs.py:1373–1394  ·  view source on GitHub ↗
(self, skip_tab=None)

Source from the content-addressed store, hash-verified

1371 self.UpdateTabsPosition()
1372
1373 def UpdateTabsPosition(self, skip_tab=None):
1374 tabsWidth = 0
1375 for tab in self.tabs:
1376 tabsWidth += tab.tab_width - self.inclination * 2
1377
1378 pos = tabsWidth
1379 selected = None
1380 for i in range(len(self.tabs) - 1, -1, -1):
1381 tab = self.tabs[i]
1382 width = tab.tab_width - self.inclination * 2
1383 pos -= width
1384 if not tab.IsSelected():
1385 tab.SetPosition((pos, self.container_height - self.height))
1386 else:
1387 selected = tab
1388 selpos = pos
1389
1390 if selected is not skip_tab:
1391 selected.SetPosition((selpos, self.container_height - self.height))
1392
1393 self.add_button.SetPosition((round(tabsWidth) + self.inclination * 2,
1394 self.container_height - self.height / 2 - self.add_button.GetHeight() / 3))
1395
1396 def OnLeaveWindow(self, event):
1397 if self.start_drag and not self.dragging:

Callers 4

OnMotionMethod · 0.95
OnLeftUpMethod · 0.95
SwitchTabsMethod · 0.95
AdjustTabsSizeMethod · 0.95

Calls 3

IsSelectedMethod · 0.80
SetPositionMethod · 0.45
GetHeightMethod · 0.45

Tested by

no test coverage detected