From db6f6e87dc4ff620f399597913f14a3b4eda277f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 2 Apr 2007 01:52:53 +0000 Subject: Edge label toggling. Made state properties dialog actually work. Other things... git-svn-id: http://svn.drobilla.net/lad/machina@390 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/EdgeView.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/gui/EdgeView.cpp') diff --git a/src/gui/EdgeView.cpp b/src/gui/EdgeView.cpp index fccf8d5..d8e11a9 100644 --- a/src/gui/EdgeView.cpp +++ b/src/gui/EdgeView.cpp @@ -41,12 +41,27 @@ EdgeView::length_hint() const } +void +EdgeView::show_label(bool show) +{ + if (show) { + char label[4]; + snprintf(label, 4, "%3f", _edge->probability()); + set_label(label); + } else { + set_label(""); + } +} + + void EdgeView::update_label() { - char label[4]; - snprintf(label, 4, "%3f", _edge->probability()); - set_label(label); + if (_label) { + char label[4]; + snprintf(label, 4, "%3f", _edge->probability()); + set_label(label); + } } -- cgit v1.2.1