Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristhofer Travieso <cristhofert97@gmail.com>2012-08-22 18:16:43 (GMT)
committer Cristhofer Travieso <cristhofert97@gmail.com>2012-08-22 18:16:43 (GMT)
commit595934e69ee41cc15079f0fdb757eb1244ad5b75 (patch)
treeda49e19fcc0f6b6e2de65ad989c2e95ac8dae864
parent3799e3d03a1a2e40582c40ec4e1ed702a7c1885b (diff)
Put the convert title_label in the center
-rw-r--r--activity.py13
-rw-r--r--convert.py4
2 files changed, 10 insertions, 7 deletions
diff --git a/activity.py b/activity.py
index abb88b7..810e3b8 100644
--- a/activity.py
+++ b/activity.py
@@ -61,7 +61,7 @@ class ConvertActivity(activity.Activity):
self.label_box = gtk.HBox()
- self.adjustment = gtk.Adjustment(1.0, 1.0, 10000.0, 0.1, 1.0)
+ self.adjustment = gtk.Adjustment(1.0, 1.0, 10.0 ** 20.0, 0.1, 1.0)
self.spin = gtk.SpinButton(self.adjustment, 0.0, 1)
self.label = gtk.Label()
@@ -71,6 +71,9 @@ class ConvertActivity(activity.Activity):
self.convert_btn = gtk.Button(_('Convert'))
self.convert_btn.connect('clicked', self._call)
+ title_info = gtk.Label('%s:' % _('Convert'))
+ title_info.modify_font(pango.FontDescription('bold 12'))
+
self.label_info = gtk.Label()
self.label_info.modify_font(pango.FontDescription('12'))
@@ -86,7 +89,8 @@ class ConvertActivity(activity.Activity):
self._canvas.pack_start(self.label_box, True, False, 0)
self.label_box.add(self.label)
spin_box.pack_start(self.convert_btn, False, False, 20)
- self._canvas.pack_end(self.label_info, False, False, 30)
+ self._canvas.pack_end(self.label_info, False, False, 2)
+ self._canvas.pack_end(title_info, False, False, 2)
self.set_canvas(self._canvas)
@@ -223,9 +227,8 @@ class ConvertActivity(activity.Activity):
def update_label_info(self, util=None, to_util=None):
try:
value = self.dic[util][0] * self.dic[to_util][1]
- self.label_info.set_text(' %s: \n %s x %s = %s' % (_('Convert'),
- str(util),
- str(value), str(to_util)))
+ self.label_info.set_text('%s x %s = %s' % (str(util),
+ str(value), str(to_util)))
except KeyError:
pass
diff --git a/convert.py b/convert.py
index 603c763..435d182 100644
--- a/convert.py
+++ b/convert.py
@@ -64,9 +64,9 @@ volume = {_('Meter'): (1, 1, 3),
_('Kilometer'): (1000000000, 1e-9, 3),
_('Mile'): (4168180000, 2.399128636479231e-10, 3),
_('Centimeter'): (0.000001, 1000000, 3),
- _('Milimeter'): (1e-9, 999999999.9999999),
+ _('Milimeter'): (1e-9, 999999999.9999999, 3),
_('Liter'): (0.001, 1000),
- _('Milliliter'): (0.000001, 1000000),
+ _('Milliliter'): (0.000001, 1000000, 3),
_('Pint'): (0.000473176, 2113.378531455526),
_('Quart'): (0.000946353, 1056.6881491367385),
_('Gallon'): (0.00378541, 264.172176857989)