diff --git a/Sources/Adwaita/View/Text.swift b/Sources/Adwaita/View/Text.swift index f723212..fa943ab 100644 --- a/Sources/Adwaita/View/Text.swift +++ b/Sources/Adwaita/View/Text.swift @@ -5,6 +5,8 @@ // Created by david-swift on 23.08.23. // +import CAdw + /// A text widget. public typealias Text = Label @@ -16,4 +18,11 @@ extension Text { self.init(label: text) } + /// Set whether the text should ellipsize at the end. + /// - Parameter ellipsize: Whether it should ellipsize. + /// - Returns: The text widget. + public func ellipsize(_ ellipsize: Bool) -> View { + inspect { gtk_label_set_ellipsize($0.pointer, PANGO_ELLIPSIZE_END) } + } + }