mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 04:08:13 +02:00
Make QML overlays disappear, use fade for non-window types
This commit is contained in:
parent
ed5d904b3d
commit
e9b359feb1
3 changed files with 32 additions and 11 deletions
|
@ -268,24 +268,45 @@ FocusScope {
|
||||||
pinned = newPinned
|
pinned = newPinned
|
||||||
}
|
}
|
||||||
|
|
||||||
onPinnedChanged: {
|
property real unpinnedAlpha: 1.0;
|
||||||
|
|
||||||
|
Behavior on unpinnedAlpha {
|
||||||
|
NumberAnimation {
|
||||||
|
easing.type: Easing.Linear;
|
||||||
|
duration: 300
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
state: "NORMAL"
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "NORMAL"
|
||||||
|
PropertyChanges { target: desktop; unpinnedAlpha: 1.0 }
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "PINNED"
|
||||||
|
PropertyChanges { target: desktop; unpinnedAlpha: 0.0 }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
transitions: [
|
||||||
|
Transition {
|
||||||
|
NumberAnimation { properties: "unpinnedAlpha"; duration: 300 }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
onPinnedChanged: {
|
||||||
if (pinned) {
|
if (pinned) {
|
||||||
|
// recalculate our non-pinned children
|
||||||
hiddenChildren = d.findMatchingChildren(desktop, function(child){
|
hiddenChildren = d.findMatchingChildren(desktop, function(child){
|
||||||
return !d.isTopLevelWindow(child) && child.visible;
|
return !d.isTopLevelWindow(child) && child.visible;
|
||||||
});
|
});
|
||||||
|
|
||||||
hiddenChildren.forEach(function(child){
|
hiddenChildren.forEach(function(child){
|
||||||
child.visible = false;
|
child.opacity = Qt.binding(function(){ return desktop.unpinnedAlpha });
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
hiddenChildren.forEach(function(child){
|
|
||||||
if (child) {
|
|
||||||
child.visible = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
hiddenChildren = [];
|
|
||||||
}
|
}
|
||||||
|
state = pinned ? "PINNED" : "NORMAL"
|
||||||
}
|
}
|
||||||
|
|
||||||
onShowDesktop: pinned = false
|
onShowDesktop: pinned = false
|
||||||
|
|
|
@ -16,7 +16,7 @@ Window {
|
||||||
id: window
|
id: window
|
||||||
modality: Qt.ApplicationModal
|
modality: Qt.ApplicationModal
|
||||||
destroyOnCloseButton: true
|
destroyOnCloseButton: true
|
||||||
destroyOnInvisible: true
|
destroyOnHidden: true
|
||||||
frame: ModalFrame { }
|
frame: ModalFrame { }
|
||||||
|
|
||||||
property int colorScheme: hifi.colorSchemes.light
|
property int colorScheme: hifi.colorSchemes.light
|
||||||
|
|
|
@ -256,7 +256,7 @@ ToolBar = function(x, y, direction, optionalPersistenceKey, optionalInitialPosit
|
||||||
y: y - ToolBar.SPACING
|
y: y - ToolBar.SPACING
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.save();
|
//this.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setAlpha = function(alpha, tool) {
|
this.setAlpha = function(alpha, tool) {
|
||||||
|
|
Loading…
Reference in a new issue