bluerobotics / cockpit

An intuitive and customizable cross-platform ground control station for remote vehicles of all types.
https://docs.bluerobotics.com/ardusub-zola/software/control-station/Cockpit-1.0/overview/
Other
46 stars 19 forks source link

Use dynamic positioning with respect to bottom bar #904

Closed rafaellehmkuhl closed 3 months ago

rafaellehmkuhl commented 3 months ago

Now the bottom bar has a dynamic size, that is exposed to everyone. This allows for components like the SlideToConfirm, or widgets like the Map to use only the visible widgets area (and prevent positioning of buttons under the bar).

The immediate change is that the Map widget now does not have its buttons "floating" in the middle of the widget, with a fixed height from the bottom edge. They can now react to the positioning of the widget itself with respect to the bottom bar, never being under it.

Before: image

After:

https://github.com/bluerobotics/cockpit/assets/6551040/424d6f4c-9267-4b7d-a76f-94347c73f97c

ArturoManzoli commented 3 months ago

The dynamic placement of the buttons on the map widget looks very nice!

In addition to that, what if the widgets were prevented from being dragged or resized under the top and bottom bars? Probably no user intentionally places the widgets covered by the bars.

ArturoManzoli commented 3 months ago

There is a console error regarding a mouse event when dragging the map widget: Not from this commits, but is good to point out anyway.

image

rafaellehmkuhl commented 3 months ago

In addition to that, what if the widgets were prevented from being dragged or resized under the top and bottom bars?

I'm finishing this functionality in a separate PR. Should be ready between today and tomorrow.

Probably no user intentionally places the widgets covered by the bars. For most situations that is true, but we have the case of full-screen widgets, like the VideoPlayer and the Map. I'm taking them into account for this.