equal
deleted
inserted
replaced
255 |
255 |
256 def SimplifyTabLayout(tabs, rect): |
256 def SimplifyTabLayout(tabs, rect): |
257 for tab in tabs: |
257 for tab in tabs: |
258 if tab["pos"][0] == rect.x: |
258 if tab["pos"][0] == rect.x: |
259 others = [t for t in tabs if t != tab] |
259 others = [t for t in tabs if t != tab] |
260 others.sort(lambda x,y: cmp(x["pos"][0], y["pos"][0])) |
260 others.sort(lambda x, y: cmp(x["pos"][0], y["pos"][0])) |
261 for other in others: |
261 for other in others: |
262 if (other["pos"][1] == tab["pos"][1] and |
262 if (other["pos"][1] == tab["pos"][1] and |
263 other["size"][1] == tab["size"][1] and |
263 other["size"][1] == tab["size"][1] and |
264 other["pos"][0] == tab["pos"][0] + tab["size"][0] + TAB_BORDER): |
264 other["pos"][0] == tab["pos"][0] + tab["size"][0] + TAB_BORDER): |
265 |
265 |
270 if tab["size"][0] == rect.width: |
270 if tab["size"][0] == rect.width: |
271 return True |
271 return True |
272 |
272 |
273 elif tab["pos"][1] == rect.y: |
273 elif tab["pos"][1] == rect.y: |
274 others = [t for t in tabs if t != tab] |
274 others = [t for t in tabs if t != tab] |
275 others.sort(lambda x,y: cmp(x["pos"][1], y["pos"][1])) |
275 others.sort(lambda x, y: cmp(x["pos"][1], y["pos"][1])) |
276 for other in others: |
276 for other in others: |
277 if (other["pos"][0] == tab["pos"][0] and |
277 if (other["pos"][0] == tab["pos"][0] and |
278 other["size"][0] == tab["size"][0] and |
278 other["size"][0] == tab["size"][0] and |
279 other["pos"][1] == tab["pos"][1] + tab["size"][1] + TAB_BORDER): |
279 other["pos"][1] == tab["pos"][1] + tab["size"][1] + TAB_BORDER): |
280 |
280 |
1463 if tabctrl.TabHitTest(pos.x, pos.y, None): |
1463 if tabctrl.TabHitTest(pos.x, pos.y, None): |
1464 self.SwitchFullScrMode(event) |
1464 self.SwitchFullScrMode(event) |
1465 event.Skip() |
1465 event.Skip() |
1466 return OnTabsOpenedDClick |
1466 return OnTabsOpenedDClick |
1467 |
1467 |
1468 def SwitchFullScrMode(self,evt): |
1468 def SwitchFullScrMode(self, evt): |
1469 pane = self.AUIManager.GetPane(self.TabsOpened) |
1469 pane = self.AUIManager.GetPane(self.TabsOpened) |
1470 if pane.IsMaximized(): |
1470 if pane.IsMaximized(): |
1471 self.AUIManager.RestorePane(pane) |
1471 self.AUIManager.RestorePane(pane) |
1472 else: |
1472 else: |
1473 self.AUIManager.MaximizePane(pane) |
1473 self.AUIManager.MaximizePane(pane) |