-
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix header text wrapping in sidebar #46
Conversation
Ah I see. Packing emojis as separate widgets in a horizontal Box doesn't seem like a good idea - this approach doesn't work with word wrapping at all. I think I had some research on drawing custom images directly on Gtk.Label widgets using |
Sure! Other alternatives I've considered are:
|
IMHO the former should be used in a pinch as it is not intended to be used in such quantities (GtkTextView makes more sense as a singular widget in the Composer dialog due to its rich editing capabilities). As for the latter, webviews defeats the idea of using a native client. Besides, I can already tell that spawning a webview instance every time rich markup is expected (which is usually always and everywhere) will skyrocket the RAM usage, which is already abnormal. Might as well just use a browser 😄 Animated emojis is a valid point though. I'll see what we can do about them. |
I see, thanks for the info! For what it's worth, Fractal uses a custom label widget with children: https://gitlab.gnome.org/GNOME/fractal/-/blob/main/src/components/label_with_widgets.rs |
I absolutely love the idea of using a separate widget for each embedded image. Fractal uses Pango's shape attribute - exactly what I had in mind. It seems to use these attributes to render custom glyphs in the Label's markup, get their pixel positions and use them for the embedded widgets. I think. Maybe. I wish I had more experience in Rust, it's mostly Greek to me :/ |
Sometimes the text in sidebar header is wrapped even if there is room for the text. This PR expands the text box and adds a slight vertical padding to make the layout a bit more neat.