-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fix build optional in ViewBuilder - Fix maximum size frame modifier - Improve inspector wrapper - Improve header bar - Improve status page - Improve the naming of some elements
- Loading branch information
1 parent
22c10d6
commit 921f025
Showing
29 changed files
with
451 additions
and
101 deletions.
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
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 |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
# `WindowScene` | ||
|
||
## Properties | ||
### `body` | ||
### `scene` | ||
|
||
The window scene's body is itself. |
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,25 @@ | ||
**STRUCT** | ||
|
||
# `Clamp` | ||
|
||
A horizontal AdwClamp equivalent. | ||
|
||
## Properties | ||
### `content` | ||
|
||
The content. | ||
|
||
### `maxSize` | ||
|
||
The maximum size. | ||
|
||
## Methods | ||
### `update(_:)` | ||
|
||
Update a view storage. | ||
- Parameter storage: The view storage. | ||
|
||
### `container()` | ||
|
||
Get a view storage. | ||
- Returns: The view storage. |
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
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,5 @@ | ||
**TYPEALIAS** | ||
|
||
# `GTUIWindow` | ||
|
||
A GTUI window. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,11 @@ | ||
// | ||
// GTUIWindow.swift | ||
// Adwaita | ||
// | ||
// Created by david-swift on 12.10.23. | ||
// | ||
|
||
import GTUI | ||
|
||
/// A GTUI window. | ||
public typealias GTUIWindow = GTUI.Window |
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
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
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
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,49 @@ | ||
// | ||
// Clamp.swift | ||
// Adwaita | ||
// | ||
// Created by david-swift on 12.10.23. | ||
// | ||
|
||
import GTUI | ||
|
||
/// A horizontal AdwClamp equivalent. | ||
struct Clamp: Widget { | ||
|
||
/// The content. | ||
var content: View | ||
/// The maximum size. | ||
var maxSize: Int | ||
|
||
/// Update a view storage. | ||
/// - Parameter storage: The view storage. | ||
func update(_ storage: ViewStorage) { | ||
if let clamp = storage.view as? GTUI.Clamp { | ||
_ = clamp.maximumSize(maxSize) | ||
} | ||
if let storage = storage.content[.mainContent]?[safe: 0] { | ||
content.widget().update(storage) | ||
} | ||
} | ||
|
||
/// Get a view storage. | ||
/// - Returns: The view storage. | ||
func container() -> ViewStorage { | ||
let container = content.storage() | ||
let clamp: GTUI.Clamp = .init(container.view) | ||
_ = clamp.maximumSize(maxSize) | ||
return .init(clamp, content: [.mainContent: [container]]) | ||
} | ||
|
||
} | ||
|
||
extension View { | ||
|
||
/// Set the view's maximal size. | ||
/// - Parameter maxSize: The maximal size. | ||
/// - Returns: A view. | ||
public func frame(maxSize: Int? = nil) -> View { | ||
Clamp(content: self, maxSize: maxSize ?? -1) | ||
} | ||
|
||
} |
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
Oops, something went wrong.