diff options
author | Aylur <[email protected]> | 2024-09-01 02:06:50 +0200 |
---|---|---|
committer | Aylur <[email protected]> | 2024-09-01 02:06:50 +0200 |
commit | 0738194780ce52b9047c430b9498487417b2cd07 (patch) | |
tree | e0cdbcbc31ccbe1620a5f228f18fead658487652 /core/src/widget/label.vala | |
parent | 49cdf5d5e010c9abb9b02034999eef2f49f066b9 (diff) |
move libastal to /core
starting point of the monorepo
Diffstat (limited to 'core/src/widget/label.vala')
-rw-r--r-- | core/src/widget/label.vala | 18 |
1 files changed, 18 insertions, 0 deletions
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")); + } +} |