mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 12:23:24 +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
|
||||
}
|
||||
|
||||
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) {
|
||||
// recalculate our non-pinned children
|
||||
hiddenChildren = d.findMatchingChildren(desktop, function(child){
|
||||
return !d.isTopLevelWindow(child) && child.visible;
|
||||
});
|
||||
|
||||
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
|
||||
|
|
|
@ -16,7 +16,7 @@ Window {
|
|||
id: window
|
||||
modality: Qt.ApplicationModal
|
||||
destroyOnCloseButton: true
|
||||
destroyOnInvisible: true
|
||||
destroyOnHidden: true
|
||||
frame: ModalFrame { }
|
||||
|
||||
property int colorScheme: hifi.colorSchemes.light
|
||||
|
|
|
@ -256,7 +256,7 @@ ToolBar = function(x, y, direction, optionalPersistenceKey, optionalInitialPosit
|
|||
y: y - ToolBar.SPACING
|
||||
});
|
||||
}
|
||||
this.save();
|
||||
//this.save();
|
||||
}
|
||||
|
||||
this.setAlpha = function(alpha, tool) {
|
||||
|
|
Loading…
Reference in a new issue