Fix all the units except icon scales.

This commit is contained in:
Marco Pesenti Gritti
2007-07-31 15:21:09 +02:00
parent 2ae2279d94
commit 72d66793a7
9 changed files with 22 additions and 27 deletions
-1
View File
@@ -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
+5 -9
View File
@@ -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
+6 -5
View File
@@ -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)
+4 -4
View File
@@ -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)