This repository has been archived by the owner on Jan 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for GtkOverlay and GtkProgressBar
- Loading branch information
1 parent
fb5005f
commit 0095086
Showing
7 changed files
with
151 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
**CLASS** | ||
|
||
# `Overlay` | ||
|
||
Gtk.Overlay | ||
|
||
## Methods | ||
### `init()` | ||
|
||
Initialize an overlay. | ||
|
||
### `child(_:)` | ||
|
||
Set the child view. | ||
- Parameter widget: The child view. | ||
- Returns: The overlay. | ||
|
||
### `addOverlay(_:)` | ||
|
||
Add an overlay to the view. | ||
- Parameter widget: The new overlay view. | ||
- Returns: The overlay. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
**CLASS** | ||
|
||
# `ProgressBar` | ||
|
||
Gtk.ProgressBar | ||
|
||
## Methods | ||
### `init()` | ||
|
||
Initialize a progress bar. | ||
|
||
### `fraction(_:)` | ||
|
||
Set the child view. | ||
- Parameter widget: The child view. | ||
- Returns: The overlay. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// Overlay.swift | ||
// Libadwaita | ||
// | ||
// Created by david-swift on 02.01.24. | ||
// | ||
|
||
import CGTUI | ||
|
||
/// Gtk.Overlay | ||
public class Overlay: NativeWidgetPeer { | ||
|
||
/// Initialize an overlay. | ||
override public init() { | ||
super.init() | ||
self.nativePtr = gtui_create_overlay() | ||
} | ||
|
||
/// Set the child view. | ||
/// - Parameter widget: The child view. | ||
/// - Returns: The overlay. | ||
public func child(_ widget: NativeWidgetPeer) -> Overlay { | ||
gtui_overlay_set_child(self.nativePtr, widget.nativePtr) | ||
return self | ||
} | ||
|
||
/// Add an overlay to the view. | ||
/// - Parameter widget: The new overlay view. | ||
/// - Returns: The overlay. | ||
public func addOverlay(_ widget: NativeWidgetPeer) -> Overlay { | ||
gtui_overlay_add_overlay(self.nativePtr, widget.nativePtr) | ||
return self | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// ProgressBar.swift | ||
// Libadwaita | ||
// | ||
// Created by david-swift on 02.01.24. | ||
// | ||
|
||
import CGTUI | ||
|
||
/// Gtk.ProgressBar | ||
public class ProgressBar: NativeWidgetPeer { | ||
|
||
/// Initialize a progress bar. | ||
override public init() { | ||
super.init() | ||
self.nativePtr = gtui_create_progressbar() | ||
} | ||
|
||
/// Set the child view. | ||
/// - Parameter widget: The child view. | ||
/// - Returns: The overlay. | ||
public func fraction(_ fraction: Double) -> ProgressBar { | ||
gtui_progressbar_set_fraction(self.nativePtr, fraction) | ||
return self | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters