Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-07-31 13:21:09 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-07-31 13:21:09 (GMT)
commit72d66793a73a3ca7924b09badb5d269b41d649a3 (patch)
tree77c248c5ae5af6e8cd8752d4bc7894863daf1dab /shell
parent2ae2279d94cc890ec769bdd5952254da601e0754 (diff)
Fix all the units except icon scales.
Diffstat (limited to 'shell')
-rw-r--r--shell/view/BuddyMenu.py1
-rw-r--r--shell/view/frame/ActivitiesBox.py1
-rw-r--r--shell/view/frame/frame.py14
-rw-r--r--shell/view/frame/frameinvoker.py11
-rw-r--r--shell/view/frame/framewindow.py8
-rw-r--r--shell/view/home/HomeBox.py8
-rw-r--r--shell/view/home/snowflakelayout.py4
7 files changed, 21 insertions, 26 deletions
diff --git a/shell/view/BuddyMenu.py b/shell/view/BuddyMenu.py
index 554682b..3162ab1 100644
--- a/shell/view/BuddyMenu.py
+++ b/shell/view/BuddyMenu.py
@@ -22,7 +22,6 @@ import hippo
from sugar.graphics.palette import Palette
from sugar.graphics.menuitem import MenuItem
-from sugar.graphics import units
from sugar.presence import presenceservice
class BuddyMenu(Palette):
diff --git a/shell/view/frame/ActivitiesBox.py b/shell/view/frame/ActivitiesBox.py
index 8cd4e87..a46e8e9 100644
--- a/shell/view/frame/ActivitiesBox.py
+++ b/shell/view/frame/ActivitiesBox.py
@@ -17,7 +17,6 @@
import hippo
import logging
-from sugar.graphics import units
from sugar.graphics.palette import Palette
from sugar.graphics.xocolor import XoColor
from sugar.graphics.iconbutton import IconButton
diff --git a/shell/view/frame/frame.py b/shell/view/frame/frame.py
index 2a94754..1c4680e 100644
--- a/shell/view/frame/frame.py
+++ b/shell/view/frame/frame.py
@@ -21,7 +21,7 @@ import gobject
import hippo
from sugar.graphics import animator
-from sugar.graphics import units
+from sugar.graphics import style
from sugar.graphics import palettegroup
from sugar.clipboard import clipboardservice
@@ -271,20 +271,16 @@ class Frame(object):
screen_w = gtk.gdk.screen_width()
self._move_panel(self._top_panel, self._current_position,
- 0, units.grid_to_pixels(-1),
- 0, 0)
+ 0, - style.GRID_CELL_SIZE, 0, 0)
self._move_panel(self._bottom_panel, self._current_position,
- 0, screen_h,
- 0, screen_h - units.grid_to_pixels(1))
+ 0, screen_h, 0, screen_h - style.GRID_CELL_SIZE)
self._move_panel(self._left_panel, self._current_position,
- units.grid_to_pixels(-1), 0,
- 0, 0)
+ - style.GRID_CELL_SIZE, 0, 0, 0)
self._move_panel(self._right_panel, self._current_position,
- screen_w, 0,
- screen_w - units.grid_to_pixels(1), 0)
+ screen_w, 0, screen_w - style.GRID_CELL_SIZE, 0)
def _hide_completed_cb(self, animator):
self.mode = MODE_NONE
diff --git a/shell/view/frame/frameinvoker.py b/shell/view/frame/frameinvoker.py
index 64bc567..1b99d50 100644
--- a/shell/view/frame/frameinvoker.py
+++ b/shell/view/frame/frameinvoker.py
@@ -17,7 +17,7 @@
import gtk
-from sugar.graphics import units
+from sugar.graphics import style
from sugar.graphics.palette import Palette
from sugar.graphics.palette import CanvasInvoker
@@ -29,9 +29,10 @@ class FrameCanvasInvoker(CanvasInvoker):
return Palette.AROUND
def get_screen_area(self):
- x = units.grid_to_pixels(1)
- y = units.grid_to_pixels(1)
- width = gtk.gdk.screen_width() - units.grid_to_pixels(1)
- height = gtk.gdk.screen_height() - units.grid_to_pixels(1)
+ frame_thickness = style.zoom(75)
+
+ x = y = frame_thickness
+ width = gtk.gdk.screen_width() - frame_thickness
+ height = gtk.gdk.screen_height() - frame_thickness
return gtk.gdk.Rectangle(x, y, width, height)
diff --git a/shell/view/frame/framewindow.py b/shell/view/frame/framewindow.py
index 3fe544e..469ea65 100644
--- a/shell/view/frame/framewindow.py
+++ b/shell/view/frame/framewindow.py
@@ -17,7 +17,7 @@
import gtk
import hippo
-from sugar.graphics import units
+from sugar.graphics import style
class FrameWindow(gtk.Window):
__gtype_name__ = 'SugarFrameWindow'
@@ -48,7 +48,7 @@ class FrameWindow(gtk.Window):
return self._bg
def _update_size(self):
- padding = units.grid_to_pixels(1)
+ padding = style.GRID_CELL_SIZE
if self._orientation == hippo.ORIENTATION_HORIZONTAL:
self._bg.props.padding_left = padding
self._bg.props.padding_right = padding
@@ -56,14 +56,14 @@ class FrameWindow(gtk.Window):
self._bg.props.padding_bottom = 0
width = gtk.gdk.screen_width()
- height = units.grid_to_pixels(1)
+ height = style.GRID_CELL_SIZE
else:
self._bg.props.padding_left = 0
self._bg.props.padding_right = 0
self._bg.props.padding_top = padding
self._bg.props.padding_bottom = padding
- width = units.grid_to_pixels(1)
+ width = style.GRID_CELL_SIZE
height = gtk.gdk.screen_height()
self.resize(width, height)
diff --git a/shell/view/home/HomeBox.py b/shell/view/home/HomeBox.py
index c851d1c..fc1563a 100644
--- a/shell/view/home/HomeBox.py
+++ b/shell/view/home/HomeBox.py
@@ -25,6 +25,7 @@ import hippo
import dbus
from sugar.graphics import units
+from sugar.graphics import style
from sugar.graphics.xocolor import XoColor
from sugar.graphics.palette import Palette, CanvasInvoker
from sugar import profile
@@ -41,9 +42,8 @@ class HomeBox(hippo.CanvasBox, hippo.CanvasItem):
def __init__(self, shell):
hippo.CanvasBox.__init__(self, background_color=0xe2e2e2ff, yalign=2)
- self._donut = ActivitiesDonut(shell,
- box_width=units.grid_to_pixels(6),
- box_height=units.grid_to_pixels(6))
+ self._donut = ActivitiesDonut(shell,box_width=style.zoom(450),
+ box_height=style.zoom(450))
self.append(self._donut)
self._my_icon = HomeMyIcon(shell, units.XLARGE_ICON_SCALE)
@@ -94,7 +94,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(4)
+ radius = style.zoom(300)
[icon_width, icon_height] = icon.get_allocation()
diff --git a/shell/view/home/snowflakelayout.py b/shell/view/home/snowflakelayout.py
index 8f04846..7db39a6 100644
--- a/shell/view/home/snowflakelayout.py
+++ b/shell/view/home/snowflakelayout.py
@@ -20,9 +20,9 @@ import math
import gobject
import hippo
-from sugar.graphics import units
+from sugar.graphics import style
-_BASE_RADIUS = units.points_to_pixels(20)
+_BASE_RADIUS = style.zoom(25)
_CHILDREN_FACTOR = 1
class SnowflakeLayout(gobject.GObject,hippo.CanvasLayout):