File: defs.py

package info (click to toggle)
git-cola 4.14.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 6,812 kB
  • sloc: python: 37,625; sh: 298; makefile: 223; xml: 102; tcl: 62
file content (52 lines) | stat: -rw-r--r-- 873 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import os
import math


try:
    scale_factor = float(os.getenv('GIT_COLA_SCALE', '1'))
except ValueError:
    scale_factor = 1.0


def scale(value, factor=scale_factor):
    return int(value * factor)


no_margin = 0
small_margin = scale(2)
margin = scale(4)
large_margin = scale(12)

no_spacing = 0
spacing = scale(4)
titlebar_spacing = scale(8)
button_spacing = scale(12)

cursor_width = scale(2)
handle_width = scale(4)
tool_button_height = scale(28)

default_icon = scale(16)
small_icon = scale(12)
action_icon = scale(14)
medium_icon = scale(48)
large_icon = scale(96)
huge_icon = scale(192)

max_size = scale(4096)

border = max(1, scale(0.5))
checkbox = scale(12)
radio = scale(22)

action_text = scale(10)
logo_text = 24

radio_border = max(1, scale(1.0 - (1.0 / math.pi)))

separator = scale(3)

dialog_w = scale(720)
dialog_h = scale(445)

msgbox_h = scale(128)