Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
topydo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
topydo
Commits
d172148f
Commit
d172148f
authored
Aug 22, 2015
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't change focus with cursor keys.
I.e. from view widget to the commandline.
parent
a46cb090
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
topydo/ui/Main.py
topydo/ui/Main.py
+21
-1
No files found.
topydo/ui/Main.py
View file @
d172148f
...
...
@@ -45,6 +45,26 @@ _NEW_COLUMN = 1
_EDIT_COLUMN
=
2
_COPY_COLUMN
=
3
class
MainPile
(
urwid
.
Pile
):
"""
This subclass of Pile doesn't change focus on cursor up/down events. The
implementation was taken from its base class.
"""
def
keypress
(
self
,
p_size
,
p_key
):
if
not
self
.
contents
:
return
p_key
item_rows
=
None
if
len
(
p_size
)
==
2
:
item_rows
=
self
.
get_item_rows
(
p_size
,
focus
=
True
)
i
=
self
.
focus_position
if
self
.
selectable
():
tsize
=
self
.
get_item_size
(
p_size
,
i
,
True
,
item_rows
)
key
=
self
.
focus
.
keypress
(
tsize
,
p_key
)
if
self
.
_command_map
[
key
]
not
in
(
'cursor up'
,
'cursor down'
):
return
key
class
UIApplication
(
CLIApplicationBase
):
def
__init__
(
self
):
super
(
UIApplication
,
self
).
__init__
()
...
...
@@ -78,7 +98,7 @@ class UIApplication(CLIApplicationBase):
urwid
.
connect_signal
(
self
.
viewwidget
,
'close'
,
hide_viewwidget
)
self
.
mainwindow
=
urwid
.
Pile
([
self
.
mainwindow
=
Main
Pile
([
(
'weight'
,
1
,
self
.
columns
),
(
1
,
urwid
.
Filler
(
self
.
commandline
)),
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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