mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Micro-optimization
This commit is contained in:
parent
8f63d98f0c
commit
c4fce3eee9
@ -7,8 +7,7 @@ LIGHT = '#F6F3E9'
|
||||
LIGHT_DARKER = '#b6b3a8'
|
||||
LIGHT_GRADIENT = 'linear-gradient(to bottom, {}, {})'.format(LIGHT, LIGHT_DARKER)
|
||||
|
||||
def get_color(name):
|
||||
return {
|
||||
DEFAULT_COLORS = {
|
||||
# General colors
|
||||
'window-background': LIGHT,
|
||||
'window-background2': LIGHT_DARKER,
|
||||
@ -38,11 +37,24 @@ def get_color(name):
|
||||
'dialog-background': LIGHT,
|
||||
'dialog-background-image': LIGHT_GRADIENT,
|
||||
'dialog-foreground': DARK,
|
||||
}[name]
|
||||
}
|
||||
|
||||
def get_font_size(name):
|
||||
return {
|
||||
DEFAULT_SIZES = {
|
||||
'title': '1.4rem',
|
||||
'item-list-title': '1.1rem',
|
||||
'item-list-subtitle': '0.8rem',
|
||||
}[name]
|
||||
}
|
||||
|
||||
DEFAULT_FONTS = {
|
||||
'main': 'sans-serif'
|
||||
}
|
||||
|
||||
def get_color(name):
|
||||
return DEFAULT_COLORS[name]
|
||||
|
||||
def get_font_size(name):
|
||||
return DEFAULT_SIZES[name]
|
||||
|
||||
def get_font_family(name):
|
||||
name = name or 'main'
|
||||
return DEFAULT_FONTS[name]
|
||||
|
Loading…
x
Reference in New Issue
Block a user