MozillaZine

[Thunderbird] Center compose message window

Talk about add-ons and extension development.
metju312
 
Posts: 10
Joined: September 6th, 2017, 1:25 am

Post Posted September 15th, 2017, 2:40 am

Hi,

How to center compose message window?

Thanks for help.

morat
 
Posts: 2366
Joined: February 3rd, 2009, 6:29 pm

Post Posted September 15th, 2017, 8:08 am

Try this:

Code: Select all
// center window on screen
var xOffset = screen.availWidth / 2 - window.outerWidth / 2;
var yOffset = screen.availHeight / 2 - window.outerHeight / 2;
xOffset = xOffset > 0 ? xOffset : 0;
yOffset = yOffset > 0 ? yOffset : 0;
window.moveTo(xOffset, yOffset);

Reference
http://dxr.mozilla.org/mozilla-release/ ... owOnScreen

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 2 guests