on xenial help sign in
some docu
a34e5b3Albert Astals
plugins/DashViews/verticaljournal.cpp+27
@@ -14,6 +14,33 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
15 */
16
16
17+/*
18+ * Some documentation on how this thing works:
19+ *
20+ * A vertical journal is a view that creates delegates
21+ * based on a model and layouts them in columns following
22+ * a top-left most position rule.
23+ *
24+ * The number of rules is calculated using the width of
25+ * the item, the columnWidth and the horizontalSpacing between
26+ * columns.
27+ *
28+ * The first nColumns items are layouted at row 0 from column 0
29+ * to column nColumns-1 in order. After that every new item
30+ * is positioned in the column which provides the topmost
31+ * position as possible. If more than one column tie in providing
32+ * the topmost position the leftmost column will be used.
33+ *
34+ * The implementation is centered around m_columnVisibleItems
35+ * that holds a vector of lists. There's a list for each of the
36+ * columns the view has. In the list the items of the column are
37+ * ordered as they appear topdown in the view. m_indexColumnMap is
38+ * used when re-building the list up since given a position
39+ * in the middle of the list and the need to create the previous does
40+ * not give us enough information to know in which column we have
41+ * to position the item so that when we reach the item the view is
42+ * correctly layouted at 0 for all the columns
43+ */
17#include "verticaljournal.h"
44#include "verticaljournal.h"
18
45
19#include <qqmlengine.h>
46#include <qqmlengine.h>