Skip to content

Limit wrapping Gtk::Labels

In Gtk2 wrapping labels wrap automatically after a certain width, even if max-width-chars property is not set [1]. For Gtk3 this does not happen, instead the application should explicitly set max-width-chars property [2].

Dialog_Partition_info on Gtk 2:
Schermata_da_2019-05-02_14-05-13

Dialog_Partition_info on Gtk 3 w/out patch:
Schermata_da_2019-05-02_14-07-58

Dialog_Partition_info on Gtk 3 with patch:
Schermata_da_2019-05-02_14-08-42

  1. Gtk2 https://gitlab.gnome.org/GNOME/gtk/blob/2.24.32/gtk/gtklabel.c#L2974
    "This long string gives a good enough length for any line to have."

  2. Gtk3 gtk@c8ce1106
    "People should use window default sizes or label
    width-chars/max-width-chars to find the ideal layout for a label instead
    of relying on magic."

Edited by Luca Bacci

Merge request reports