-
-
Notifications
You must be signed in to change notification settings - Fork 59
Sheet Modifier #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MiaKoring
wants to merge
41
commits into
stackotter:main
Choose a base branch
from
MiaKoring:feat/sheet
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Sheet Modifier #219
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
d13cfaa
Sheet presentation and nesting added to AppKitBackend
MiaKoring 19d772d
Added basic UIKit Sheet functionality and preparation for presentatio…
MiaKoring daca3e4
added presentationDetents and Radius to UIKitBackend
MiaKoring d6a63f2
improved sheet rendering
MiaKoring 79837ed
added presentationDragIndicatorVisibility modifier
MiaKoring b1e436b
added presentationBackground
MiaKoring 3108f77
UIKit sheet parent dismissals now dismiss both all children and the p…
MiaKoring 7df381c
added interactiveDismissDisabled modifier
MiaKoring 8669cb6
renamed size Parameter of SheetImplementation Protocol to sheetSize
MiaKoring ed300d2
GtkBackend Sheets save
MiaKoring a76ca7c
finished GtkBackendSheets
MiaKoring 941131e
documentation improvements
MiaKoring 9d6542e
Should fix UIKitBackend compile issue with visionOS and AppBackend Co…
MiaKoring 602ab54
maybe ease gh actions gtk compile fix?
MiaKoring af6da88
fixed winUI AppBackend Conformance
MiaKoring bb8b228
removed SheetImplementation Protocol, replaced with backend.sizeOf(_:)
MiaKoring 0f53ec8
Adding sheet content in createSheet() instead of update (UIKit, AppKit)
MiaKoring bf91e02
adding sheet content on create (Gtk)
MiaKoring 9bba11e
comment improvements
MiaKoring b3cfc04
maybe part of letting scui dictate size?
MiaKoring 7d0a030
changes
MiaKoring d5bf60b
moved signals to Gtk/Widgets/Window
MiaKoring 8c9d96f
removed now unecessary old code
MiaKoring 022274b
mostly comment changes
MiaKoring 17875d2
onAppear now get called correctly, onDisappear only on interactive di…
MiaKoring 0447fa0
should fix AppKit and Gtk interactive dismissal
MiaKoring 2d97d73
using preferences from final result instead of dryRunResult
MiaKoring 7ec8b6d
Merge branch 'main' into feat/sheet
MiaKoring fa884c7
Fixed sheet rendering with GtkBackend on Linux
MiaKoring 3f3bb3d
UIKit Sheet changes
MiaKoring 6c013b7
Window uses EventControllerKey generated class instead of c interop
MiaKoring f7750d7
Replaced Window Escape key press c interop with generated class
MiaKoring 40ba6ae
Formatting and comments
MiaKoring 12198f7
Trying GdkModifierType instead of UInt
MiaKoring 0d175e7
Merge remote-tracking branch 'origin/feat/sheet' into feat/sheet
MiaKoring eca589b
Made setPresentationBackground save to run/update n times on AppKitBa…
MiaKoring dce5be6
Fixed parent sheet dismissal leaves child sheet behind (GtkBackend te…
MiaKoring 45a34bd
Merge remote-tracking branch 'origin/feat/sheet' into feat/sheet
MiaKoring 64c69a9
beginCriticalSheet replaced with beginSheet on AppKitBackend
MiaKoring d2fb6e5
fix tvOS (and visionOS) compilation error
MiaKoring 30feb1e
removed .formSheet modalPresentationStyle for tvOS 26 due to CI failure
MiaKoring File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,77 @@ | ||
| import CGtk | ||
|
|
||
| /// Provides access to key events. | ||
| open class EventControllerKey: EventController { | ||
| /// Creates a new event controller that will handle key events. | ||
| public convenience init() { | ||
| self.init( | ||
| gtk_event_controller_key_new() | ||
| ) | ||
| } | ||
|
|
||
| public override func registerSignals() { | ||
| super.registerSignals() | ||
|
|
||
| addSignal(name: "im-update") { [weak self] () in | ||
| guard let self = self else { return } | ||
| self.imUpdate?(self) | ||
| } | ||
|
|
||
| let handler1: | ||
| @convention(c) ( | ||
| UnsafeMutableRawPointer, UInt, UInt, GdkModifierType, UnsafeMutableRawPointer | ||
| ) -> Void = | ||
| { _, value1, value2, value3, data in | ||
| SignalBox3<UInt, UInt, GdkModifierType>.run(data, value1, value2, value3) | ||
| } | ||
|
|
||
| addSignal(name: "key-pressed", handler: gCallback(handler1)) { | ||
| [weak self] (param0: UInt, param1: UInt, param2: GdkModifierType) in | ||
| guard let self = self else { return } | ||
| self.keyPressed?(self, param0, param1, param2) | ||
| } | ||
|
|
||
| let handler2: | ||
| @convention(c) ( | ||
| UnsafeMutableRawPointer, UInt, UInt, GdkModifierType, UnsafeMutableRawPointer | ||
| ) -> Void = | ||
| { _, value1, value2, value3, data in | ||
| SignalBox3<UInt, UInt, GdkModifierType>.run(data, value1, value2, value3) | ||
| } | ||
|
|
||
| addSignal(name: "key-released", handler: gCallback(handler2)) { | ||
| [weak self] (param0: UInt, param1: UInt, param2: GdkModifierType) in | ||
| guard let self = self else { return } | ||
| self.keyReleased?(self, param0, param1, param2) | ||
| } | ||
|
|
||
| let handler3: | ||
| @convention(c) (UnsafeMutableRawPointer, GdkModifierType, UnsafeMutableRawPointer) -> | ||
| Void = | ||
| { _, value1, data in | ||
| SignalBox1<GdkModifierType>.run(data, value1) | ||
| } | ||
|
|
||
| addSignal(name: "modifiers", handler: gCallback(handler3)) { | ||
| [weak self] (param0: GdkModifierType) in | ||
| guard let self = self else { return } | ||
| self.modifiers?(self, param0) | ||
| } | ||
| } | ||
|
|
||
| /// Emitted whenever the input method context filters away | ||
| /// a keypress and prevents the @controller receiving it. | ||
| /// | ||
| /// See [method@Gtk.EventControllerKey.set_im_context] and | ||
| /// [method@Gtk.IMContext.filter_keypress]. | ||
| public var imUpdate: ((EventControllerKey) -> Void)? | ||
|
|
||
| /// Emitted whenever a key is pressed. | ||
| public var keyPressed: ((EventControllerKey, UInt, UInt, GdkModifierType) -> Void)? | ||
|
|
||
| /// Emitted whenever a key is released. | ||
| public var keyReleased: ((EventControllerKey, UInt, UInt, GdkModifierType) -> Void)? | ||
|
|
||
| /// Emitted whenever the state of modifier keys and pointer buttons change. | ||
| public var modifiers: ((EventControllerKey, GdkModifierType) -> Void)? | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.