Skip to content
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

Add ZoomContentControl #1109

Closed
3 of 4 tasks
kazo0 opened this issue Apr 12, 2024 · 13 comments · Fixed by #1249
Closed
3 of 4 tasks

Add ZoomContentControl #1109

kazo0 opened this issue Apr 12, 2024 · 13 comments · Fixed by #1249
Assignees
Labels
kind/enhancement New feature or request.

Comments

@kazo0
Copy link
Contributor

kazo0 commented Apr 12, 2024

Extract the ZoomContentControl code to Toolkit as a standalone control.

  • Move to Toolkit repo
  • Add tests
  • Add documentation
  • Create Tech Bite video
@kazo0 kazo0 added kind/enhancement New feature or request. triage/untriaged Indicates an issue requires triaging or verification. and removed triage/untriaged Indicates an issue requires triaging or verification. labels Apr 12, 2024
@kazo0
Copy link
Contributor Author

kazo0 commented Apr 12, 2024

fyi @nickrandolph / @iurycarlos

@iurycarlos
Copy link
Contributor

iurycarlos commented Apr 13, 2024

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

@MartinZikmund
Copy link
Member

@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?

@kucint
Copy link

kucint commented Jul 11, 2024

@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
Copy link

kucint commented Jul 11, 2024

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?

@MartinZikmund
Copy link
Member

@morning4coffe-dev will verify this 👍

@morning4coffe-dev
Copy link
Member

morning4coffe-dev commented Jul 15, 2024

Hey @kucint, I validated this issue and made a fix unoplatform/Uno.Samples#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)

@kucint
Copy link

kucint commented Jul 19, 2024

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
Copy link

kucint commented Jul 22, 2024

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

@morning4coffe-dev
Copy link
Member

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.

@kucint
Copy link

kucint commented Jul 22, 2024

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!

@MartinZikmund
Copy link
Member

@kucint first release of the control will soon show up in the latest dev version of Toolkit (may take a few hours)

@kucint
Copy link

kucint commented Oct 25, 2024

Great! Thanks for info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants