Every time Statistics is called, the dialog position and size is reset. Under some window managers on Linux it's possible to resize the dialog with a titlebar button, on Windows the dialog can be resized by dragging one of its corners. It would be useful if the dialog's last geometry was remembered.
--
Kos
I'm attaching a diff where this RFE is implemented. Please review if this can be committed. Thanks.
--
Kos
Using
persistGeometry
will remember both the size and the location, but the Statistics window is modal, so it doesn't make sense for the location to be anywhere other than the default, i.e. centered over the main window. When multiple instances of OmegaT are open, their Statistics windows would all be shown in the same place, which would be confusing.If your goal is just to remember the size, then I think adding a
persistSize
method would be more appropriate.Regarding your patch: the preference key is not consistent with the rest of the code:
_GEOMETRY
keys haveWINDOW
in the field name, but this one doesn'tLast edit: Aaron Madlon-Kay 2017-10-22
Thanks for the comments, Aaron! Here's another diff with hopefully proper preference key. Instead of adding another method, I moved
persistGeomtry
call beforesetLocationRelativeTo(parent)
, so even thought the window's location is being saved, it's ignored.I had briefly looked at implementing
persistSize
but it would have been either a lot of duplicate code or a lot of extra switches. Your workaround is much better. The only thing I would add is a comment pointing out that you are callingsetLocationRelativeTo
afterwards on purpose because you only want to persist the size. With that I think it would be ready to commit to trunk.Thank you, Aaron, for revising the patch.
Comment added and code commited.
Implemented in the released version 4.1.3 of OmegaT.
Didier