mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Merge pull request #1211 from ynput/bugfix/ceil-height
Utils widgets: Ceil height of 'ExpandingTextEdit'
This commit is contained in:
commit
9344ac84b0
1 changed files with 5 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import logging
|
||||
import math
|
||||
from typing import Optional, List, Set, Any
|
||||
|
||||
from qtpy import QtWidgets, QtCore, QtGui
|
||||
|
|
@ -410,10 +411,12 @@ class ExpandingTextEdit(QtWidgets.QTextEdit):
|
|||
document = self.document().clone()
|
||||
document.setTextWidth(document_width)
|
||||
|
||||
return margins.top() + document.size().height() + margins.bottom()
|
||||
return math.ceil(
|
||||
margins.top() + document.size().height() + margins.bottom()
|
||||
)
|
||||
|
||||
def sizeHint(self):
|
||||
width = super(ExpandingTextEdit, self).sizeHint().width()
|
||||
width = super().sizeHint().width()
|
||||
return QtCore.QSize(width, self.heightForWidth(width))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue