From d001c70443007ef9a66ee89ab5c12f2519d409ac Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 15 Mar 2007 19:19:38 +0100 Subject: [PATCH] Tweaked sizes of home xo icon, donut radius and device icons. --- shell/view/devices/battery.py | 3 ++- shell/view/devices/wirelessnetwork.py | 3 ++- shell/view/home/HomeBox.py | 6 +++--- sugar/graphics/units.py | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/shell/view/devices/battery.py b/shell/view/devices/battery.py index 56e3ffbe..2047331c 100644 --- a/shell/view/devices/battery.py +++ b/shell/view/devices/battery.py @@ -1,10 +1,11 @@ from sugar.graphics import canvasicon +from sugar.graphics import units _ICON_NAME = 'device-battery' class DeviceView(canvasicon.CanvasIcon): def __init__(self, model): - canvasicon.CanvasIcon.__init__(self) + canvasicon.CanvasIcon.__init__(self, scale=units.MEDIUM_ICON_SCALE) self._model = model model.connect('notify::level', self._level_changed_cb) diff --git a/shell/view/devices/wirelessnetwork.py b/shell/view/devices/wirelessnetwork.py index d18fea06..2acb231e 100644 --- a/shell/view/devices/wirelessnetwork.py +++ b/shell/view/devices/wirelessnetwork.py @@ -17,6 +17,7 @@ from sugar.graphics import canvasicon from sugar.graphics import color +from sugar.graphics import units from model.devices import wirelessnetwork from view.pulsingicon import PulsingIcon @@ -24,7 +25,7 @@ _ICON_NAME = 'device-network-wireless' class DeviceView(PulsingIcon): def __init__(self, model): - PulsingIcon.__init__(self) + PulsingIcon.__init__(self, scale=units.MEDIUM_ICON_SCALE) self._model = model model.connect('notify::name', self._name_changed_cb) diff --git a/shell/view/home/HomeBox.py b/shell/view/home/HomeBox.py index e2483d27..86449c6d 100644 --- a/shell/view/home/HomeBox.py +++ b/shell/view/home/HomeBox.py @@ -34,8 +34,8 @@ class HomeBox(hippo.CanvasBox, hippo.CanvasItem): hippo.CanvasBox.__init__(self, background_color=0xe2e2e2ff, yalign=2) self._donut = ActivitiesDonut(shell, - box_width=units.grid_to_pixels(7), - box_height=units.grid_to_pixels(7)) + box_width=units.grid_to_pixels(6), + box_height=units.grid_to_pixels(6)) self.append(self._donut) self._my_icon = MyIcon(units.XLARGE_ICON_SCALE) @@ -93,7 +93,7 @@ class HomeBox(hippo.CanvasBox, hippo.CanvasItem): i = 0 for icon in self._device_icons.values(): angle = 2 * math.pi / len(self._device_icons) * i + math.pi / 2 - radius = units.grid_to_pixels(5) + radius = units.grid_to_pixels(4) [icon_width, icon_height] = icon.get_allocation() diff --git a/sugar/graphics/units.py b/sugar/graphics/units.py index 8581aaed..2417255e 100644 --- a/sugar/graphics/units.py +++ b/sugar/graphics/units.py @@ -81,7 +81,7 @@ STANDARD_ICON_SCALE = 1.0 * _dpi_factor * _zoom_factor SMALL_ICON_SCALE = 0.5 * _dpi_factor * _zoom_factor MEDIUM_ICON_SCALE = 1.5 * _dpi_factor * _zoom_factor LARGE_ICON_SCALE = 2.0 * _dpi_factor * _zoom_factor -XLARGE_ICON_SCALE = 3.0 * _dpi_factor * _zoom_factor +XLARGE_ICON_SCALE = 2.75 * _dpi_factor * _zoom_factor def points_to_device(points): return int(points * _zoom_factor)