tooltip: Don't play games with max-width-chars
Setting max-width-chars to the number of characters in the string works ok only as long as the average char width we get from Pango matches reality. Sadly that seems not always the case, and this code was causing short Chinese tooltips to always be broken into two lines. Fixes: #4470
This commit is contained in:
@@ -413,11 +413,7 @@ update_label_width (GtkLabel *label)
|
||||
}
|
||||
else
|
||||
{
|
||||
int len;
|
||||
|
||||
len = g_utf8_strlen (text, -1);
|
||||
|
||||
gtk_label_set_max_width_chars (label, MIN (len, 50));
|
||||
gtk_label_set_max_width_chars (label, 50);
|
||||
gtk_label_set_wrap (label, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user