Sb3 : UI : minor : Auto-expansion of window size

With beta 3, there was this new thing (I think?) that I didn’t see mentioned in the change file, but when you have the Inspector closed, and the width of the text area is around your default width, when the Inspector is opened again, Scrivener will try to expand to accomodate the new width, saving you a Cmd-Opt-= to fix the width. The only problem is: It doesn’t seem to ever work right. The new adjusted width is never precisely the preference width, only approximately. I have tried with different Binder widths to see if that was the causative, but it never seems to hit the mark. I just use the default width of 500, by the way.

The default width thing is only used when you hit “zoom”. In the case of opening the inspector, it doesn’t try to use your default width. Instead, it calculates the minimum necessary inspector width and the minimum necessary main document width, and if these can’t be accommodated then it resizes the window to fit. But the window is only resized as little as possible - like I say, in this case, it doesn’t try to use the default width. There are lots of places like this where the resizing has to be fairly rough, simply because of the number of possible element combinations in the main window and the problems caused by split views and making sure they all have enough room.

The minimum main document width, incidentally, is 460 pixels, so that is probably what you are seeing. This width is a decent width and ensures that both views fit even if there is a vertical split present. I have notes in my code to make this all a little more dynamic in the future, but getting the split views to play nicely and the window size to fit around that took more time than a lot of the code that should be more important, so I don’t want to touch this again for some time - one little change can cause things to go horribly wrong.

Hope that makes sense.

That makes perfect sense. I had assumed it was an attempt to retain the editor width preset, because it was so close – maybe 10 pixels off. I like it better without auto stuff, really. This re-size to fit the minimum specs is necessary; not really what I’m talking about. I wouldn’t like it if the application did any more than that though. Usually I have my sizes set up just how I want them. So, if you do ever take this on in the future: Make it a preference. :slight_smile:

Will do - if I ever do. Like I say, at the moment it will only ever resize the window if absolutely necessary in order to prevent views corrupting one another.