mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 13:52:15 +01:00
fixed raw json height sizes
This commit is contained in:
parent
6d31920609
commit
422930ea87
1 changed files with 15 additions and 0 deletions
|
|
@ -716,6 +716,21 @@ class RawJsonInput(QtWidgets.QPlainTextEdit):
|
|||
|
||||
self.is_valid = None
|
||||
|
||||
def sizeHint(self):
|
||||
document = self.document()
|
||||
layout = document.documentLayout()
|
||||
|
||||
height = document.documentMargin() + 2 * self.frameWidth() + 1
|
||||
block = document.begin()
|
||||
while block != document.end():
|
||||
height += layout.blockBoundingRect(block).height()
|
||||
block = block.next()
|
||||
|
||||
value = super().sizeHint()
|
||||
value.setHeight(height)
|
||||
|
||||
return value
|
||||
|
||||
def set_value(self, value, *, default_value=False):
|
||||
if not isinstance(value, str):
|
||||
value = json.dumps(value, indent=4)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue