Version: HEAD (using KDE KDE 3.5.1) Installed from: Compiled From Sources OS: Linux PROBLEM: When a new plot is created it is not added to the end of the already existing plots, which would seem to be the intuitive place for it. STEPS TO REPRODUCE: Start Kst Using the data wizard create 4 plots arranged in a single window on a 2x2 grid Select the Plots... New Plot... menu item RESULTS: The new plot is added to a newly created row in the middle of the window EXPECTED RESULTS: The new plot is added to a newly created row at the bottom of the window
I agree that this is quite annoying...
This problem is caused by a shortcoming in KstViewObject::cleanup(...) which by default prefers to place new plots at the left-middle of a window.
Created attachment 20179 [details] JPG image of result of creating new plot The new (empty) plot position is shown.
Barth, was there any particular reason for placing new plots in the left-middle of a window?
There are at least three scenarios when regriding will occur: * the plots are laid out randomly and the user wishes them placed on a grid * the plots are already laid out on a grid and the user wishes to change the number of columns * the user creates a new plot when existing plots are laid out randomly * the user creates a new plot when existing plots are already laid out on a grid Under each of these four scenarios the user will probably expect something different to be done. At present the code only handles the first case well. The expected responses are outline below: * plots move to their closest grid location. Unassigned plots are added to holes - the existing behaviour * the plot sequence is retained reading left to right and top to bottom. This operation is reversible. * the new plot is added to some arbitrary location * the plot sequence is retained reading left to right and top to bottom. The new plot(s) are added to the end of the sequence.
A simple approach would be to pass a list of the newly created plots to the cleanup(...) routine. This can be used to distinguish between the case where the user has requested a regrid operation (there are no plots in the newly created plot list), plots have been added to a window, and plots have been added to a new window.
SVN commit 711269 by arwalker: BUG:140625 If the plots are already arranged on a grid then retain the natural order and add new plots to a logical location M +3 -7 kstcsddialog_i.cpp M +1 -5 kstcurvedialog_i.cpp M +2 -2 kstdatawizard_i.cpp M +3 -7 ksteqdialog_i.cpp M +3 -7 ksthsdialog_i.cpp M +3 -7 kstimagedialog_i.cpp M +1 -5 kstpsddialog_i.cpp M +4 -9 ksttoplevelview.cpp M +1 -5 ksttoplevelview.h M +173 -131 kstviewobject.cpp M +3 -2 kstviewobject.h M +3 -7 kstvvdialog_i.cpp