Fixed UI not reverting to previous state when exiting render dialog

This commit is contained in:
Michaël Lemaire 2015-08-26 00:28:12 +02:00
parent c450774995
commit 623a3606eb
3 changed files with 30 additions and 15 deletions

View file

@ -128,7 +128,7 @@ void MainModelerWindow::keyReleaseEvent(QKeyEvent *event)
{
render_process->stopRender();
setState("Init");
setState(rootObject()->property("previous_state").toString());
}
}
else

View file

@ -10,13 +10,12 @@ BaseRectangle {
preview_image.source = "image://renderpreviewprovider/live";
}
onOpacityChanged: {
refresh();
render_progress.value = 0;
}
onVisibleChanged: {
refresh();
render_progress.value = 0;
if (visible)
{
refresh();
render_progress.value = 0;
}
}
Image {

View file

@ -4,6 +4,7 @@ import Paysages 1.0
OpenGLView {
id: main_ui
state: "Init"
property string previous_state
width: 1000
height: 700
@ -148,6 +149,13 @@ OpenGLView {
anchors.fill: parent
}
onStateChanged: {
if (state != "Render Dialog")
{
previous_state = state;
}
}
states: [
State {
name: "Water Mode"
@ -157,6 +165,10 @@ OpenGLView {
target: water_section
enabled: true
}
PropertyChanges {
target: tool_water
selected: true
}
},
State {
name: "Atmosphere Mode"
@ -166,6 +178,10 @@ OpenGLView {
target: atmosphere_section
enabled: true
}
PropertyChanges {
target: tool_atmosphere
selected: true
}
},
State {
name: "Render Mode"
@ -175,6 +191,10 @@ OpenGLView {
target: render_toolbar
enabled: true
}
PropertyChanges {
target: tool_render
selected: true
}
},
State {
name: "File Mode"
@ -184,18 +204,14 @@ OpenGLView {
target: file_toolbar
enabled: true
}
PropertyChanges {
target: tool_file
selected: true
}
},
State {
name: "Render Dialog"
PropertyChanges {
target: primary_toolbar
enabled: false
}
PropertyChanges {
target: camera_choice
enabled: false
}
PropertyChanges {
target: render_dialog
enabled: true