GtkLabel 'lines' property does not truncate lines if label contains embedded newlines
@smspillaz
Submitted by Sam Spilsbury Link to original bug (#776645)
Description
I'm not sure if this is a bug or intentional behaviour.
When using the 'lines' property, I expect the label to display at most N lines, even if my label has embedded linefeed characters and wouldn't wrap otherwise. Instead, adding embedded \n characters causes additional lines > N to display.
Testcase (gjs):
const Gtk = imports.gi.Gtk;
Gtk.init(null);
let mainWindow = new Gtk.Window();
mainWindow.add(new Gtk.Label({
visible: true,
lines: 1,
label: 'Foo\nBar'
}));
mainWindow.show();
Gtk.main();
Version: 3.20.x