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_DARKER = '#b6b3a8'
|
||||||
LIGHT_GRADIENT = 'linear-gradient(to bottom, {}, {})'.format(LIGHT, LIGHT_DARKER)
|
LIGHT_GRADIENT = 'linear-gradient(to bottom, {}, {})'.format(LIGHT, LIGHT_DARKER)
|
||||||
|
|
||||||
def get_color(name):
|
DEFAULT_COLORS = {
|
||||||
return {
|
|
||||||
# General colors
|
# General colors
|
||||||
'window-background': LIGHT,
|
'window-background': LIGHT,
|
||||||
'window-background2': LIGHT_DARKER,
|
'window-background2': LIGHT_DARKER,
|
||||||
@ -38,11 +37,24 @@ def get_color(name):
|
|||||||
'dialog-background': LIGHT,
|
'dialog-background': LIGHT,
|
||||||
'dialog-background-image': LIGHT_GRADIENT,
|
'dialog-background-image': LIGHT_GRADIENT,
|
||||||
'dialog-foreground': DARK,
|
'dialog-foreground': DARK,
|
||||||
}[name]
|
}
|
||||||
|
|
||||||
def get_font_size(name):
|
DEFAULT_SIZES = {
|
||||||
return {
|
|
||||||
'title': '1.4rem',
|
'title': '1.4rem',
|
||||||
'item-list-title': '1.1rem',
|
'item-list-title': '1.1rem',
|
||||||
'item-list-subtitle': '0.8rem',
|
'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