Revision f86bf88...

Go back to digest for 26th May 2013

Optimization in KDE Base

Eike Hein committed changes in [kde-baseapps/KDE/4.10] /applets/folderview:

Preserve relative positions when changing icon size in containment case.

Icon positions are preserved by scaling the top-left coordinate pair
by the difference between the old and new grid sizes, or by recreating
the same logical column/row coordinate pair in the newly-calculated
grid if the align-to-grid option is enabled.

Icons that run out of bounds (or exceed the maximum column or row)
accumulate at the relevant screen edges. There is a precedent for
this behavior in the general align-to-grid code.

The left-to-right or right-to-left flow is taken into account when
scaling.

Smarter behaviors can be imagined as an optimization (e.g. identi-
fying groups of icons along screen edges and preserving their edge
alignment regardless of overall layout flow), but this simple scaling
implementation certainly beats throwing positions away altogether.

However, positions do still get thrown away in the non-containment
case - as the regular widget is capable of handling overflow via a
scrollbar, relayouting to exploit that felt better in practice.

File Changes

Modified 2 files
  • /applets/folderview
  •   plasma/iconview.cpp
  •   plasma/iconview.h
2 files changed in total