adwaita-swift/Sources/Adwaita/View/ProgressBar+.swift
david-swift d8de611510 Add support for auto-generated widget bindings
Additionally fix an update problem occurring with custom views
2024-01-22 21:45:31 +01:00

24 lines
458 B
Swift

//
// Progressbar+.swift
// Adwaita
//
// Created by david-swift on 15.01.24.
//
extension ProgressBar {
/// Initialize a progress bar widget.
/// - Parameters:
/// - value: The value.
/// - total: The maximum value.
public init(value: Double, total: Double) {
self.init()
if total != 0 {
self = self.fraction(value / total)
} else {
self = self.fraction(0)
}
}
}