diff options
author | Grace Karanja <gracie.karanja89@gmail.com> | 2015-08-12 20:18:34 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-08-31 15:24:15 -0700 |
commit | a734a2ee19cd865e70e8d4380ff7cae5b94b4342 (patch) | |
tree | a19276b32821ea357899e22b417ddfeab03062df /qt-mobile/DiveDetails.qml | |
parent | 3d5ad1988876bfa2ba56ae2257359f9ccc9d8b82 (diff) | |
download | subsurface-a734a2ee19cd865e70e8d4380ff7cae5b94b4342.tar.gz |
QML UI: Dynamically change button text
Dynamically change the text of the show/hide profile button.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Diffstat (limited to 'qt-mobile/DiveDetails.qml')
-rw-r--r-- | qt-mobile/DiveDetails.qml | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/qt-mobile/DiveDetails.qml b/qt-mobile/DiveDetails.qml index d6a562630..21127f470 100644 --- a/qt-mobile/DiveDetails.qml +++ b/qt-mobile/DiveDetails.qml @@ -92,9 +92,14 @@ Item { } } Button { - text: "Show/Hide Dive Profile" + text: "Hide Dive Profile" onClicked: { qmlProfile.visible = !qmlProfile.visible + if (qmlProfile.visible) { + text = "Hide Dive Profile" + } else { + text = "Show Dive Profile" + } } } |