Made latency labels static size to prevent shifting

Latencies displayed in the widget can be of different precisions, causing
  the widget to redraw when the precision changes. It's a little annoying.
  This makes latency precision static at 2 decimal places.
This commit is contained in:
AltF4 2014-01-04 23:01:06 -07:00
parent 2be6c388ad
commit 9df9559c9c

View File

@ -114,10 +114,10 @@ class Pinger:
label = "PING FAIL" label = "PING FAIL"
self.log_ping(-1) self.log_ping(-1)
else: else:
label = m.group(1)+" ms" latency = "%.2f" % float(m.group(1))
self.log_ping(m.group(1)) label = latency+" ms"
self.log_ping(latency)
self.ind.set_label(label, "100.0 ms") self.ind.set_label(label, "100.0 ms")
#self.ping_menu_item.set_label(out)
gobject.timeout_add_seconds(self.timeout, self.ping) gobject.timeout_add_seconds(self.timeout, self.ping)
def log_ping(self, value): def log_ping(self, value):