diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-01-15 12:43:44 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-16 10:12:30 +0700 |
commit | 816f6db35644d419ac09e359ec61afc36592686c (patch) | |
tree | 3db2cb5b2c51ea797ed66143f739ec8748a97d8c /qt-ui | |
parent | 07037066006af9704b33e960322aaaab98f22eef (diff) | |
download | subsurface-816f6db35644d419ac09e359ec61afc36592686c.tar.gz |
Added all the state transitions for each state.
This code adds all state transitions for the items on screen; they do not
animate yet, but already move to the correct location (the location seems
wrong on the screen, because I'v not correctly zoomed out the canvas yet).
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index c25e3925b..5bd738da3 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -126,6 +126,56 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : const QLineF profileYAxisExpanded = QLineF(0,0,0,timeAxisOnCanvas); const QLineF timeAxisLine = QLineF(0, 0, 96, 0); + // State Defaults: + // Empty State, everything but the background is hidden. + emptyState->assignProperty(this, "backgroundBrush", QBrush(Qt::white)); + emptyState->assignProperty(background, "y", backgroundOnCanvas); + emptyState->assignProperty(profileYAxis, "x", profileYAxisOffCanvas); + emptyState->assignProperty(gasYAxis, "x", gasYAxisOffCanvas); + emptyState->assignProperty(timeAxis, "y", timeAxisOffCanvas); + emptyState->assignProperty(depthController, "y", depthControllerOffCanvas); + emptyState->assignProperty(timeController, "y", timeControllerOffCanvas); + + // Profile, everything but the background, depthController and timeController are shown. + profileState->assignProperty(this, "backgroundBrush", getColor(::BACKGROUND)); + profileState->assignProperty(background, "y", backgroundOffCanvas); + profileState->assignProperty(profileYAxis, "x", profileYAxisOnCanvas); + profileState->assignProperty(profileYAxis, "line", profileYAxisExpanded); + profileState->assignProperty(gasYAxis, "x", 0); + profileState->assignProperty(timeAxis, "y", timeAxisOnCanvas); + profileState->assignProperty(depthController, "y", depthControllerOffCanvas); + profileState->assignProperty(timeController, "y", timeControllerOffCanvas); + + // Edit, everything but the background and gasYAxis are shown. + editState->assignProperty(this, "backgroundBrush", QBrush(Qt::darkGray)); + editState->assignProperty(background, "y", backgroundOffCanvas); + editState->assignProperty(profileYAxis, "x", profileYAxisOnCanvas); + editState->assignProperty(profileYAxis, "line", profileYAxisExpanded); + editState->assignProperty(gasYAxis, "x", gasYAxisOffCanvas); + editState->assignProperty(timeAxis, "y", timeAxisEditMode); + editState->assignProperty(depthController, "y", depthControllerOnCanvas); + editState->assignProperty(timeController, "y", timeControllerOnCanvas); + + // Add, everything but the background and gasYAxis are shown. + addState->assignProperty(this, "backgroundBrush", QBrush(Qt::darkGray)); + addState->assignProperty(background, "y", backgroundOffCanvas); + addState->assignProperty(profileYAxis, "x", profileYAxisOnCanvas); + addState->assignProperty(profileYAxis, "rect", profileYAxisExpanded); + addState->assignProperty(gasYAxis, "x", gasYAxisOffCanvas); + addState->assignProperty(timeAxis, "y", timeAxisEditMode); + addState->assignProperty(depthController, "y", depthControllerOnCanvas); + addState->assignProperty(timeController, "y", timeControllerOnCanvas); + + // Plan, everything but the background and gasYAxis are shown. + planState->assignProperty(this, "backgroundBrush", QBrush(Qt::darkGray)); + planState->assignProperty(background, "y", backgroundOffCanvas); + planState->assignProperty(profileYAxis, "x", profileYAxisOnCanvas); + planState->assignProperty(profileYAxis, "line", profileYAxisExpanded); + planState->assignProperty(gasYAxis, "x", gasYAxisOffCanvas); + planState->assignProperty(timeAxis, "y", timeAxisEditMode); + planState->assignProperty(depthController, "y", depthControllerOnCanvas); + planState->assignProperty(timeController, "y", timeControllerOnCanvas); + } // Currently just one dive, but the plan is to enable All of the selected dives. |