Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Fjen Undso
nchl
Commits
5c5325f7
Commit
5c5325f7
authored
Jan 21, 2018
by
Fjen Undso
Browse files
c.py: combine number and bar with fs
parent
2bd0dd5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
c.py
View file @
5c5325f7
...
...
@@ -242,8 +242,16 @@ def main(stdscr):
logger
.
setLevel
(
logging
.
INFO
)
numbers_text
=
[
'R'
,
'G'
,
'B'
,
'W'
]
for
i
in
range
(
len
(
numbers_text
)):
ProgressBar
(
stdscr
,
row
=
0
,
col
=
i
*
8
,
width
=
5
,
height
=
12
,
text
=
numbers_text
[
i
]).
draw
()
progress_bars
=
[
ProgressBar
(
stdscr
,
row
=
0
,
col
=
i
*
8
,
width
=
5
,
height
=
12
,
max_value
=
255
,
prev_key
=
'KEY_DOWN'
,
next_key
=
'KEY_UP'
,
text
=
numbers_text
[
i
])
for
i
in
range
(
len
(
numbers_text
))]
numbers
=
[
NumberRange
(
stdscr
,
...
...
@@ -251,7 +259,9 @@ def main(stdscr):
row
=
12
,
value
=
i
,
prev_key
=
'KEY_DOWN'
,
next_key
=
'KEY_UP'
)
for
i
in
range
(
4
)]
next_key
=
'KEY_UP'
)
for
i
in
range
(
len
(
numbers_text
))]
fs_pbn
=
[
FocusSwitcher
(
i
)
for
i
in
zip
(
numbers
,
progress_bars
)]
fs_n
=
FocusSwitcher
(
fs_pbn
,
prev_key
=
'KEY_LEFT'
,
next_key
=
'KEY_RIGHT'
)
checkboxes
=
[
CheckBox
(
...
...
@@ -261,8 +271,8 @@ def main(stdscr):
toggle_key
=
' '
,
text
=
'ESP'
+
str
(
i
))
for
i
in
range
(
1
,
9
)]
fs_n
=
FocusSwitcher
(
numbers
,
prev_key
=
'KEY_LEFT'
,
next_key
=
'KEY_RIGHT'
)
fs_cb
=
FocusSwitcher
(
checkboxes
,
prev_key
=
'KEY_UP'
,
next_key
=
'KEY_DOWN'
)
fs_main
=
FocusSwitcher
([
fs_n
,
fs_cb
],
prev_key
=
'
\t
'
)
fs_main
.
toggle_focus
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment