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

Commit

Permalink
Set whether a label is ellipsized
Browse files Browse the repository at this point in the history
  • Loading branch information
david-swift committed Mar 17, 2024
1 parent 8792437 commit 7f0eb26
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Sources/Adwaita/View/Text.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by david-swift on 23.08.23.
//

import CAdw

/// A text widget.
public typealias Text = Label

Expand All @@ -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) }
}

}

0 comments on commit 7f0eb26

Please sign in to comment.