2 * Copyright (C) 2013 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17#ifndef HORIZONTALJOURNAL_H
18#define HORIZONTALJOURNAL_H
20#include "abstractdashview.h"
22 /** A horizontal journal is a view that creates delegates
23 * based on a model and layouts them one after the other
24 * in the same row until there is no more free space for the next item
25 * and so that item is layouted in the next row
27 * All delegates are forced to rowHeight if they don't have it.
29 class HorizontalJournal : public AbstractDashView
33 Q_PROPERTY(qreal rowHeight READ rowHeight WRITE setRowHeight NOTIFY rowHeightChanged)
35friend class HorizontalJournalTest;
40 qreal rowHeight() const;
41 void setRowHeight(qreal rowHeight);
44 void rowHeightChanged();
47 void findBottomModelIndexToAdd(int *modelIndex, qreal *yPos) override;
48 void findTopModelIndexToAdd(int *modelIndex, qreal *yPos) override;
49 bool removeNonVisibleItems(qreal bufferFromY, qreal bufferToY) override;
50 void addItemToView(int modelIndex, QQuickItem *item) override;
51 void cleanupExistingItems() override;
52 void calculateImplicitHeight() override;
53 void doRelayout() override;
54 void updateItemCulling(qreal visibleFromY, qreal visibleToY) override;
55#if (QT_VERSION < QT_VERSION_CHECK(5, 1, 0))
56 void processModelRemoves(const QVector<QQuickChangeSet::Remove> &removes) override;
58 void processModelRemoves(const QVector<QQmlChangeSet::Remove> &removes) override;
61 int m_firstVisibleIndex;
62 QList<QQuickItem*> m_visibleItems;
63 QMap<int, double> m_lastInRowIndexPosition;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list