[sugar] [PATCH] tweak battery charging (progress) bar

Martin Dengler martin at martindengler.com
Fri Apr 25 20:17:03 EDT 2008


Sorry, a bit overzealous -- that's the wrong place to set the size,
even in my 4-days-of-gtk opinion.

On Sat, Apr 26, 2008 at 12:50:58AM +0100, Martin Dengler wrote:
> 1. battery charging (progress) bar (and thus the palette) made wider, consistent with widths in new design (in http://wiki.laptop.org/go/Designs/Frame#06 the palette is almost exactly 4 frame icons wide).
> 2. charge percentage palette text left in always, even when charged, 'cause Eben doesn't like when it goes away.
> ---
>  src/view/devices/battery.py |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/src/view/devices/battery.py b/src/view/devices/battery.py
> index a97d014..ab2df8f 100644
> --- a/src/view/devices/battery.py
> +++ b/src/view/devices/battery.py
> @@ -95,6 +95,10 @@ class BatteryPalette(Palette):
>  
>          self.set_content(vbox)
>  
> +        self._progress_bar.set_size_request(
> +            style.zoom(style.GRID_CELL_SIZE * 4), -1)
> +                                            
> +
>      def set_level(self, percent):
>          self._level = percent
>          fraction = percent / 100.0
> @@ -120,7 +124,6 @@ class BatteryPalette(Palette):
>                                         'min': remaining_minpart})
>          else:
>              secondary_text = _('Charged')
> -            status_text = ''
>  
>          self.props.secondary_text = secondary_text
>          self._status_label.set_text(status_text)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.laptop.org/pipermail/sugar/attachments/20080426/988f55c7/attachment.pgp 


More information about the Sugar mailing list