diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-28 14:42:41 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-28 14:42:41 (GMT) |
commit | aec4fcf874f7262a63bd08368d4cf3c16b122f44 (patch) | |
tree | 2d5c99a2d496be5209ba9020b6863ab72d959b5d /sugar | |
parent | 0f1adfe1de7f51562a4429c47f0674becd8b5f56 (diff) |
More work on devices, getting there
Diffstat (limited to 'sugar')
-rw-r--r-- | sugar/graphics/canvasicon.py | 12 | ||||
-rw-r--r-- | sugar/graphics/color.py | 6 |
2 files changed, 17 insertions, 1 deletions
diff --git a/sugar/graphics/canvasicon.py b/sugar/graphics/canvasicon.py index 56423d8..4b1134c 100644 --- a/sugar/graphics/canvasicon.py +++ b/sugar/graphics/canvasicon.py @@ -415,3 +415,15 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem): Override this method for adding prelighting behavior. """ pass + +def get_icon_state(base_name, perc): + step = 5 + strength = round(perc / step) * step + icon_theme = gtk.icon_theme_get_default() + + while strength <= 100: + icon_name = '%s-%03d' % (base_name, strength) + if icon_theme.has_icon(icon_name): + return 'theme:' + icon_name + + strength = strength + step diff --git a/sugar/graphics/color.py b/sugar/graphics/color.py index 864e8e3..5ff4c92 100644 --- a/sugar/graphics/color.py +++ b/sugar/graphics/color.py @@ -21,7 +21,9 @@ _system_colors = { 'button-hover' : '#808080', 'button-background-hover' : '#000000', 'button-inactive' : '#808080', - 'button-background-inactive' : '#424242' + 'button-background-inactive' : '#424242', + 'icon-stroke-inactive' : '#757575', + 'icon-fill-inactive' : '#9D9FA1' } def _html_to_rgb(html_color): @@ -100,3 +102,5 @@ BUTTON_HOVER = SystemColor('button-hover') BUTTON_BACKGROUND_HOVER = SystemColor('button-background-hover') BUTTON_INACTIVE = SystemColor('button-inactive') BUTTON_BACKGROUND_INACTIVE = SystemColor('button-background-inactive') +ICON_FILL_INACTIVE = SystemColor('icon-fill-inactive') +ICON_STROKE_INACTIVE = SystemColor('icon-stroke-inactive') |