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

Horizontal offset for OS X dialog sheets #5447

Closed
davej opened this issue May 8, 2016 · 0 comments
Closed

Horizontal offset for OS X dialog sheets #5447

davej opened this issue May 8, 2016 · 0 comments

Comments

@davej
Copy link
Contributor

davej commented May 8, 2016

  • Electron version: All
  • Operating system: OS X

Thanks @bengotow for the y-offset, would it be possible to do a x-offset also? It may seem like an odd request but if you have a full-height sidebar menu then the sheet should be centered on the content pane. It's best understood with a screenshot (the dialog should not overlap the sidebar)...

screen shot 2016-05-08 at 12 33 58-2

Probably would have been easier if I identified this potential issue in #4679 (sorry!).

Perhaps the best backwards compatible way to introduce this functionality is to keep the existing API but also accept an object with x and y values:

var toolbarRect = document.getElementById('toolbar').getBoundingClientRect();
var sidebarRect = document.getElementById('sidebar').getBoundingClientRect();

win.setSheetOffset({
  x: sidebarRect.width / 2,
  y: toolbarRect.height
});

I'm happy to have a go implementing this myself but I haven't hacked on the codebase before and since @bengotow implemented the original feature then perhaps he is better placed to add this functionality?

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

No branches or pull requests

2 participants