Open ciros88 opened 1 year ago
2.0.48.Alpha: it has been implemented #365 but not the simple save of a single layout, thayt means subsequent saves overwrites that single one. this means that, having now #365 implemented, there should be also the possibility to save on the same layout without be forced to save to a new one. maybe, a save action is needed instead of "new" one, and inside it the dialog could show a list of saved layouts in order to be able to select a one already existing and overwrite it or the possibility to save to a new one
That's how Adobe use it. I went for this solution because it's a bit simpler and I don't think you gain that much with the other solution.
rationale:
arrangement: what is automatically saved in memory (under-the-hood so user will not notice it) when the user change something. From sw point of view, every action on the gui (move, close, open, resize) is immediately saved to in-memory arrangement, and then flushed to the disk (in settings.ini like geometry section) when bzr2 quits. it is a developer-side only concept.
layout: it is an user-side (user aware) concept, means the user will know about layouts and how they works. layouts can be of two types:
bundled layouts: a readonly (non modifiable) arrangement loaded from the disk (through a specific file or a "bundled_layouts" section in settings.ini) already bundled with bzr2. it shound't be editedable simply because otherwise the user will be not able to restore it anymore (unless launching a fresh new bzr2). should have "(bundled)" in its name like: "small (trackers) (bundled)" or "3440x1440 (mp3s) (bundled)".
user layout: a modifiable arrangement created by the user and saved/loaded on disk through a specific file or a "user_layouts" section in settings.ini.
when bzr2 is launched from the first time (a fresh new bzr2) it starts with a default arrangement, that is simply one of the bundled default layouts (need only to decide which..maybe in future we can programmatically select it based on user resolution). this means that one bundled layout is automatically selected on fresh bzr2 start and it is placed in the in-memory arrangement (i didn't say replace/override because the fresh start does not have an in-memory arrangement yet).
then, when user resize a window the in-memory arrangement is updated, and on quit it is saved in the settings.ini as already happens now.
the user can then, anytime, save the current in-memory arrangement as a new user layout: saving a layout means saving the in-memory arrangement to disk in form of a specific file or in settings.ini under "user_layouts" section.
The save dialog should let u choose to save to new user layout or overwrite an existing one. Bundled layouts shouldn't appear in the save dialog in the dropdown list, or they can appear but as greyed-out and not selectable at the top or bottom of the list like in this pic (indentations apart):
the user can also select (load) another layout (bundled or user one) and this means that the just selected layout will override (replace) the current in-memory arrangement.
when the user quits the in-memory arrangement is saved in settings.ini geometry section: this means that save on quit will never override an user layout, it is a non-destructive action.
this mechanism also prevent the user to accidentally do a mess because maybe he select an user layout then resize a window by mistake and quit bzr2, or resize a window then by mistake quit bzr2: in both cases bzr2 will not save the current arrangement in a way that will destruct user layouts: they are still safe, untouchable from automatic on quit save
last thing about save/load layout dialogs: its is preferable to use non-modal modern dialogs than old style modal ones, maybe in future load/save layouts actions could be simply implemented as 'Window -> Layout' menu actions (quicker and nicer)
simple save of current layout