Skip to content
  • Luca Bacci's avatar
    Set the xalign property for Gtk::Labels (!40) · 12f08d38
    Luca Bacci authored and Mike Fleetwood's avatar Mike Fleetwood committed
    With the same case as from the previous commit, the very long "Mounted
    on ..." text is now wrapped, but the text may not be left justified.
    Slowly adjust the dialog width and see how the text wrapping is updated
    to fit the size adjustment but the text is centred rather than left
    justified.
    
    This is because setting the halign property to Gtk::ALIGN_START does not
    guarantee left alignment of text for wrapped or ellipsized Gtk::Labels.
    
    Use the xalign property instead.
    
    To set the xalign property there is a method in the GtkMisc (Gtk::Misc)
    base class:
    
      gtk_misc_set_alignment (Gtk::Misc::set_alignment)
    
    However, GtkMisc (Gtk::Misc) was deprecated in Gtk 3.14 (Gtkmm 3.14)
    and in Gtk 3.16 (gtkmm 3.16) set_alignment() was replaced with the
    introduction of two new methods:
    
      gtk_label_set_xalign (Gtk::Label::set_xalign)
      gtk_label_set_yalign (Gtk::Label::set_yalign)
    
    Add a check for Gtkmm method Gtk::Label::set_xalign() in configure.ac
    and use it when available.
    ...
    12f08d38