jahnf / Projecteur

Linux Desktop Application for the Logitech Spotlight device (and similar devices) - Digital Laser Pointer
MIT License
374 stars 33 forks source link

Feature Request: Rectangle Shape #172

Open mrshu opened 2 years ago

mrshu commented 2 years ago

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 commented 2 years ago

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

jahnf commented 2 years ago

..., 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.

mrshu commented 2 years ago

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?

jahnf commented 2 years ago

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

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.