requirements: ensure newer pytest to avoid pytest_cov travis errors
[git-cola.git] / cola / widgets / defs.py
blobcab94c3147ec0f4acffe1aa102c469333bcc50f3
1 from __future__ import absolute_import, division, 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)
24 cursor_width = scale(2)
25 handle_width = scale(4)
26 button_spacing = scale(12)
27 tool_button_height = scale(28)
29 small_icon = scale(16)
30 medium_icon = scale(48)
31 large_icon = scale(96)
32 huge_icon = scale(192)
34 max_size = scale(4096)
36 border = max(1, scale(0.5))
37 checkbox = scale(12)
39 logo_text = 24
41 radio_border = max(1, scale(1.0 - (1.0 / math.pi)))
43 separator = scale(3)
45 dialog_w = scale(720)
46 dialog_h = scale(445)
48 msgbox_h = scale(128)