Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2010-06-09 18:51:54 (GMT)
committer Walter Bender <walter@sugarlabs.org>2010-06-09 18:51:54 (GMT)
commit4cffe6e5698d189629702bac6409f190da38afdc (patch)
tree42630b72db6151fed4ff7aeb4eef32845a925a31
parent1d4276705641b2d34601387421095cb80652a4cd (diff)
simplify label display in case of single rod
-rw-r--r--abacus_window.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/abacus_window.py b/abacus_window.py
index 6981072..7e57a07 100644
--- a/abacus_window.py
+++ b/abacus_window.py
@@ -323,17 +323,21 @@ class Abacus():
self.press = None
# The complexity below is to make the label as simple as possible
sum = ""
+ multiple_rods = False
for x in self.mode.get_rod_values():
if x > 0:
rod_value = dec2frac(x)
if sum == "":
sum = rod_value
else:
+ multiple_rods = True
sum += " + %s" % (rod_value)
if sum == "":
self.mode.label("")
- else:
+ elif multiple_rods:
self.mode.label(sum + " = " + self.mode.value())
+ else:
+ self.mode.label(self.mode.value())
return True
def _expose_cb(self, win, event):