MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / OnLeftDown

Method OnLeftDown

gui/chrome_tabs.py:802–817  ·  view source on GitHub ↗

Select tab on mouse down and start dragging logic

(self, event)

Source from the content-addressed store, hash-verified

800 self.AdjustTabsSize()
801
802 def OnLeftDown(self, event):
803 """ Select tab on mouse down and start dragging logic """
804 mposx, mposy = event.GetPosition()
805 if not self.start_drag:
806 tab = self.FindTabAtPos(mposx, mposy)
807 if tab:
808 self.CheckTabSelected(tab, mposx, mposy)
809 if self.show_add_button:
810 # If we can add tabs, we can drag them. Set flag
811 self.start_drag = True
812 tx, ty = tab.GetPosition()
813 self.dragx = mposx - tx
814 self.dragy = self.container_height - self.height
815 self.Refresh()
816
817 self.dragged_tab = tab
818
819 def OnMiddleUp(self, event):
820 mposx, mposy = event.GetPosition()

Callers

nothing calls this directly

Calls 4

FindTabAtPosMethod · 0.95
CheckTabSelectedMethod · 0.95
GetPositionMethod · 0.45
RefreshMethod · 0.45

Tested by

no test coverage detected