Updownquark / Quick

Quark's User Interface Creation Kit
0 stars 0 forks source link

Add a rotator widget #39

Open Updownquark opened 11 years ago

Updownquark commented 11 years ago

The idea is to have a widget that can rotate its contents any multiple of 90 degrees. Potentially the angle could be anything, but 90 degrees is easy.

This is not at all straightforward. Currently the eventing architecture is independent of the element's logic. It uses the elements' bounds directly, not consulting them. So it would be easy to make a widget that rendered everything at an angle, but the events would propagate to the children as if they were laid out like normal.

I mainly want this to avoid having to make multiple copies of the same image for widgets that can change their orientation (think the arrow buttons at each end of a scroll bar), but it could be useful elsewhere, especially if the angle could be made arbitrary.

Updownquark commented 10 years ago

I thought of a way to advance this idea. Currently the position capture is done in MuisUtils, but it could easily be done in the element itself recursively. This would solve the eventing problem, the there's another. Layouts. How to make layouts lay out widgets at an angle. If a widget is rotated 90 degrees, how to make the layout use the parent width for the layout height and the height for the width. Maybe need another parameter in the layouts or something.

I also thought of an enhancement for this idea. Make it a transform widget. It could have the ability to rotate and/or reflect its contents.

Updownquark commented 10 years ago

I may be wrong, but I believe I've solved the conceptual problems with this task. All that's left is to solve the mathematical ones.

Updownquark commented 10 years ago

This is code complete for the moment. I want to implement a spinner using this code and also to make a test for this. I also want to come back one day and implement the arbitrary rotations. Right now rotation is confined to 90-degree intervals.