-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyles.py
More file actions
79 lines (73 loc) · 2.52 KB
/
styles.py
File metadata and controls
79 lines (73 loc) · 2.52 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
from utils import (PRIMARY_ACCENT, PRIMARY_ACCENT_DARK, PRIMARY_ACCENT_LIGHT,
TEXT_HIGH, BG, CARD, BORDER, MUTED)
def textedit_style():
return f"""
QTextEdit {{
background: {CARD};
color: {TEXT_HIGH};
border: 1px solid {BORDER};
border-radius: 8px;
padding: 10px;
font-size: 11pt;
}}
QTextEdit:focus {{ border: 1px solid {PRIMARY_ACCENT}; }}
"""
def list_style():
return f"""
QListWidget {{
background: {CARD};
color: {TEXT_HIGH};
border: 1px solid {BORDER};
border-radius: 6px;
padding: 6px;
}}
QListWidget::item:selected {{ background: rgba(46,135,255,0.12); }}
"""
def log_style():
return f"""
QTextEdit {{
background: #0f1719;
color: {TEXT_HIGH};
border: 1px solid {BORDER};
border-radius: 8px;
padding: 10px;
font-family: monospace;
font-size: 10pt;
}}
"""
def primary_button_style(accent: bool = False):
if accent:
bg1, bg2 = PRIMARY_ACCENT_DARK, PRIMARY_ACCENT
else:
bg1, bg2 = PRIMARY_ACCENT, PRIMARY_ACCENT_DARK
return f"""
QPushButton {{ border-radius:8px; padding:10px 14px; color: white; font-weight:700;
background: qlineargradient(x1:0,y1:0,x2:0,y2:1, stop:0 {bg1}, stop:1 {bg2}); }}
QPushButton:disabled {{ opacity: 0.6; }}
"""
def secondary_button_style(outline: bool = False):
if outline:
return f"""
QPushButton {{ background: transparent; color: {TEXT_HIGH}; border:1px solid {BORDER}; border-radius:6px; padding:8px 10px; }}
QPushButton:disabled {{ opacity:0.6; }}
"""
return f"""
QPushButton {{ background: #0c1416; color: {TEXT_HIGH}; border:1px solid {BORDER}; border-radius:6px; padding:8px 10px; }}
QPushButton:disabled {{ opacity:0.6; }}
"""
def progress_style(primary_color: str, chunk_color: str, border: str):
return f"""
QProgressBar {{
border-radius:11px;
background: rgba(255,255,255,0.02);
border: 1px solid {border};
text-align:center;
color: {TEXT_HIGH};
padding: 0px;
min-height: 22px;
}}
QProgressBar::chunk {{
border-radius:11px;
background: qlineargradient(x1:0,y1:0,x2:1,y2:0, stop:0 {chunk_color}, stop:1 {primary_color});
}}
"""