Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
flow3r
flow3r firmware
Commits
f7490f2a
Commit
f7490f2a
authored
1 year ago
by
dos
Committed by
dos
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fil3s: Scroll too long filenames into view
\o/
parent
142f92f1
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!564
fil3s: Scroll too long filenames into view
Pipeline
#9227
passed
1 year ago
Stage: check
Stage: build
Stage: deploy
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
python_payload/apps/fil3s/browser.py
+10
-1
10 additions, 1 deletion
python_payload/apps/fil3s/browser.py
with
10 additions
and
1 deletion
python_payload/apps/fil3s/browser.py
+
10
−
1
View file @
f7490f2a
import
os
import
uos
import
stat
import
math
from
st3m.goose
import
Callable
,
Generator
,
Optional
from
st3m.input
import
InputState
from
ctx
import
Context
...
...
@@ -38,6 +39,8 @@ class Browser(ActionView):
self
.
_delete_hold_time
=
1.5
self
.
_delete_require_release
=
False
self
.
_scroll_pos
=
0.0
self
.
path
=
path
self
.
selected
=
selected
self
.
navigate
=
navigate
...
...
@@ -75,13 +78,18 @@ class Browser(ActionView):
ctx
.
text
(
self
.
current_entry
[
1
])
ctx
.
font_size
=
24
ctx
.
move_to
(
0
,
20
)
ctx
.
font
=
"
Camp Font 3
"
xpos
=
0.0
if
(
width
:
=
ctx
.
text_width
(
self
.
current_entry
[
0
]))
>
220
:
xpos
=
math
.
sin
(
self
.
_scroll_pos
)
*
(
width
-
220
)
/
2
ctx
.
move_to
(
xpos
,
20
)
ctx
.
text
(
self
.
current_entry
[
0
])
def
think
(
self
,
ins
:
InputState
,
delta_ms
:
int
)
->
None
:
super
().
think
(
ins
,
delta_ms
)
self
.
_scroll_pos
+=
delta_ms
/
1000
# Handle delete petal being held down
if
ins
.
captouch
.
petals
[
0
].
pressed
:
if
not
self
.
_delete_require_release
:
...
...
@@ -222,5 +230,6 @@ class Browser(ActionView):
]
and
self
.
select_enabled
)
self
.
_scroll_pos
=
math
.
pi
/
2
self
.
_update_actions
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment