on xenial help sign in
Dash overview handle
commitd393da8b3311a21a9f15b02ab7f175a84c0d508b authorAlbert Astals <albert.astals@canonical.com> dateFri 8 Aug 2014, 10:47 (12 years ago) parentb8acc39
6 files changed+28
plugins/Dash/listviewwithpageheader.cpp+8 plugins/Dash/listviewwithpageheader.h+3 qml/Dash/Dash.qml+11 qml/Dash/DashContent.qml+2 qml/Dash/GenericScopeView.qml+4 qml/Dash/graphics/overview_hint@27.png
plugins/Dash/listviewwithpageheader.cpp+8
@@ -330,6 +330,11 @@ int ListViewWithPageHeader::stickyHeaderHeight() const
330330 return m_topSectionItem ? m_topSectionItem->height() : 0;
331331}
332332
333+qreal ListViewWithPageHeader::headerItemShownHeight() const
334+{
335+ return m_headerItemShownHeight;
336+}
337+
333338void ListViewWithPageHeader::positionAtBeginning()
334339{
335340 if (m_delegateModel->count() <= 0)
@@ -396,6 +401,7 @@ void ListViewWithPageHeader::showHeader()
396401 firstItem->setY(firstItem->y() - m_headerItemShownHeight);
397402 layout();
398403 }
404+ Q_EMIT headerItemShownHeightChanged();
399405 }
400406 m_contentYAnimation->setTo(to);
401407 contentYAnimationType = ContentYAnimationShowHeader;
@@ -544,6 +550,7 @@ void ListViewWithPageHeader::adjustHeader(qreal diff)
544550 m_headerItem->setY(-m_minYExtent);
545551 }
546552 }
553+ Q_EMIT headerItemShownHeightChanged();
547554 } else {
548555 // Stick the header item to the top when dragging down
549556 m_headerItem->setY(contentY());
@@ -1096,6 +1103,7 @@ void ListViewWithPageHeader::headerHeightChanged(qreal newHeaderHeight, qreal ol
10961103 m_headerItemShownHeight = qBound(static_cast<qreal>(0.), m_headerItemShownHeight, newHeaderHeight);
10971104 updateClipItem();
10981105 adjustMinYExtent();
1106+ Q_EMIT headerItemShownHeightChanged();
10991107 } else {
11001108 if (oldHeaderY + oldHeaderHeight > contentY()) {
11011109 // If the header is shown because its position
plugins/Dash/listviewwithpageheader.h+3
@@ -53,6 +53,7 @@ class ListViewWithPageHeader : public QQuickFlickable, public QQuickItemChangeLi
5353 Q_PROPERTY(QString sectionProperty READ sectionProperty WRITE setSectionProperty NOTIFY sectionPropertyChanged)
5454 Q_PROPERTY(bool forceNoClip READ forceNoClip WRITE setForceNoClip NOTIFY forceNoClipChanged)
5555 Q_PROPERTY(int stickyHeaderHeight READ stickyHeaderHeight NOTIFY stickyHeaderHeightChanged)
56+ Q_PROPERTY(qreal headerItemShownHeight READ headerItemShownHeight NOTIFY headerItemShownHeightChanged)
5657
5758 friend class ListViewWithPageHeaderTest;
5859 friend class ListViewWithPageHeaderTestSection;
@@ -81,6 +82,7 @@ public:
8182 void setForceNoClip(bool noClip);
8283
8384 int stickyHeaderHeight() const;
85+ qreal headerItemShownHeight() const;
8486
8587 Q_INVOKABLE void positionAtBeginning();
8688 Q_INVOKABLE void showHeader();
@@ -100,6 +102,7 @@ Q_SIGNALS:
100102 void sectionPropertyChanged();
101103 void forceNoClipChanged();
102104 void stickyHeaderHeightChanged();
105+ void headerItemShownHeightChanged();
103106
104107protected:
105108 void componentComplete() override;
qml/Dash/Dash.qml+11
@@ -324,6 +324,17 @@ Showable {
324324 }
325325 }
326326
327+ Image {
328+ source: "graphics/overview_hint.png"
329+ anchors.horizontalCenter: parent.horizontalCenter
330+ anchors.bottom: parent.bottom
331+ opacity: overviewController.progress == 0 && (dashContent.pageHeaderTotallyVisible || scopeItem.scope && scopeItem.pageHeaderTotallyVisible) ? 1 : 0
332+ Behavior on opacity {
333+ enabled: overviewController.progress == 0
334+ UbuntuNumberAnimation {}
335+ }
336+ }
337+
327338 EdgeDragArea {
328339 id: overviewDragHandle
329340 objectName: "overviewDragHandle"
qml/Dash/DashContent.qml+2
@@ -31,6 +31,8 @@ Item {
3131 dashContentList.currentItem.item.previewShown : false
3232 readonly property bool processing: dashContentList.currentItem && dashContentList.currentItem.item
3333 && dashContentList.currentItem.item.processing || false
34+ readonly property bool pageHeaderTotallyVisible: dashContentList.currentItem && dashContentList.currentItem.item
35+ && dashContentList.currentItem.item.pageHeaderTotallyVisible || false
3436
3537 signal scopeLoaded(string scopeId)
3638 signal gotoScope(string scopeId)
qml/Dash/GenericScopeView.qml+4
@@ -37,6 +37,7 @@ FocusScope {
3737 readonly property alias previewShown: previewListView.open
3838 property int paginationCount: 0
3939 property int paginationIndex: 0
40+ property alias pageHeaderTotallyVisible: categoryView.pageHeaderTotallyVisible
4041
4142 property var scopeStyle: ScopeStyle {
4243 style: scope ? scope.customizations : {}
@@ -150,6 +151,9 @@ FocusScope {
150151
151152 property string expandedCategoryId: ""
152153
154+ readonly property bool pageHeaderTotallyVisible: scopeView.showPageHeader &&
155+ ((headerItemShownHeight == 0 && categoryView.contentY <= categoryView.originY) || (headerItemShownHeight == pageHeaderLoader.item.height))
156+
153157 delegate: ListItems.Base {
154158 id: baseItem
155159 objectName: "dashCategory" + category
qml/Dash/graphics/overview_hint@27.pngnew file

Binary file not shown.