on xenial help sign in
Dash overview handle
d393da8Albert Astals
plugins/Dash/listviewwithpageheader.cpp+8
@@ -330,6 +330,11 @@ int ListViewWithPageHeader::stickyHeaderHeight() const
330 return m_topSectionItem ? m_topSectionItem->height() : 0;
330 return m_topSectionItem ? m_topSectionItem->height() : 0;
331}
331}
332
332
333+qreal ListViewWithPageHeader::headerItemShownHeight() const
334+{
335+ return m_headerItemShownHeight;
336+}
337+
333void ListViewWithPageHeader::positionAtBeginning()
338void ListViewWithPageHeader::positionAtBeginning()
334{
339{
335 if (m_delegateModel->count() <= 0)
340 if (m_delegateModel->count() <= 0)
@@ -396,6 +401,7 @@ void ListViewWithPageHeader::showHeader()
396 firstItem->setY(firstItem->y() - m_headerItemShownHeight);
401 firstItem->setY(firstItem->y() - m_headerItemShownHeight);
397 layout();
402 layout();
398 }
403 }
404+ Q_EMIT headerItemShownHeightChanged();
399 }
405 }
400 m_contentYAnimation->setTo(to);
406 m_contentYAnimation->setTo(to);
401 contentYAnimationType = ContentYAnimationShowHeader;
407 contentYAnimationType = ContentYAnimationShowHeader;
@@ -544,6 +550,7 @@ void ListViewWithPageHeader::adjustHeader(qreal diff)
544 m_headerItem->setY(-m_minYExtent);
550 m_headerItem->setY(-m_minYExtent);
545 }
551 }
546 }
552 }
553+ Q_EMIT headerItemShownHeightChanged();
547 } else {
554 } else {
548 // Stick the header item to the top when dragging down
555 // Stick the header item to the top when dragging down
549 m_headerItem->setY(contentY());
556 m_headerItem->setY(contentY());
@@ -1096,6 +1103,7 @@ void ListViewWithPageHeader::headerHeightChanged(qreal newHeaderHeight, qreal ol
1096 m_headerItemShownHeight = qBound(static_cast<qreal>(0.), m_headerItemShownHeight, newHeaderHeight);
1103 m_headerItemShownHeight = qBound(static_cast<qreal>(0.), m_headerItemShownHeight, newHeaderHeight);
1097 updateClipItem();
1104 updateClipItem();
1098 adjustMinYExtent();
1105 adjustMinYExtent();
1106+ Q_EMIT headerItemShownHeightChanged();
1099 } else {
1107 } else {
1100 if (oldHeaderY + oldHeaderHeight > contentY()) {
1108 if (oldHeaderY + oldHeaderHeight > contentY()) {
1101 // If the header is shown because its position
1109 // If the header is shown because its position
plugins/Dash/listviewwithpageheader.h+3
@@ -53,6 +53,7 @@ class ListViewWithPageHeader : public QQuickFlickable, public QQuickItemChangeLi
53 Q_PROPERTY(QString sectionProperty READ sectionProperty WRITE setSectionProperty NOTIFY sectionPropertyChanged)
53 Q_PROPERTY(QString sectionProperty READ sectionProperty WRITE setSectionProperty NOTIFY sectionPropertyChanged)
54 Q_PROPERTY(bool forceNoClip READ forceNoClip WRITE setForceNoClip NOTIFY forceNoClipChanged)
54 Q_PROPERTY(bool forceNoClip READ forceNoClip WRITE setForceNoClip NOTIFY forceNoClipChanged)
55 Q_PROPERTY(int stickyHeaderHeight READ stickyHeaderHeight NOTIFY stickyHeaderHeightChanged)
55 Q_PROPERTY(int stickyHeaderHeight READ stickyHeaderHeight NOTIFY stickyHeaderHeightChanged)
56+ Q_PROPERTY(qreal headerItemShownHeight READ headerItemShownHeight NOTIFY headerItemShownHeightChanged)
56
57
57 friend class ListViewWithPageHeaderTest;
58 friend class ListViewWithPageHeaderTest;
58 friend class ListViewWithPageHeaderTestSection;
59 friend class ListViewWithPageHeaderTestSection;
@@ -81,6 +82,7 @@ public:
81 void setForceNoClip(bool noClip);
82 void setForceNoClip(bool noClip);
82
83
83 int stickyHeaderHeight() const;
84 int stickyHeaderHeight() const;
85+ qreal headerItemShownHeight() const;
84
86
85 Q_INVOKABLE void positionAtBeginning();
87 Q_INVOKABLE void positionAtBeginning();
86 Q_INVOKABLE void showHeader();
88 Q_INVOKABLE void showHeader();
@@ -100,6 +102,7 @@ Q_SIGNALS:
100 void sectionPropertyChanged();
102 void sectionPropertyChanged();
101 void forceNoClipChanged();
103 void forceNoClipChanged();
102 void stickyHeaderHeightChanged();
104 void stickyHeaderHeightChanged();
105+ void headerItemShownHeightChanged();
103
106
104protected:
107protected:
105 void componentComplete() override;
108 void componentComplete() override;
qml/Dash/Dash.qml+11
@@ -324,6 +324,17 @@ Showable {
324 }
324 }
325 }
325 }
326
326
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+
327 EdgeDragArea {
338 EdgeDragArea {
328 id: overviewDragHandle
339 id: overviewDragHandle
329 objectName: "overviewDragHandle"
340 objectName: "overviewDragHandle"
qml/Dash/DashContent.qml+2
@@ -31,6 +31,8 @@ Item {
31 dashContentList.currentItem.item.previewShown : false
31 dashContentList.currentItem.item.previewShown : false
32 readonly property bool processing: dashContentList.currentItem && dashContentList.currentItem.item
32 readonly property bool processing: dashContentList.currentItem && dashContentList.currentItem.item
33 && dashContentList.currentItem.item.processing || false
33 && dashContentList.currentItem.item.processing || false
34+ readonly property bool pageHeaderTotallyVisible: dashContentList.currentItem && dashContentList.currentItem.item
35+ && dashContentList.currentItem.item.pageHeaderTotallyVisible || false
34
36
35 signal scopeLoaded(string scopeId)
37 signal scopeLoaded(string scopeId)
36 signal gotoScope(string scopeId)
38 signal gotoScope(string scopeId)
qml/Dash/GenericScopeView.qml+4
@@ -37,6 +37,7 @@ FocusScope {
37 readonly property alias previewShown: previewListView.open
37 readonly property alias previewShown: previewListView.open
38 property int paginationCount: 0
38 property int paginationCount: 0
39 property int paginationIndex: 0
39 property int paginationIndex: 0
40+ property alias pageHeaderTotallyVisible: categoryView.pageHeaderTotallyVisible
40
41
41 property var scopeStyle: ScopeStyle {
42 property var scopeStyle: ScopeStyle {
42 style: scope ? scope.customizations : {}
43 style: scope ? scope.customizations : {}
@@ -150,6 +151,9 @@ FocusScope {
150
151
151 property string expandedCategoryId: ""
152 property string expandedCategoryId: ""
152
153
154+ readonly property bool pageHeaderTotallyVisible: scopeView.showPageHeader &&
155+ ((headerItemShownHeight == 0 && categoryView.contentY <= categoryView.originY) || (headerItemShownHeight == pageHeaderLoader.item.height))
156+
153 delegate: ListItems.Base {
157 delegate: ListItems.Base {
154 id: baseItem
158 id: baseItem
155 objectName: "dashCategory" + category
159 objectName: "dashCategory" + category
qml/Dash/graphics/overview_hint@27.pngnew file

Binary file not shown.