diff options
| author | Rusty Wagner <rusty@vector35.com> | 2019-04-02 15:30:45 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2019-04-02 15:36:40 -0400 |
| commit | 73a9399f5d1d86c7e291498b7fe836550f2f76ab (patch) | |
| tree | e7c7cfe9a2f27a93ddac41cf600e7bc1fc638a83 /python/examples/triage/byte.py | |
| parent | c17af471c48ea092434917c803f9c88fe91022a6 (diff) | |
Add a C++ version of the triage plugin (no Makefile yet)
Diffstat (limited to 'python/examples/triage/byte.py')
| -rw-r--r-- | python/examples/triage/byte.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/python/examples/triage/byte.py b/python/examples/triage/byte.py index 4caf228f..fe887fb4 100644 --- a/python/examples/triage/byte.py +++ b/python/examples/triage/byte.py @@ -207,8 +207,7 @@ class ByteView(QAbstractScrollArea, View): areaSize = self.viewport().size() self.adjustSize(areaSize.width(), areaSize.height()) - def createRenderContext(self): - render = RenderContext(self) + def getFont(self): userFont = binaryninjaui.getMonospaceFont(self) if sys.platform == "darwin": # Some fonts aren't fixed width across all characters, use a known good one @@ -216,7 +215,11 @@ class ByteView(QAbstractScrollArea, View): font.setKerning(False) else: font = userFont - render.setFont(font) + return font + + def createRenderContext(self): + render = RenderContext(self) + render.setFont(self.getFont()) return render def adjustSize(self, width, height): @@ -314,6 +317,7 @@ class ByteView(QAbstractScrollArea, View): self.lines.insert(0, line) self.topLine += 1 self.topAddr = prevEnd + return True def cacheNextLines(self): lastAddr = self.data.start |
