Get rid of some of the obsolete units usage.
This commit is contained in:
@@ -21,8 +21,6 @@ import logging
|
||||
import gobject
|
||||
import gtk
|
||||
|
||||
from sugar.graphics import units
|
||||
|
||||
class ComboBox(gtk.ComboBox):
|
||||
__gtype_name__ = 'SugarComboBox'
|
||||
|
||||
@@ -66,7 +64,11 @@ class ComboBox(gtk.ComboBox):
|
||||
def append_item(self, action_id, text, icon_name=None):
|
||||
if not self._icon_renderer and icon_name:
|
||||
self._icon_renderer = gtk.CellRendererPixbuf()
|
||||
self._icon_renderer.props.stock_size = units.microgrid_to_pixels(3)
|
||||
|
||||
settings = self.get_settings()
|
||||
w, h = gtk.icon_size_lookup_for_settings(settings, gtk.ICON_SIZE_MENU)
|
||||
self._icon_renderer.props.stock_size = w
|
||||
|
||||
self.pack_start(self._icon_renderer, False)
|
||||
self.add_attribute(self._icon_renderer, 'pixbuf', 2)
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ import hippo
|
||||
|
||||
from sugar.graphics import palettegroup
|
||||
from sugar.graphics import animator
|
||||
from sugar.graphics import units
|
||||
from sugar.graphics import style
|
||||
from sugar import _sugaruiext
|
||||
|
||||
@@ -88,7 +87,6 @@ class Palette(gobject.GObject):
|
||||
self._popdown_anim.add(_PopdownAnimation(self))
|
||||
|
||||
self._menu = _sugaruiext.Menu()
|
||||
self._menu.set_min_width(units.grid_to_pixels(1))
|
||||
|
||||
self._primary = _PrimaryMenuItem(label, accel_path)
|
||||
self._menu.append(self._primary)
|
||||
@@ -378,7 +376,7 @@ class Palette(gobject.GObject):
|
||||
class _PrimaryMenuItem(gtk.MenuItem):
|
||||
def __init__(self, label, accel_path):
|
||||
gtk.MenuItem.__init__(self)
|
||||
self.set_border_width(units.points_to_pixels(1))
|
||||
self.set_border_width(style.DEFAULT_BORDER)
|
||||
self._set_label(label, accel_path)
|
||||
|
||||
def set_label(self, label, accel_path):
|
||||
|
||||
@@ -89,6 +89,7 @@ _TAB_CURVATURE = 1
|
||||
ZOOM_FACTOR = _compute_zoom_factor()
|
||||
|
||||
DEFAULT_SPACING = zoom(8)
|
||||
DEFAULT_BORDER = zoom(6)
|
||||
LINE_WIDTH = zoom(2)
|
||||
|
||||
FONT_SIZE = zoom(7 * _XO_DPI / _get_screen_dpi())
|
||||
@@ -103,7 +104,7 @@ TOOLBOX_TAB_VBORDER = int((zoom(36) - FONT_NORMAL_H - _FOCUS_LINE_WIDTH) / 2)
|
||||
TOOLBOX_TAB_HBORDER = zoom(15) - _FOCUS_LINE_WIDTH - _TAB_CURVATURE
|
||||
TOOLBOX_TAB_LABEL_WIDTH = zoom(150 - 15 * 2)
|
||||
|
||||
COLOR_WHITE = Color('#000000')
|
||||
COLOR_BLACK = Color('#000000')
|
||||
COLOR_WHITE = Color('#FFFFFF')
|
||||
COLOR_PANEL_GREY = Color('#C0C0C0')
|
||||
COLOR_SELECTION_GREY = Color('#A6A6A6')
|
||||
|
||||
Reference in New Issue
Block a user