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

Method OnLeftUp

gui/chrome_tabs.py:903–941  ·  view source on GitHub ↗

Determines what happens when user left clicks (up)

(self, event)

Source from the content-addressed store, hash-verified

901 event.Skip()
902
903 def OnLeftUp(self, event):
904 """Determines what happens when user left clicks (up)"""
905 mposx, mposy = event.GetPosition()
906 if self.start_drag and self.dragging:
907 self.dragging = False
908 self.start_drag = False
909 self.dragged_tab = None
910 self.drag_trigger = self.drag_trail
911 self.UpdateTabsPosition()
912 self.Refresh()
913
914 if self.HasCapture():
915 self.ReleaseMouse()
916
917 return
918
919 if self.start_drag:
920 self.start_drag = False
921 self.drag_trigger = self.drag_trail
922
923 # Checks if we selected the add button and, if True, returns
924 if self.CheckAddButton(mposx, mposy):
925 return
926
927 # If there are no tabs, don't waste time
928 if self.GetTabsCount() == 0:
929 return
930
931 # Gets selected tab (was set when user down clicked)
932 sel_tab = self.GetSelectedTab()
933
934 # Check if we selected close button for selected tab
935 if self.CheckTabClose(sel_tab, mposx, mposy):
936 return
937
938 # Check if we selected close button for all others
939 for tab in self.tabs:
940 if self.CheckTabClose(tab, mposx, mposy):
941 return
942
943 def DisableTab(self, tab, disabled=True):
944 tb_renderer = self.tabs[tab]

Callers

nothing calls this directly

Calls 7

UpdateTabsPositionMethod · 0.95
CheckAddButtonMethod · 0.95
GetTabsCountMethod · 0.95
GetSelectedTabMethod · 0.95
CheckTabCloseMethod · 0.95
GetPositionMethod · 0.45
RefreshMethod · 0.45

Tested by

no test coverage detected