Specifying location of modal windows

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Specifying location of modal windows

Jonathan Kamens-4
My Send Later add-on for Thunderbird pops up a model dialog on
top of the message compose window.

A user has pointed out that it would be useful to position
the window below the message header, so that it does not
obscure the message recipients, so that they can be viewed
and verified while the dialog is open.

As far as I can tell, the top and left features for
window.openDialog are ignored when the model feature is
specified. Is there some other way to specify the position of
a model dialog?

I suppose I could not make the window modal, but that
introduces all kinds of issues I don't want to have to deal
with (the issues that are best addressed by making the window
modal :-)).

A related question is whether it is possible to center a
window horizontally but specify an explicit vertical position,
so that I can position the window below the message header
area in the composition window while it is centered
automatically in the other direction. I don't see a good way
to do that?

Maybe the way to address both of these is to add a handler
that waits until the window is mapped (because not until it
is laid out and mapped can its geometry be known to the
add-on, since its geometry is determined by Thunderbird) and
then do the calculations necessary to determine where I want
it and move it explicitly in my code? Will moving it even
work for a modal dialog?
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Specifying location of modal windows

Neil-4
Jonathan Kamens wrote:

>As far as I can tell, the top and left features for window.openDialog are ignored when the model feature is specified. Is there some other way to specify the position of a model dialog?
>
Off the top of my head you can add persist="screenX screenY" to your
dialog's document element and this will remember its position relative
to its parent (except on those OSes which think that it would be a good
idea to move the parent window with the dialog...)

--
Warning: May contain traces of nuts.
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Specifying location of modal windows

Onno Ekker-2
On 4/11/2014 8:57 PM, Neil wrote:

> Jonathan Kamens wrote:
>
>> As far as I can tell, the top and left features for window.openDialog
>> are ignored when the model feature is specified. Is there some other
>> way to specify the position of a model dialog?
>>
> Off the top of my head you can add persist="screenX screenY" to your
> dialog's document element and this will remember its position relative
> to its parent (except on those OSes which think that it would be a good
> idea to move the parent window with the dialog...)
>

Maybe instead of a (modal) window, you can use a sheet much like the one
you get when you right click the toolbar and select Customize... (That
is, if you have the pref toolbar.customization.usesheet toggled to true).

That way your popup can be always at the same relative position of the
window.

Onno
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird