# HG changeset patch # User Windel Bouwman # Date 1361523792 -3600 # Node ID c101826ffe2b7becd11d59235dfaaab26c558f0b # Parent 59a9a499e518485ff829c453cd1396af93365831 Fixed scrollbar width diff -r 59a9a499e518 -r c101826ffe2b python/hexedit.py --- a/python/hexedit.py Sat Feb 09 16:05:36 2013 +0100 +++ b/python/hexedit.py Fri Feb 22 10:03:12 2013 +0100 @@ -137,13 +137,17 @@ self.xposAscii = self.xposHex + (BYTES_PER_LINE * 3 - 1) * self.charWidth + GAP self.xposEnd = self.xposAscii + self.charWidth * BYTES_PER_LINE + GAP self.setMinimumWidth(self.xposEnd) - sbw = self.scrollArea.verticalScrollBar().width() - self.scrollArea.setMinimumWidth(self.xposEnd + sbw + 5) + if self.isVisible(): + sbw = self.scrollArea.verticalScrollBar().width() + self.scrollArea.setMinimumWidth(self.xposEnd + sbw + 5) r = len(self.Data) % BYTES_PER_LINE r = 1 if r > 0 else 0 self.setMinimumHeight((int(len(self.Data) / BYTES_PER_LINE) + r) * self.charHeight + 4) self.scrollArea.setMinimumHeight(self.charHeight * 8) self.update() + def showEvent(self, e): + self.adjust() + super().showEvent(e) def setData(self, d): self.data = bytearray(d) self.originalData = bytearray(d)