Skip to content

[Draft] Implementation ZoomArea

He estado mirando como hacer el componente ZoomArea, el principal problema que me he encontrado es dependiendo del elemento sobre el que se desea hacer zoom el código de la función onWheel es distinto. Esto nos obliga a de alguna forma implementar una función personalizada para cada elemento.

En este MR puedes ver como en GridView se llama al componente Maui.ZoomArea y se usa la señal onWheel donde se implementa el código para hacer el Zoom pero justo arriba esta el componente MouseArea, que es donde estaba antes todo ese código, por lo que no tiene mucho sentido. Si vas a ImageTools/ImageViewer.qml se puede ver de nuevo la función onWheel (distinta a la de GridView.qml) de nuevo deberiamos crear el componente Maui.ZoomArea poner todo ese codigo en onWheel del ZoomArea en lugar de en MouseArea.

Creo que la idea es que con instanciar el component Maui.ZoomArea sea capaz de saber sobre que tiene que aplicar el zoom y como debe hacerlo, por el momento no se me ha ocurrido la forma de hacerlo, si tienes alguna idea hazmelo saber.

Sigo pensando en modos de implementarlo.


I have been looking at how to make the ZoomArea component, the main problem that I have encountered is depending on the element on which you want to zoom the code of the function on the wheel is different. This forces us to some way to implement a custom function for each element.

In this MR you can see how in GridView the Maui.ZoomArea component is called and the onWheel signal is used where the code is implemented to do the Zoom but just above is the MouseArea component, which is where all that code was before, so it does not have a lot of sense. If you go to ImageTools / ImageViewer.qml you can see the onWheel function again (different from GridView.qml) again we should create the Maui.ZoomArea component put all that code in onWheel of the ZoomArea instead of in MouseArea.

I think the idea is that with instance the Maui.ZoomArea component is able to know what it has to zoom and how it should do it, at the moment, I have not thought of how to do it, if you have any idea let me know.

I'm still thinking of ways to implement it.

Merge request reports