Char select dialog: Truncate character description on hover instead of resizing dialog to fit it

This commit is contained in:
Kovid Goyal 2022-02-20 10:42:15 +05:30
parent b57a5d0168
commit 3367c3f022
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -742,7 +742,7 @@ class CharSelect(Dialog):
s.addWidget(self.category_view), s.addWidget(self.char_view)
self.char_info = la = QLabel('\xa0')
la.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
la.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Fixed)
l.addWidget(la, 2, 0, 1, 3)
self.rearrange_msg = la = QLabel(_(
@ -793,11 +793,11 @@ class CharSelect(Dialog):
return QSize(800, 600)
def show_char_info(self, char_code):
text = '\xa0'
if char_code > 0:
category_name, subcategory_name, character_name = self.category_view.model().get_char_info(char_code)
self.char_info.setText(f'{category_name} - {subcategory_name} - {character_name} (U+{char_code:04X})')
else:
self.char_info.clear()
text = _('{character_name} (U+{char_code:04X}) in {category_name} - {subcategory_name}').format(**locals())
self.char_info.setText(text)
def show(self):
self.initialize()