More work on devices, getting there

This commit is contained in:
Marco Pesenti Gritti
2007-02-28 15:42:41 +01:00
parent 0f1adfe1de
commit aec4fcf874
5 changed files with 49 additions and 32 deletions
+12
View File
@@ -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
+5 -1
View File
@@ -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')