git-cola v4.3.1
[git-cola.git] / cola / widgets / defs.py
blobab1a2781fb4b5ce8becb4df7ea4a34d09e91df5b
1 from __future__ import absolute_import, division, print_function, unicode_literals
2 import os
3 import math
6 try:
7 scale_factor = float(os.getenv('GIT_COLA_SCALE', '1'))
8 except ValueError:
9 scale_factor = 1.0
12 def scale(value, factor=scale_factor):
13 return int(value * factor)
16 no_margin = 0
17 small_margin = scale(2)
18 margin = scale(4)
19 large_margin = scale(12)
21 no_spacing = 0
22 spacing = scale(4)
23 titlebar_spacing = scale(8)
24 button_spacing = scale(12)
26 cursor_width = scale(2)
27 handle_width = scale(4)
28 tool_button_height = scale(28)
30 default_icon = scale(16)
31 small_icon = scale(12)
32 medium_icon = scale(48)
33 large_icon = scale(96)
34 huge_icon = scale(192)
36 max_size = scale(4096)
38 border = max(1, scale(0.5))
39 checkbox = scale(12)
40 radio = scale(22)
42 logo_text = 24
44 radio_border = max(1, scale(1.0 - (1.0 / math.pi)))
46 separator = scale(3)
48 dialog_w = scale(720)
49 dialog_h = scale(445)
51 msgbox_h = scale(128)