diff --git a/epydial/data/themes/blackwhite/dialer_main.edc b/epydial/data/themes/blackwhite/dialer_main.edc index cdfb9f9..efd1bee 100644 --- a/epydial/data/themes/blackwhite/dialer_main.edc +++ b/epydial/data/themes/blackwhite/dialer_main.edc @@ -28,6 +28,12 @@ color_classes { color2: 128 128 128 255; color3: 128 128 128 255;; } + color_class { + name: "battvolt_active"; + color: 255 255 255 128; + color2: 128 128 128 255; + color3: 128 128 128 255;; + } color_class { name: "button_active"; color: 0 0 0 255; @@ -237,11 +243,11 @@ collections { type: TEXT; mouse_events: 0; description { - color_class: "button_inactive"; + color_class: "battvolt_active"; state: "default" 0.0; rel1 { relative: 5/6 0; } rel2 { relative: 1 1/20; } - text { text, "1.41 V"; font: "Sans"; size, 1; align, 1 0.5; fit, 0 1; } + text { text, "batt"; font: "Sans"; size, 1; align, 1 0.5; fit, 0 1; } } } /* end battvolt_text */ part { diff --git a/epydial/dialer_screen.py b/epydial/dialer_screen.py index 55fa4e0..573b025 100644 --- a/epydial/dialer_screen.py +++ b/epydial/dialer_screen.py @@ -29,7 +29,11 @@ class DialerScreen(EdjeGroup): PyneoController.register_callback("gsm_signal_strength_change", self.on_gsm_signal_strength_change) PyneoController.register_callback("battvolt_change", self.on_battvolt_change) - def on_battvolt_change(self, battvolt): + def on_battvolt_change(self, battvolt, chgmode): + if chgmode == "play-only": + EdjeGroup.color_class_set(self, "battvolt_active", 255, 255, 255, 64, 0,0,0,0,0,0,0,0) + else: + EdjeGroup.color_class_set(self, "battvolt_active", 255, 255, 255, 128, 0,0,0,0,0,0,0,0) self.part_text_set("battvolt_text", "%s V"%str(battvolt)[:4]) def on_sim_key_required(self, key_type): diff --git a/epydial/epydial.py b/epydial/epydial.py index 849b99d..5118e54 100755 --- a/epydial/epydial.py +++ b/epydial/epydial.py @@ -336,7 +336,7 @@ class PyneoController(object): status = dedbusmap(status_map) print "POWER Status: " + str(status) if status.has_key('battvolt'): - class_.notify_callbacks("battvolt_change", status['battvolt']) + class_.notify_callbacks("battvolt_change", status['battvolt'], status['chgmode']) class_.notify_callbacks("pwr_status_change", status) @classmethod