From 0738194780ce52b9047c430b9498487417b2cd07 Mon Sep 17 00:00:00 2001 From: Aylur Date: Sun, 1 Sep 2024 02:06:50 +0200 Subject: move libastal to /core starting point of the monorepo --- core/src/widget/label.vala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 core/src/widget/label.vala (limited to 'core/src/widget/label.vala') diff --git a/core/src/widget/label.vala b/core/src/widget/label.vala new file mode 100644 index 0000000..4063b6f --- /dev/null +++ b/core/src/widget/label.vala @@ -0,0 +1,18 @@ +using Pango; + +public class Astal.Label : Gtk.Label { + public bool truncate { + set { ellipsize = value ? EllipsizeMode.END : EllipsizeMode.NONE; } + get { return ellipsize == EllipsizeMode.END; } + } + + public new bool justify_fill { + set { justify = value ? Gtk.Justification.FILL : Gtk.Justification.LEFT; } + get { return justify == Gtk.Justification.FILL; } + } + + construct { + notify["ellipsize"].connect(() => notify_property("truncate")); + notify["justify"].connect(() => notify_property("justify_fill")); + } +} -- cgit v1.2.3