Bug 271786 - Cleanup Layout Automatic has no effect
Summary: Cleanup Layout Automatic has no effect
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 2.0.3
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-26 17:39 UTC by Grégoire Verlut
Modified: 2011-08-25 15:13 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grégoire Verlut 2011-04-26 17:39:27 UTC
Version:           2.0.3
OS:                MS Windows

create several plots, for instance 9 plots so that you get a 3x3 layout.
remove some plots using right click / delete, for instance 3 plots

right click / cleanup layout / automatic has no effect. It seems that it is not able to change the number of rows/columns

Reproducible: Always

Steps to Reproduce:
see details

Actual Results:  
see details

Expected Results:  
I would expect the number of rows / columns to be changed. However I recognized that a smart algo to do it is not easy!

perhaps simply remove the option

OS: Windows 32-Bit
Comment 1 Netterfield 2011-04-27 14:47:36 UTC
SVN commit 1229512 by netterfield:

CCBUG: 271786 
Complete re-write of the auto-formatting system continues...
In many cases, it now behaves a lot better, but there are still bugs lurking, such as
the one reported in 271786.



 A             formatgridhelper.cpp   [License: GPL (v2+)]
 A             formatgridhelper.h   [License: GPL (v2+)]
 D             gridlayouthelper.cpp  
 D             gridlayouthelper.h  
 M  +1 -1      sharedaxisboxitem.cpp  
 M  +22 -3     viewgridlayout.cpp  
 M  +31 -205   viewitem.cpp  
 M  +0 -14     viewitem.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1229512
Comment 2 Netterfield 2011-04-28 19:51:36 UTC
SVN commit 1229650 by netterfield:

CCBUG: 271786
Further improvements to the new autoformat system.
It is ready for testing and comments (use the bug entry).



 M  +13 -2     datawizard.cpp  
 M  +12 -0     formatgridhelper.cpp  
 M  +1 -1      formatgridhelper.h  
 M  +35 -1     viewitem.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1229650
Comment 3 Netterfield 2011-04-28 20:02:11 UTC
Auto Mode: 
----------
plots are aligned onto the best uniform grid, but no attempt is made to
otherwise re-arrange the order of plots by changing number of rows or columns.

if a plot is added in auto mode, the new plot is inserted to the first empty
grid location it finds.  If there are no empty slots, then a new row is
appended (or a new column if there are already 3 more rows than columns).

Column Mode:
------------
plots are re-arranged into the desired number of columns.  If the requested
number of columns already exists, then things are just re-aligned cleanly.
The order of plots is only changed if a re-ordering would reduce the number of
rows.  Otherwise, empty grid locations are left where they are.
Comment 4 Nicolas Brisset 2011-04-28 21:24:00 UTC
Well, after a couple of minutes of testing, it looks very good! 
The only thing I dislike is that it does not detect empty lines (or columns) automatically to remove them. Do you think you could handle that (a complete line or column of empty cells => remove it)? Otherwise it is a bit painful, as you have to grow all other plots above and below, and make them about the same size, so that they fill the void while keeping the same size.
Comment 5 Nicolas Brisset 2011-05-18 23:37:56 UTC
Barth, are you planning to add something to handle the removal of complete lines or columns automatically, or is it out of scope and we should close this report?
Comment 6 Netterfield 2011-05-19 14:35:21 UTC
The philosophy of 'auto-layout' was to snap things to the closest reasonable grid, so if someone left an empty row, we should leave it empty.

However, removing an empty row or an empty column would be relatively easy to do.  
Can anyone thing of a situation where removing an empty row or column would be the wrong thing to do?
Comment 7 Nicolas Brisset 2011-05-19 14:47:04 UTC
As we say in French, "Nature hates emptiness". The only reason I see for someone to want to have an "empty" row or column is to put something else in it (like text, a picture, etc...). In that case, the user just shouldn't call the auto-layout algo just after removing the plots and before inserting the rest. Which incidentally means that the layout algorithm should not consider only plots, but also view objects. (Good, as for another long-standing idea I have it will also be the case).

And that makes me think: maybe we could even add actions in the layout section of the context menu to "Add empty row" (above/below?) and "Add empty column" (left/right?), and use them preferably to put newly created plots.
Comment 8 Netterfield 2011-08-25 15:13:38 UTC
Autolayout is now fixed, as far as I can tell.