Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respond to window resizing (was [Question] Fullscreen mode: How floating windows should behave?) #224

Closed
LukeG89 opened this issue Oct 28, 2024 · 6 comments
Milestone

Comments

@LukeG89
Copy link

LukeG89 commented Oct 28, 2024

In this initial stage, the floating window has this behavior in fullscreen mode:

  • Remains the same size and place when you enter
  • Moves the window up when you exit
  • Fits full-height windows when you exit, and keep the new size when you enter again
Fullscreen_Behavior.mp4

Now I wonder: Is this the correct behavior? How to avoid unwanted moving and resizing?

@chrisgoringe
Copy link
Owner

The current logic is:

  • the controller window should at all times be fully visible
  • if it is off the edge of the screen, it should be moved (as little as possible)
  • if that is not possible (because it is too tall, for instance), it should be shrunk (as little as possible)

That's definitely correct behaviour when the user is moving the controller.

However, when the window is resized, there are two issues:

  • the controller doesn't react until you interact with it (need to watch for window resize events)
  • the above rules result in the controller size being changed if you shrink the window then grow it again

I think the first should be fixed. The second, I think is the natural way for it to work given the three rules above, and I doubt the cost/benefit of trying to do otherwise.

@chrisgoringe chrisgoringe changed the title [Question] Fullscreen mode: How floating windows should behave? Respond to window resizing (was [Question] Fullscreen mode: How floating windows should behave?) Oct 28, 2024
@chrisgoringe chrisgoringe added this to the 1.1 milestone Oct 28, 2024
@JorgeR81
Copy link

JorgeR81 commented Oct 28, 2024

Could it be possible to have a button to "maximize the window" ?

In the "maximized" state:

  • The Controller panel would be a full height column.
  • Vertical scaling is locked
  • Auto adjust the column height, when the canvas size changes.

Alternatively, instead of having button, the column could enter "maximized" state automatically, if we resize it to full height.
And the resize handle would still be available, ( so that we can leave the maximized state ).

@LukeG89
Copy link
Author

LukeG89 commented Oct 28, 2024

Maybe the only thing I would change is the window position, following the browser window resize like Queue and Graph Canvas menus:

Floating_Menus_Behavior.mp4

@chrisgoringe
Copy link
Owner

I think I might have found a better solution. See what you think. If you resize the window down then up, it should return to the size and position it was before (unless you interact with it in between, in which case the new position takes preference).

Basic logic is:

  • we have a preferred dimension, which is the last position/size set by the user dragging it
  • the display position is a modified version of the preferred position

@JorgeR81
Copy link

Can't we have rules like these ?

1 - If a Controller border touches a canvas border, it will always do so, unless the user changes this ( by dragging it or resizing it )

2 - The position for the Controller will be changed, when needed, to to follow rule 1

3 - If changing the position is not enough to fulfill rule 1, dimensions will be changed.

This last one is in case the Controller has full height ( if 2 opposite canvas borders are touched by the controller ).
To fulfill rule 1, then you need to increase height.

@chrisgoringe
Copy link
Owner

I've put this into #228 as part of making controller windows snap together, since they are quite related.

Since any code handling this will need to be rewritten when we have multiple controllers, I'm going to leave this as is for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants