on xenial help sign in
Less ugly
commit54a5c4136401db62fefc7984af3d87ed3ef2209f authorAlbert Astals <albert.astals@canonical.com> dateWed 2 Oct 2013, 13:00 (13 years ago) parent5716fa9
3 files changed+9−6
Dash/Apps/RunningApplicationsGrid.qml+1 Dash/DashApps.qml+1−2 Dash/GenericScopeView.qml+7−4
Dash/Apps/RunningApplicationsGrid.qml+1
@@ -23,6 +23,7 @@ ResponsiveFlowView {
2323
2424 signal updateScreenshots
2525 property alias enableHeightBehavior: heightBehaviour.enabled
26+ property bool enableHeightBehaviourOnNextCreation: firstModel.count + secondModel.count == 0
2627
2728 Connections {
2829 target: shell
Dash/DashApps.qml+1−2
@@ -28,7 +28,6 @@ GenericScopeView {
2828 // FIXME: a way to aggregate these models would be ideal
2929 property var mainStageApplicationsModel: shell.applicationManager.mainStageApplications
3030 property var sideStageApplicationModel: shell.applicationManager.sideStageApplications
31− property bool enableHeightBehavior: false
3231
3332 ListModel {
3433 id: dummyVisibilityModifier
@@ -52,6 +51,6 @@ GenericScopeView {
5251
5352 onScopeChanged: {
5453 scopeView.scope.categories.overrideResults("recent", runningApplicationsModel);
55− enableHeightBehavior = (mainStageApplicationsModel.count + sideStageApplicationModel.count == 0)
54+ enableHeightBehaviorOnNextCreation = (mainStageApplicationsModel.count + sideStageApplicationModel.count == 0)
5655 }
5756}
Dash/GenericScopeView.qml+7−4
@@ -22,6 +22,7 @@ import "../Components/ListItems" as ListItems
2222ScopeView {
2323 id: scopeView
2424 readonly property alias previewShown: previewLoader.onScreen
25+ property bool enableHeightBehaviorOnNextCreation: false
2526
2627 onIsCurrentChanged: {
2728 pageHeader.resetSearch();
@@ -85,10 +86,12 @@ ScopeView {
8586 source: getRenderer(model.renderer, model.contentType)
8687
8788 onLoaded: {
89+ if (item.enableHeightBehavior !== undefined && item.enableHeightBehaviourOnNextCreation !== undefined) {
90+ item.enableHeightBehavior = scopeView.enableHeightBehaviorOnNextCreation;
91+ scopeView.enableHeightBehaviorOnNextCreation = false;
92+ }
8893 if (source.toString().indexOf("Apps/RunningApplicationsGrid.qml") != -1) {
8994 // TODO: the running apps grid doesn't support standard scope results model yet
90− item.enableHeightBehavior = enableHeightBehavior;
91− enableHeightBehavior = false;
9295 item.firstModel = Qt.binding(function() { return results.firstModel })
9396 item.secondModel = Qt.binding(function() { return results.secondModel })
9497 } else {
@@ -104,8 +107,8 @@ ScopeView {
104107 }
105108
106109 Component.onDestruction: {
107− if (source.toString().indexOf("Apps/RunningApplicationsGrid.qml") != -1) {
108− enableHeightBehavior = (item.firstModel.count + item.secondModel.count == 0)
110+ if (item.enableHeightBehavior !== undefined && item.enableHeightBehaviourOnNextCreation !== undefined) {
111+ scopeView.enableHeightBehaviorOnNextCreation = item.enableHeightBehaviourOnNextCreation;
109112 }
110113 }
111114