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
8ace1840
Commit
8ace1840
authored
Jan 11, 2016
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Close console when a column/commandline receives focus through mouse press
parent
dd0d06ca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
topydo/ui/Main.py
topydo/ui/Main.py
+15
-2
No files found.
topydo/ui/Main.py
View file @
8ace1840
...
...
@@ -51,9 +51,20 @@ _INSERT_COLUMN = 4
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.
This subclass of Pile doesn't change focus on cursor up/down
/ mouse press
events. The
implementation was taken from its base class.
"""
def
__init__
(
self
,
p_widget_list
,
p_focus_item
=
None
):
urwid
.
register_signal
(
MainPile
,
[
'blur_console'
])
super
().
__init__
(
p_widget_list
,
p_focus_item
)
def
mouse_event
(
self
,
p_size
,
p_event
,
p_button
,
p_col
,
p_row
,
p_focus
):
if
self
.
focus_position
!=
2
:
urwid
.
emit_signal
(
self
,
'blur_console'
)
return
super
().
mouse_event
(
p_size
,
p_event
,
p_button
,
p_col
,
p_row
,
p_focus
)
# pylint: disable=E1102
def
keypress
(
self
,
p_size
,
p_key
):
if
not
self
.
contents
:
return
p_key
...
...
@@ -110,6 +121,8 @@ class UIApplication(CLIApplicationBase):
(
1
,
urwid
.
Filler
(
self
.
commandline
)),
])
urwid
.
connect_signal
(
self
.
mainwindow
,
'blur_console'
,
hide_console
)
# the columns should have keyboard focus
self
.
_blur_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