uno.toolkit.ui icon indicating copy to clipboard operation
uno.toolkit.ui copied to clipboard

Add ZoomContentControl

Open kazo0 opened this issue 10 months ago • 11 comments

Extract the ZoomContentControl code to Toolkit as a standalone control.

  • [ ] Move to Toolkit repo
  • [ ] Add tests
  • [ ] Add documentation
  • [ ] Create Tech Bite video

kazo0 avatar Apr 12 '24 16:04 kazo0

fyi @nickrandolph / @iurycarlos

kazo0 avatar Apr 12 '24 16:04 kazo0

BTW... I have a draft here for a semi transparent panel similar to Chrome style Zoom ... Something like ( XX% + - Redefine) Maybe would be useful

iurycarlos avatar Apr 13 '24 03:04 iurycarlos

@kucint To validate the existing implementation satisfies your requirements or to provide feedback on improvements, can you please copy the control from https://github.com/unoplatform/Uno.Samples/blob/master/UI/PhotoViewer/InteractionControls/ZoomContentControl.cs into your test app and try it out in your use case?

MartinZikmund avatar Jul 11 '24 09:07 MartinZikmund

@kucint To validate the existing implementation satisfies your requirements or to provide feedback on improvements, can you please copy the control from https://github.com/unoplatform/Uno.Samples/blob/master/UI/PhotoViewer/InteractionControls/ZoomContentControl.cs into your test app and try it out in your use case?

Sure! with pleasure. thanks @MartinZikmund !

kucint avatar Jul 11 '24 09:07 kucint

HI @MartinZikmund , could you confirm that PhotoViewer demo app actually works? I downloaded the whole Uno.Samples repository and compiled successfully the PhotoViewer. The app starts successfully but enabling Zoom control and using mouse wheel as described in UI has no effect. Could you check it please?

kucint avatar Jul 11 '24 14:07 kucint

@morning4coffe-dev will verify this 👍

MartinZikmund avatar Jul 15 '24 07:07 MartinZikmund

Hey @kucint, I validated this issue and made a fix https://github.com/unoplatform/Uno.Samples/pull/782. After you pull the changes, can you verify it is working now and if the control satisfies your requirements, please? (It should work well on Skia targets - Desktop)

morning4coffe-dev avatar Jul 15 '24 15:07 morning4coffe-dev

thanks! sure, I will check the demo app and let you know.

BTW, sorry for late answer, I was not in office last week.

kucint avatar Jul 19 '24 10:07 kucint

now, the app fails to start with following exception:

08:46:39:626	Exception thrown: 'System.Runtime.InteropServices.COMException' in System.Private.CoreLib.dll
08:46:39:626	An exception of type 'System.Runtime.InteropServices.COMException' occurred in System.Private.CoreLib.dll but was not handled in user code

additionally I see in compilation log following warnings, that tells me it won't work anyway:

C:\Src\github\Uno.Samples\UI\PhotoViewer\InteractionControls\ZoomContentControl.cs(347,9,347,28): warning Uno0001: Microsoft.UI.Xaml.UIElement.PointerWheelChanged is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Microsoft.UI.Xaml.UIElement.PointerWheelChanged) (https://aka.platform.uno/notimplemented)
1>C:\Src\github\Uno.Samples\UI\PhotoViewer\InteractionControls\ZoomContentControl.cs(352,9,352,28): warning Uno0001: Microsoft.UI.Xaml.UIElement.PointerWheelChanged is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Microsoft.UI.Xaml.UIElement.PointerWheelChanged) (https://aka.platform.uno/notimplemented)
1>C:\Src\github\Uno.Samples\UI\PhotoViewer\InteractionControls\ZoomContentControl.cs(455,21,455,54): warning Uno0001: Microsoft.UI.Input.PointerPointProperties.MouseWheelDelta is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Microsoft.UI.Input.PointerPointProperties.MouseWheelDelta) (https://aka.platform.uno/notimplemented)
1>C:\Src\github\Uno.Samples\UI\PhotoViewer\InteractionControls\ZoomContentControl.cs(449,21,449,54): warning Uno0001: Microsoft.UI.Input.PointerPointProperties.MouseWheelDelta is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Microsoft.UI.Input.PointerPointProperties.MouseWheelDelta) (https://aka.platform.uno/notimplemented)
1>InteractionControls -> C:\Src\github\Uno.Samples\UI\PhotoViewer\InteractionControls\bin\Debug\net8.0-ios\InteractionControls.dll
1>Done building project "InteractionControls.csproj".
1>C:\Src\github\Uno.Samples\UI\PhotoViewer\InteractionControls\ZoomContentControl.cs(347,9,347,28): warning Uno0001: Microsoft.UI.Xaml.UIElement.PointerWheelChanged is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Microsoft.UI.Xaml.UIElement.PointerWheelChanged) (https://aka.platform.uno/notimplemented)
1>C:\Src\github\Uno.Samples\UI\PhotoViewer\InteractionControls\ZoomContentControl.cs(352,9,352,28): warning Uno0001: Microsoft.UI.Xaml.UIElement.PointerWheelChanged is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Microsoft.UI.Xaml.UIElement.PointerWheelChanged) (https://aka.platform.uno/notimplemented)
1>C:\Src\github\Uno.Samples\UI\PhotoViewer\InteractionControls\ZoomContentControl.cs(347,9,347,28): warning Uno0001: Microsoft.UI.Xaml.UIElement.PointerWheelChanged is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Microsoft.UI.Xaml.UIElement.PointerWheelChanged) (https://aka.platform.uno/notimplemented)
1>C:\Src\github\Uno.Samples\UI\PhotoViewer\InteractionControls\ZoomContentControl.cs(352,9,352,28): warning Uno0001: Microsoft.UI.Xaml.UIElement.PointerWheelChanged is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Microsoft.UI.Xaml.UIElement.PointerWheelChanged) (https://aka.platform.uno/notimplemented)
1>C:\Src\github\Uno.Samples\UI\PhotoViewer\InteractionControls\ZoomContentControl.cs(449,21,449,54): warning Uno0001: Microsoft.UI.Input.PointerPointProperties.MouseWheelDelta is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Microsoft.UI.Input.PointerPointProperties.MouseWheelDelta) (https://aka.platform.uno/notimplemented)
1>C:\Src\github\Uno.Samples\UI\PhotoViewer\InteractionControls\ZoomContentControl.cs(455,21,455,54): warning Uno0001: Microsoft.UI.Input.PointerPointProperties.MouseWheelDelta is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Microsoft.UI.Input.PointerPointProperties.MouseWheelDelta) (https://aka.platform.uno/notimplemented)
1>InteractionControls -> C:\Src\github\Uno.Samples\UI\PhotoViewer\InteractionControls\bin\Debug\net8.0\InteractionControls.dll
1>Done building project "InteractionControls.csproj".
1>InteractionControls -> C:\Src\github\Uno.Samples\UI\PhotoViewer\InteractionControls\bin\Debug\net8.0-maccatalyst\InteractionControls.dll
1>C:\Src\github\Uno.Samples\UI\PhotoViewer\InteractionControls\ZoomContentControl.cs(347,9,347,28): warning Uno0001: Microsoft.UI.Xaml.UIElement.PointerWheelChanged is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Microsoft.UI.Xaml.UIElement.PointerWheelChanged) (https://aka.platform.uno/notimplemented)
1>C:\Src\github\Uno.Samples\UI\PhotoViewer\InteractionControls\ZoomContentControl.cs(352,9,352,28): warning Uno0001: Microsoft.UI.Xaml.UIElement.PointerWheelChanged is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Microsoft.UI.Xaml.UIElement.PointerWheelChanged) (https://aka.platform.uno/notimplemented)
1>C:\Src\github\Uno.Samples\UI\PhotoViewer\InteractionControls\ZoomContentControl.cs(449,21,449,54): warning Uno0001: Microsoft.UI.Input.PointerPointProperties.MouseWheelDelta is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Microsoft.UI.Input.PointerPointProperties.MouseWheelDelta) (https://aka.platform.uno/notimplemented)
1>C:\Src\github\Uno.Samples\UI\PhotoViewer\InteractionControls\ZoomContentControl.cs(455,21,455,54): warning Uno0001: Microsoft.UI.Input.PointerPointProperties.MouseWheelDelta is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Microsoft.UI.Input.PointerPointProperties.MouseWheelDelta) (https://aka.platform.uno/notimplemented)
1>InteractionControls -> C:\Src\github\Uno.Samples\UI\PhotoViewer\InteractionControls\bin\Debug\net8.0-android\InteractionControls.dll

kucint avatar Jul 22 '24 06:07 kucint

Hey @kucint, thank you for testing this. You tried it on .Windows target, right? Please test this on your side with other Uno targets (Skia, Wasm, Mobile...), there it should work correctly. For .Windows target we will fix this issue for the official control.

morning4coffe-dev avatar Jul 22 '24 11:07 morning4coffe-dev

Hey @kucint, thank you for testing this. You tried it on .Windows target, right? Please test this on your side with other Uno targets (Skia, Wasm, Mobile...), there it should work correctly. For .Windows target we will fix this issue for the official control.

Hi @MartinZikmund right! I tested it on .Windows target

Now, I try it on Wasm (Edge). it works ... a bit.... When using mouse wheel:

  • Horizontal scroll stops working after a specific offset
  • Vertical scroll stops working after a specific offset
  • zoom sometimes works sometimes doesn't

When using scrollbars:

  • Horizontal scroll works fine
  • Vertical scroll works fine

When scrolling, content leaves sometimes traces of previous display -> problem with refreshing.

If this would work as it promises, it would be fine to me.

Missing features:

  • zoom shall be performed relative to cursor position
  • it seems to me that keyboard shortcuts are hardcoded in the control, which is a mistake IMO. (I did not investigate the code exactly, sorry if this is not the case). I would like to decide by myself the action related to keyboard shortcuts, e.g.:
    • zoom: mouse wheel + None
    • horizontal scroll: mouse wheel + ctrl
    • vertical scroll: mouse wheel + alt
  • don't forget about performance, in my case, the child of zoom control will be a "pipeline control" that it self will contain hundred of nodes and links, so it must be performant enough to handle it.

thanks!

kucint avatar Jul 22 '24 14:07 kucint