Tweaked sizes of home xo icon, donut radius and device icons.

This commit is contained in:
Tomeu Vizoso 2007-03-15 19:19:38 +01:00
parent 9f5d642591
commit d001c70443
4 changed files with 8 additions and 6 deletions

View File

@ -1,10 +1,11 @@
from sugar.graphics import canvasicon from sugar.graphics import canvasicon
from sugar.graphics import units
_ICON_NAME = 'device-battery' _ICON_NAME = 'device-battery'
class DeviceView(canvasicon.CanvasIcon): class DeviceView(canvasicon.CanvasIcon):
def __init__(self, model): def __init__(self, model):
canvasicon.CanvasIcon.__init__(self) canvasicon.CanvasIcon.__init__(self, scale=units.MEDIUM_ICON_SCALE)
self._model = model self._model = model
model.connect('notify::level', self._level_changed_cb) model.connect('notify::level', self._level_changed_cb)

View File

@ -17,6 +17,7 @@
from sugar.graphics import canvasicon from sugar.graphics import canvasicon
from sugar.graphics import color from sugar.graphics import color
from sugar.graphics import units
from model.devices import wirelessnetwork from model.devices import wirelessnetwork
from view.pulsingicon import PulsingIcon from view.pulsingicon import PulsingIcon
@ -24,7 +25,7 @@ _ICON_NAME = 'device-network-wireless'
class DeviceView(PulsingIcon): class DeviceView(PulsingIcon):
def __init__(self, model): def __init__(self, model):
PulsingIcon.__init__(self) PulsingIcon.__init__(self, scale=units.MEDIUM_ICON_SCALE)
self._model = model self._model = model
model.connect('notify::name', self._name_changed_cb) model.connect('notify::name', self._name_changed_cb)

View File

@ -34,8 +34,8 @@ class HomeBox(hippo.CanvasBox, hippo.CanvasItem):
hippo.CanvasBox.__init__(self, background_color=0xe2e2e2ff, yalign=2) hippo.CanvasBox.__init__(self, background_color=0xe2e2e2ff, yalign=2)
self._donut = ActivitiesDonut(shell, self._donut = ActivitiesDonut(shell,
box_width=units.grid_to_pixels(7), box_width=units.grid_to_pixels(6),
box_height=units.grid_to_pixels(7)) box_height=units.grid_to_pixels(6))
self.append(self._donut) self.append(self._donut)
self._my_icon = MyIcon(units.XLARGE_ICON_SCALE) self._my_icon = MyIcon(units.XLARGE_ICON_SCALE)
@ -93,7 +93,7 @@ class HomeBox(hippo.CanvasBox, hippo.CanvasItem):
i = 0 i = 0
for icon in self._device_icons.values(): for icon in self._device_icons.values():
angle = 2 * math.pi / len(self._device_icons) * i + math.pi / 2 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() [icon_width, icon_height] = icon.get_allocation()

View File

@ -81,7 +81,7 @@ STANDARD_ICON_SCALE = 1.0 * _dpi_factor * _zoom_factor
SMALL_ICON_SCALE = 0.5 * _dpi_factor * _zoom_factor SMALL_ICON_SCALE = 0.5 * _dpi_factor * _zoom_factor
MEDIUM_ICON_SCALE = 1.5 * _dpi_factor * _zoom_factor MEDIUM_ICON_SCALE = 1.5 * _dpi_factor * _zoom_factor
LARGE_ICON_SCALE = 2.0 * _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): def points_to_device(points):
return int(points * _zoom_factor) return int(points * _zoom_factor)