-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathdesktop.kv
188 lines (165 loc) · 5.83 KB
/
desktop.kv
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#:include jogrose.kv
#:include kbd.kv
#:include extruder.kv
#:include macros.kv
#:include mpg.kv
#:include dro.kv
#:include menu.kv
# <Widget>:
# # set default font size
# font_size: dp(12)
<LogLabel>:
# Draw a background to indicate selection
canvas.before:
Color:
rgba: (.0, 0.9, .1, .3) if self.selected else (0, 0, 0, 1)
Rectangle:
pos: self.pos
size: self.size
size_hint_y: None
height: self.texture_size[1]
text_size: self.width, None
font_name: "data/fonts/RobotoMono-Regular.ttf"
font_size: '12sp'
markup: True
<MainScreen>:
MainWindow:
id: main_window
<MainWindow>:
orientation: 'vertical'
BoxLayout:
orientation: 'horizontal'
BoxLayout:
# Left panel
id: blleft
orientation: 'vertical'
size_hint_x: 0.6
RecycleView:
id: log_window
viewclass: 'LogLabel'
scroll_type: ['bars','content']
scroll_wheel_distance: dp(10)
bar_width: dp(10)
scroll_y: 0
SelectableRecycleBoxLayout:
id: log_window_layout
orientation: 'vertical'
default_size: None, None
default_size_hint: 1, None
size_hint_y: None
height: self.minimum_height
multiselect: False
touch_multiselect: False
TextInput:
id: entry
focus: True
unfocus_on_touch: False
multiline: False
size_hint_y: None
height: self.minimum_height
font_size: '20sp'
on_text_validate: app.command_input(self.text); self.text= ''; app._refocus_text_input()
use_bubble: False
use_handles: False
MacrosWidget:
id: macros
BoxLayout:
# right Panel
orientation: 'vertical'
size_hint_x: 0.4
spacing: 4
TabbedPanel:
id: tabs
do_default_tab: False
tab_pos: 'top_mid' if app.tab_top else 'bottom_mid'
tab_width: dp(80)
tab_height: dp(60)
jog_rose: jog_rose
extruder_tab: extruder_tab
console_tab: console_tab
TabbedPanelItem:
id: jog
text: 'jog'
JogRoseWidget:
id: jog_rose
disabled: root.is_printing and not root.is_suspended
TabbedPanelItem:
id: console_tab
text: 'Console'
KbdWidget:
id: kbd_widget
TabbedPanelItem:
id: dro
text: 'DRO'
DROWidget:
id: dro_widget
TabbedPanelItem:
id: mpg
text: 'MPG'
MPGWidget:
id: mpg_widget
TabbedPanelItem:
id: extruder_tab
text: 'extruder'
ExtruderWidget:
id: extruder
BoxLayout:
orientation: 'horizontal'
size_hint_y: None
height: dp(45)
ToggleButton:
text: 'UART Log'
on_state: app.main_window.toggle_uart_view(self.state)
size_hint_x: None
opacity: 1 if root.is_uart_log_enabled else 0
width: dp(80) if root.is_uart_log_enabled else 0
Button:
text: 'Run Last File'
disabled: app.gcode_file == '' or not app.is_connected or root.is_printing or app.status == 'Alarm'
on_press: app.main_window.reprint()
Button:
text: 'View Last File'
disabled: app.gcode_file == ''
on_press: app.main_window.review()
BoxLayout:
orientation: 'vertical'
size_hint_y: 0.1
BoxLayout:
orientation: 'horizontal'
size_hint_y: None
size: status.texture_size
canvas.before:
Color:
rgba: 1,1,1,1
Rectangle:
pos: self.pos
size: self.size
Label:
id: status
text: root.status
color: 0,0,0,1
size_hint_x: None
width: status.texture_size[0]
Label:
id: wpos
text: 'X{:1.1f} Y{:1.1f} Z{:1.1f}'.format(*root.wpos)
color: 0,0,0,1
Label:
id: armi
text: '{}|{}'.format('A' if app.is_abs else 'R', 'I' if app.is_inch else 'M')
size_hint_x: None
width: status.texture_size[0]
color: 0,0,0,1
BoxLayout:
size_hint_y: None
size: status.texture_size
canvas.before:
Color:
rgba: 1,1,1,1
Rectangle:
pos: self.pos
size: self.size
Label:
id: eta
text: root.eta
color: 0,0,0,1