Shrinking the font allows more information to display. Committer testing: Works, tested with the convenient Control+Shift+'+' and Control+'-' as well with the more cumbersome top menu "Edit" + "Enlarge/Shrink font" options.
Showing the changes to tools/perf/scripts/python (1 of 1 file). Show all
Unified · Split
| @@ -706,6 +706,20 @@ class WindowMenu(): · 705 unmodified lines | ||
| 706 | 706 | def setActiveSubWindow(self, nr): |
| 707 | 707 | self.mdi_area.setActiveSubWindow(self.mdi_area.subWindowList()[nr - 1]) |
| 708 | 708 | |
| 709 | +# Font resize | |
| 710 | + | |
| 711 | +def ResizeFont(widget, diff): | |
| 712 | + font = widget.font() | |
| 713 | + sz = font.pointSize() | |
| 714 | + font.setPointSize(sz + diff) | |
| 715 | + widget.setFont(font) | |
| 716 | + | |
| 717 | +def ShrinkFont(widget): | |
| 718 | + ResizeFont(widget, -1) | |
| 719 | + | |
| 720 | +def EnlargeFont(widget): | |
| 721 | + ResizeFont(widget, 1) | |
| 722 | + | |
| 709 | 723 | # Unique name for sub-windows |
| 710 | 724 | |
| 711 | 725 | def NumberedWindowName(name, nr): |
| @@ -765,6 +779,8 @@ class MainWindow(QMainWindow): · 53 unmodified lines | ||
| 765 | 779 | |
| 766 | 780 | edit_menu = menu.addMenu("&Edit") |
| 767 | 781 | edit_menu.addAction(CreateAction("&Find...", "Find items", self.Find, self, QKeySequence.Find)) |
| 782 | + edit_menu.addAction(CreateAction("&Shrink Font", "Make text smaller", self.ShrinkFont, self, [QKeySequence("Ctrl+-")])) | |
| 783 | + edit_menu.addAction(CreateAction("&Enlarge Font", "Make text bigger", self.EnlargeFont, self, [QKeySequence("Ctrl++")])) | |
| 768 | 784 | |
| 769 | 785 | reports_menu = menu.addMenu("&Reports") |
| 770 | 786 | reports_menu.addAction(CreateAction("Context-Sensitive Call &Graph", "Create a new window containing a context-sensitive call graph", self.NewCallGraph, self)) |
| @@ -779,6 +795,14 @@ class MainWindow(QMainWindow): · 8 unmodified lines | ||
| 779 | 795 | except: |
| 780 | 796 | pass |
| 781 | 797 | |
| 798 | + def ShrinkFont(self): | |
| 799 | + win = self.mdi_area.activeSubWindow() | |
| 800 | + ShrinkFont(win.view) | |
| 801 | + | |
| 802 | + def EnlargeFont(self): | |
| 803 | + win = self.mdi_area.activeSubWindow() | |
| 804 | + EnlargeFont(win.view) | |
| 805 | + | |
| 782 | 806 | def NewCallGraph(self): |
| 783 | 807 | CallGraphWindow(self.glb, self) |
| 784 | 808 | |