yue / wey

Fast open source Slack desktop app
Other
1.67k stars 80 forks source link

bug: styling of long channel name is broken #90

Open drcicero opened 4 years ago

drcicero commented 4 years ago

Hi, I just tried wey! The first thing I noticed is that I have some channels names are just a bit longer than a single line and also some direct channels with 5 people, where not all names fit in a single line. So some of the text is cut off. That would be not much of a problem, if for example only the first line at the beginning of the channel name would be visible, however what happens is that the name gets split into two lines, but the height of the channel div/box remains constant (e.g. appropiate for a single line), and the text is vertically center in that div/box...

This means you only get to see the lower half of the first line and the upper half of the second line of a long channel name, and that looks broken.

If its related to the native GUI and not the HTML part, it might be relevant that I am using Linux.

EDIT: Looking at the code it seems the channel list is consists of channel titles, which in turn are instances of gui.Containers (https://github.com/yue/wey/blob/master/lib/view/channel-title.js#L14). I think the method measuretext from yue (https://libyue.com/docs/latest/js/api/painter.html#measuretext-text-width-attributes) could be relevant to solve this problem. Another solution could be to use a Label instead of a Container (https://libyue.com/docs/latest/js/api/label.html). But I have no clue about wey or yue so thats just guessing based on using other GUI frameworks. :)