Projecteur icon indicating copy to clipboard operation
Projecteur copied to clipboard

Feature Request: Rectangle Shape

Open mrshu opened this issue 4 years ago • 4 comments

Is your feature request related to a problem? Please describe. I would like to be able to have a Rectangle shape of the spotlight

Describe the solution you'd like Just as there is (Rounded) Square listed as one of the options for Shapes, I believe it would be great to have a rectangle as an option (this is especially valuable when highlighting code)

Describe alternatives you've considered Well, the Square shape kind of works but you have to make it real large for it to have real impact. when the thing you are trying to highlight is actually larger in either height or width. Hence, I do believe a Rectangle would be a bit better.

mrshu avatar Oct 18 '21 17:10 mrshu

@jahnf I've found https://github.com/jahnf/Projecteur/blob/dfb52bb0b86189ac5cc9383011e0028d2271ccb4/qml/spotshapes/Square.qml and I do think this should be rather doable, if you'd be up for it. I'd probably try to give it a shot myself :slightly_smiling_face:

mrshu avatar Oct 18 '21 17:10 mrshu

..., if you'd be up for it. I'd probably try to give it a shot myself :slightly_smiling_face:

Sure, pull requests are welcome 🙂

In any case, I see how a rectangle can be useful for highlighting text or code blocks.

jahnf avatar Oct 18 '21 19:10 jahnf

Thanks @jahnf, that's great to hear!

If you'd be implementing rectangle shape now, where would you start? Would updating the Square shape be a sensible way forward?

mrshu avatar Oct 18 '21 20:10 mrshu

@mrshu Yes I guess extending the current "Square" shape with 2 additional properties would work

  • for example: ratio-x, ratio-y - these would be editable like the parameters for the star shape for exeample.

With that the user could then set the "screen"-ratio or rather rectangle ratio of the shape, e.g. 16:9 or 30:3 or 3:4... or 1:1 (which would be a square)

The tricky part will be the (anchor) bindings that have to change depending on if the rectangle ratio is landscape or portait. (I would use solve this with states in the shape's qml file, while the state conditions are dynamically calculated, see also https://doc.qt.io/qt-5/qml-qtquick-anchorchanges.html)

Also renaming the "Square" shape to a "Rectangle" will break old settings, that is also something to think about.

jahnf avatar Oct 19 '21 05:10 jahnf