def show_notes(self, text=''): text = (text or '').strip() self.setVisible(bool(text)) self.current_notes = text html = '\n'.join(render_notes(text)) self.setHtml('<div><a href="edit://moo" style="text-decoration: none">{}</a></div>{}'.format(_('Edit notes'), html)) h = self.document().size().height() + 2 self.setMaximumHeight(h)
def show_notes(self, text=''): text = (text or '').strip() self.setVisible(bool(text)) self.current_notes = text self.browser.setHtml('\n'.join(render_notes(text))) h = self.browser.document().size().height() + 8 self.browser.setMaximumHeight(h) self.setMaximumHeight(max(self.edit_button.sizeHint().height() + 4, h))