Skip to content

Better window placement and auto resizing to better display the DAG #6

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

Merged
merged 5 commits into from
Jan 8, 2015

Conversation

pmiossec
Copy link
Contributor

  • ONLY after loading a new repository
  • on the top left of the WorkArea (to be able to have a git window on the right)
  • never bigger than the WorkArea
  • Add a button to let the user resize when he wants

@rbanks54 rbanks54 self-assigned this Dec 30, 2014
@rbanks54
Copy link
Contributor

Hi Phillipe,

This looks much better :-) The usability is much better now. Thanks!

Unfortunately I ran into a problem when when using multiple monitors. The ResizeWindowDependingOnGraphSize() method will crash when trying to calculate the new width because Left is > PrimaryScreenWidth. This happens when I have a second monitor positioned to the right of my primary. Also, PrimaryScreenWidth only returns the width of the primary display, not the width of a secondary display, which may be where GitViz is running.

You might want to look at http://stackoverflow.com/questions/254197/how-can-i-get-the-active-screen-dimensions/254241#254241 to see how to get the width of the current screen. You might also want to look at http://geekswithblogs.net/JeffFerguson/archive/2010/06/14/calculating-screen-resolutions-using-wpf.aspx given the increase on high DPI displays going around these days :-)

@pmiossec
Copy link
Contributor Author

pmiossec commented Jan 8, 2015

I have fixed the crash about the multiscreen support. Thanks for the links it was very helpful!

For the High DPI support, I think I can't do something :(
I have written the beginning of something (based on the link you gave me) but, because I don't have a high DPI screen, PresentationSource.FromVisual(Application.Current.MainWindow) is always null and I can't do nothing :(

If someone need it, he will have to do it himself... I can create a pull request with what I did but It is difficult for me to imagine what values of width, height, left and top will be returned and where the factor should be applied :(

@rbanks54
Copy link
Contributor

rbanks54 commented Jan 8, 2015

Agreed re high DPI screens. We might wait until the WPF team deliver on their roadmap :-)

rbanks54 added a commit that referenced this pull request Jan 8, 2015
Better window placement and auto resizing to better display the DAG
@rbanks54 rbanks54 merged commit 58fa9a2 into Readify:master Jan 8, 2015
@pmiossec pmiossec deleted the auto_resize branch May 3, 2016 20:56
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

Successfully merging this pull request may close these issues.

2 participants