Skip to content

Commit 9bba11e

Browse files
committed
comment improvements
1 parent bf91e02 commit 9bba11e

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

Examples/Sources/WindowingExample/WindowingApp.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct AlertDemo: View {
6464
}
6565
}
6666

67-
// kind of a stress test for the dismiss action
67+
// A demo displaying SwiftCrossUI's `View.sheet` modifier.
6868
struct SheetDemo: View {
6969
@State var isPresented = false
7070
@State var isShortTermSheetPresented = false

Sources/AppKitBackend/AppKitBackend.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@ public final class AppKitBackend: AppBackend {
16881688
}
16891689

16901690
public func createSheet(content: NSView) -> NSCustomSheet {
1691-
// Initialize with a default contentRect, similar to window creation (lines 58-68)
1691+
// Initialize with a default contentRect, similar to `createWindow`
16921692
let sheet = NSCustomSheet(
16931693
contentRect: NSRect(
16941694
x: 0,

Sources/GtkBackend/GtkBackend.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1627,7 +1627,7 @@ public final class GtkBackend: AppBackend {
16271627
public func createSheet(content: Widget) -> Gtk.Window {
16281628
let sheet = Gtk.Window()
16291629
sheet.setChild(content)
1630-
1630+
16311631
return sheet
16321632
}
16331633

Sources/SwiftCrossUI/Backend/AppBackend.swift

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,8 @@ public protocol AppBackend: Sendable {
617617

618618
/// Shows a sheet as a modal on top of or within the given window.
619619
/// Users should be unable to interact with the parent window until the
620-
/// sheet gets dismissed. The sheet will be closed once onDismiss gets called
620+
/// sheet gets dismissed.
621+
/// `onDismiss` only gets called once the sheet has been closed.
621622
///
622623
/// Must only get called once for any given sheet.
623624
///
@@ -629,16 +630,16 @@ public protocol AppBackend: Sendable {
629630
)
630631

631632
/// Dismisses a sheet programmatically.
632-
/// Gets used by the SCUI sheet implementation to close a sheet.
633+
/// Gets used by the ``View/sheet`` modifier to close a sheet.
633634
func dismissSheet(_ sheet: Sheet, window: Window?)
634635

635636
/// Get the dimensions of a sheet
636637
func sizeOf(_ sheet: Sheet) -> SIMD2<Int>
637638

638639
/// Sets the corner radius for a sheet presentation.
639640
///
640-
/// This method is called when the sheet content has a `presentationCornerRadius` modifier
641-
/// applied at its top level. The corner radius affects the sheet's presentation container,
641+
/// This method is called when the sheet content has a `presentationCornerRadius`
642+
/// preference key set. The corner radius affects the sheet's presentation container,
642643
/// not the content itself.
643644
///
644645
/// - Parameters:
@@ -648,8 +649,8 @@ public protocol AppBackend: Sendable {
648649

649650
/// Sets the available detents (heights) for a sheet presentation.
650651
///
651-
/// This method is called when the sheet content has a `presentationDetents` modifier
652-
/// applied at its top level. Detents allow users to resize the sheet to predefined heights.
652+
/// This method is called when the sheet content has a `presentationDetents`
653+
/// preference key set. Detents allow users to resize the sheet to predefined heights.
653654
///
654655
/// - Parameters:
655656
/// - sheet: The sheet to apply the detents to.
@@ -659,10 +660,10 @@ public protocol AppBackend: Sendable {
659660
/// Sets the visibility for a sheet presentation.
660661
///
661662
/// This method is called when the sheet content has a `presentationDragIndicatorVisibility`
662-
/// modifier applied at its top level.
663+
/// preference key set.
663664
///
664665
/// - Parameters:
665-
/// - sheet: The sheet to apply the detents to.
666+
/// - sheet: The sheet to apply the drag indicator visibility to.
666667
/// - visibility: visibility of the drag indicator (visible or hidden)
667668
func setPresentationDragIndicatorVisibility(
668669
of sheet: Sheet,
@@ -672,23 +673,23 @@ public protocol AppBackend: Sendable {
672673
/// Sets the background color for a sheet presentation.
673674
///
674675
/// This method is called when the sheet content has a `presentationBackground`
675-
/// modifier applied at its top level.
676+
/// preference key set.
676677
///
677678
/// - Parameters:
678-
/// - sheet: The sheet to apply the detents to.
679-
/// - color: rgba background color
679+
/// - sheet: The sheet to apply the background to.
680+
/// - color: Background color for the sheet
680681
func setPresentationBackground(of sheet: Sheet, to color: Color)
681682

682-
/// Sets the interactive dismissablility of a sheet.
683+
/// Sets the interactive dismissibility of a sheet.
683684
/// when disabled the sheet can only be closed programmatically,
684685
/// not through users swiping, escape keys or similar.
685686
///
686687
/// This method is called when the sheet content has a `interactiveDismissDisabled`
687-
/// modifier applied at its top level.
688+
/// preference key set.
688689
///
689690
/// - Parameters:
690-
/// - sheet: The sheet to apply the detents to.
691-
/// - disabled: wether its disabled
691+
/// - sheet: The sheet to apply the interactive dismissability to.
692+
/// - disabled: Whether interactive dismissing is disabled.
692693
func setInteractiveDismissDisabled(for sheet: Sheet, to disabled: Bool)
693694

694695
/// Presents an 'Open file' dialog to the user for selecting files or

0 commit comments

Comments
 (0)