gtk-rs / gtk

DEPRECATED, use https://github.com/gtk-rs/gtk3-rs repository instead!
https://gtk-rs.org/
MIT License
1.24k stars 82 forks source link

LabelBuilder::wrap_mode could use gtk::WrapMode, not pango::WrapMode #1037

Closed Dieff closed 4 years ago

Dieff commented 4 years ago

The wrap_mode method on LabelBuilder takes apango::wrap_mode struct as an argument. However, the gtk library also exports an enum called WrapMode which appears to be almost the same (just with the addition of a None variant). Every place within gtk functions that I can find uses the pango version of WrapMode.

It seems to me that the gtk::WrapMode is redundant, and maybe if it were changed than all of functions which use pango::WrapMode could use gtk::WrapMode instead. This would simplify the use of the library, because it wouldn't be necessary to import pango just to set the wrapping mode of gtk widgets.

bilelmoussaoui commented 4 years ago

Except the wrapping is handled by pango. The gtk::WrapMode is only used in GtkTextView I guess. Anyway, there's nothing that can be done here. Adding a Into<gtk::WrapMode> for pango::WrapMode doesn't make sense.