Skip to content
This repository was archived by the owner on Oct 17, 2024. It is now read-only.

Commit 7f0eb26

Browse files
committed
Set whether a label is ellipsized
1 parent 8792437 commit 7f0eb26

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Sources/Adwaita/View/Text.swift

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Created by david-swift on 23.08.23.
66
//
77

8+
import CAdw
9+
810
/// A text widget.
911
public typealias Text = Label
1012

@@ -16,4 +18,11 @@ extension Text {
1618
self.init(label: text)
1719
}
1820

21+
/// Set whether the text should ellipsize at the end.
22+
/// - Parameter ellipsize: Whether it should ellipsize.
23+
/// - Returns: The text widget.
24+
public func ellipsize(_ ellipsize: Bool) -> View {
25+
inspect { gtk_label_set_ellipsize($0.pointer, PANGO_ELLIPSIZE_END) }
26+
}
27+
1928
}

0 commit comments

Comments
 (0)