Open KenyonPrater opened 1 week ago
For instance, if I want to toast a pretty-printed dictionary:
toast = Toast() toast.setTitle("User data") my_data = {'id': 42, 'username': 'alice', 'role': 'user'} toast.setText(json.dumps(my_data, indent=2)) toast.show()
Right now, only the first line of the text will be visible in the toast. It seems like the solution would be like this:
def __setup_ui(self): [...] if self.__title == '' or self.__text == '': text_section_spacing = 0 # NEW CODE if self.__multiline: self.__text_label.setWordWrap(True) text_height = self.__text_label.sizeHint().height() text_width = self.__text_label.sizeHint().width() # END OF NEW CODE text_section_height = (self.__text_section_margins.top() + title_height + text_section_spacing + text_height + self.__text_section_margins.bottom()) [...]
This gives:
Alright if I create a PR to this effect?
This looks like a very nice addition, definitely feel free to create a PR for it 👍🏻 We'll have to make sure everything is backwards compatible but I think that shouldn't be a problem with this feature
For instance, if I want to toast a pretty-printed dictionary:
Right now, only the first line of the text will be visible in the toast. It seems like the solution would be like this:
This gives:
Alright if I create a PR to this effect?