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

Preview pane placement #478

Closed
secretfork opened this issue Feb 3, 2021 · 8 comments
Closed

Preview pane placement #478

secretfork opened this issue Feb 3, 2021 · 8 comments

Comments

@secretfork
Copy link

Hi! I usually snap dnGrep to the right or left on my screen (50%) which makes the window ratio more portrait than landscape, meaning my window will have more space on the height than the width. I would really appreciate a setting for where you would set where you like your preview window to be located (stacked under the rest of the boxes, or on the side).

I suppose one could just detach the preview window, but then you have another button in the windows task bar (without a name), and you have to minimize and move them individually every time.

@JVimes
Copy link
Contributor

JVimes commented Feb 3, 2021

If the panes are side-by-side in portrait mode, they'd be tall and narrow. That's an option you want?

Just making sure this isn't a request for side-by-side in landscape mode, where a responsive UI would solve it without adding a button or configuration.

@secretfork
Copy link
Author

secretfork commented Feb 3, 2021

Basically, right now (as-is) there is a right and a left pane. What i would like is the option to disable the right pane, and instead have the preview under the search results box. I hope that is clear enough?

EDIT: making this behavior automatic through a responsive UI, would of course be one option of achieving this. Another would be a manual setting. I'd be fine with whatever option.

@doug24
Copy link
Contributor

doug24 commented Feb 4, 2021

Like this? I was able to do this by modifying the code, but making configurable or responsive would take a lot more work to figure out.
image

@secretfork
Copy link
Author

Just like that.

@JVimes
Copy link
Contributor

JVimes commented Feb 7, 2021

@doug24 I think a simple approach to making it responsive would be: Set x:Name on the preview and GridSplitter. Add extra RowDefinitions so there's a place for them in "tall mode". In Window.SizeChanged handler, set their Grid.Row and Grid.Column based on if the window is tall or wide. Sorry if you already know all this. I haven't looked at code, so maybe making assumptions.

@doug24
Copy link
Contributor

doug24 commented Feb 10, 2021

I have a pull request that adds the second (bottom) docking location. In this PR, there is a context menu to select either the right or bottom dock location. It will save and restore the dock location and size, both when undocking and stopping/restarting dnGrep. I think this is sufficient to solve the problem.

There are additional possible enhancements:

  1. Make the dock location responsive to the aspect ratio of the main dnGrep window - if it is wider than tall, it will dock to right; if it is taller than wide, then it will dock to the bottom. This would reflect the screen orientation if the dnGrep main is maximized. The problem is how to select the transition thresholds, and how to handle a variety of use cases. But my guess is there are few people would use this, and most would just fix the dock to the right or bottom side.

  2. Make the docking window respond to drag and drop to undock, and dock back into the right or bottom location. The code currently doesn't support this, and after a few quick attempts, I don't know how make this happen.

Anyone with thoughts or comments?

@JVimes
Copy link
Contributor

JVimes commented Feb 11, 2021

I like "if it is wider than tall, it will dock to right; if it is taller than wide, then it will dock to the bottom". I have a hard time seeing use cases beyond that. We're not PhotoShop or a CAD tool.

I think the current dock/float should be fine. Just change which grid cell the dock occupies in the main window, done in the window's size changed event.

@doug24
Copy link
Contributor

doug24 commented Feb 15, 2021

Added in release v2.9.319.

@doug24 doug24 closed this as completed Mar 1, 2021
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