File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed
Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -934,7 +934,10 @@ public final class Gtk3Backend: AppBackend {
934934 gtk_native_dialog_show ( chooser. gobjectPointer. cast ( ) )
935935 }
936936
937- public func createTapGestureTarget( wrapping child: Widget ) -> Widget {
937+ public func createTapGestureTarget( wrapping child: Widget , gesture: TapGesture ) -> Widget {
938+ if gesture != . primary {
939+ fatalError ( " Unsupported gesture type \( gesture) " )
940+ }
938941 let eventBox = Gtk3 . EventBox ( )
939942 eventBox. setChild ( to: child)
940943 eventBox. aboveChild = true
@@ -943,8 +946,12 @@ public final class Gtk3Backend: AppBackend {
943946
944947 public func updateTapGestureTarget(
945948 _ tapGestureTarget: Widget ,
949+ gesture: TapGesture ,
946950 action: @escaping ( ) -> Void
947951 ) {
952+ if gesture != . primary {
953+ fatalError ( " Unsupported gesture type \( gesture) " )
954+ }
948955 tapGestureTarget. onButtonPress = { _, buttonEvent in
949956 let eventType = buttonEvent. type
950957 guard
Original file line number Diff line number Diff line change @@ -129,10 +129,6 @@ final class TappableWidget: ContainerWidget {
129129 }
130130 }
131131
132- override init ( child: some WidgetProtocol ) {
133- super. init ( child: child)
134- }
135-
136132 @objc
137133 func viewTouched( ) {
138134 onTap ? ( )
Original file line number Diff line number Diff line change @@ -1014,7 +1014,10 @@ public final class WinUIBackend: AppBackend {
10141014 // ) {
10151015 // }
10161016
1017- public func createTapGestureTarget( wrapping child: Widget ) -> Widget {
1017+ public func createTapGestureTarget( wrapping child: Widget , gesture: TapGesture ) -> Widget {
1018+ if gesture != . primary {
1019+ fatalError ( " Unsupported gesture type \( gesture) " )
1020+ }
10181021 let tapGestureTarget = TapGestureTarget ( )
10191022 addChild ( child, to: tapGestureTarget)
10201023 tapGestureTarget. child = child
@@ -1037,8 +1040,12 @@ public final class WinUIBackend: AppBackend {
10371040
10381041 public func updateTapGestureTarget(
10391042 _ tapGestureTarget: Widget ,
1043+ gesture: TapGesture ,
10401044 action: @escaping ( ) -> Void
10411045 ) {
1046+ if gesture != . primary {
1047+ fatalError ( " Unsupported gesture type \( gesture) " )
1048+ }
10421049 let tapGestureTarget = tapGestureTarget as! TapGestureTarget
10431050 tapGestureTarget. clickHandler = action
10441051 tapGestureTarget. width = tapGestureTarget. child!. width
You can’t perform that action at this time.
0 commit comments