Micro-optimization

This commit is contained in:
Kovid Goyal 2017-05-19 07:15:12 +05:30
parent 8f63d98f0c
commit c4fce3eee9
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -7,42 +7,54 @@ LIGHT = '#F6F3E9'
LIGHT_DARKER = '#b6b3a8' LIGHT_DARKER = '#b6b3a8'
LIGHT_GRADIENT = 'linear-gradient(to bottom, {}, {})'.format(LIGHT, LIGHT_DARKER) LIGHT_GRADIENT = 'linear-gradient(to bottom, {}, {})'.format(LIGHT, LIGHT_DARKER)
DEFAULT_COLORS = {
# General colors
'window-background': LIGHT,
'window-background2': LIGHT_DARKER,
'window-foreground': DARK,
'window-error-foreground': 'red',
'window-hover-foreground': 'red',
# Top bar specific colors
'bar-background': DARK,
'bar-foreground': LIGHT,
'bar-highlight': 'yellow',
'heart': '#B92111',
# Item list colors
'list-hover-background': DARK,
'list-hover-foreground': LIGHT,
# Tree colors
'tree-highlight-item': LIGHT_DARKER,
# Button colors
'button-start': DARK,
'button-end': '#49423B',
'button-text': LIGHT,
# Dialog colors
'dialog-background': LIGHT,
'dialog-background-image': LIGHT_GRADIENT,
'dialog-foreground': DARK,
}
DEFAULT_SIZES = {
'title': '1.4rem',
'item-list-title': '1.1rem',
'item-list-subtitle': '0.8rem',
}
DEFAULT_FONTS = {
'main': 'sans-serif'
}
def get_color(name): def get_color(name):
return { return DEFAULT_COLORS[name]
# General colors
'window-background': LIGHT,
'window-background2': LIGHT_DARKER,
'window-foreground': DARK,
'window-error-foreground': 'red',
'window-hover-foreground': 'red',
# Top bar specific colors
'bar-background': DARK,
'bar-foreground': LIGHT,
'bar-highlight': 'yellow',
'heart': '#B92111',
# Item list colors
'list-hover-background': DARK,
'list-hover-foreground': LIGHT,
# Tree colors
'tree-highlight-item': LIGHT_DARKER,
# Button colors
'button-start': DARK,
'button-end': '#49423B',
'button-text': LIGHT,
# Dialog colors
'dialog-background': LIGHT,
'dialog-background-image': LIGHT_GRADIENT,
'dialog-foreground': DARK,
}[name]
def get_font_size(name): def get_font_size(name):
return { return DEFAULT_SIZES[name]
'title': '1.4rem',
'item-list-title': '1.1rem', def get_font_family(name):
'item-list-subtitle': '0.8rem', name = name or 'main'
}[name] return DEFAULT_FONTS[name]