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
PR-Baby-A18
Babyfut
Commits
1c83eca5
Commit
1c83eca5
authored
Oct 26, 2018
by
Antoine Lima
Browse files
Fixed exessive keyboard grab
parent
35fca230
Changes
2
Hide whitespace changes
Inline
Side-by-side
main.py
View file @
1c83eca5
...
...
@@ -48,7 +48,7 @@ class MainWin(QtWidgets.QMainWindow):
self
.
ui
.
panels
.
setCurrentIndex
(
0
)
self
.
ui
.
panels
.
currentWidget
().
setFocus
()
self
.
ui
.
panels
.
currentWidget
()
.
grabKeyboard
(
)
self
.
ui
.
panels
.
setFocusProxy
(
self
.
ui
.
panels
.
currentWidget
())
self
.
ui
.
panels
.
currentWidget
().
load
()
self
.
displaySystemTime
()
self
.
startTimer
(
1000
)
...
...
module.py
View file @
1c83eca5
...
...
@@ -32,19 +32,20 @@ class Module(QtWidgets.QWidget):
logging
.
error
(
'Unknown panel {}'
.
format
(
new_type
))
else
:
# Unfocus the current module
self
.
mainwin
.
ui
.
panels
.
currentWidget
().
releaseKeyboard
()
if
QApplication
.
focusWidget
()
!=
None
:
QApplication
.
focusWidget
().
clearFocus
()
# Swap modules by unloading, changing the ui then loading
self
.
mainwin
.
modules
[
curmod_idx
].
unload
()
self
.
mainwin
.
ui
.
panels
.
setCurrentIndex
(
newmod_idx
)
self
.
mainwin
.
ui
.
panels
.
setFocusProxy
(
self
.
mainwin
.
modules
[
newmod_idx
])
self
.
mainwin
.
modules
[
newmod_idx
].
setFocus
()
self
.
mainwin
.
modules
[
newmod_idx
].
load
()
# Select first element of the Module
self
.
mainwin
.
modules
[
newmod_idx
].
focusNextChild
()
self
.
mainwin
.
modules
[
newmod_idx
].
focusPreviousChild
()
self
.
mainwin
.
modules
[
newmod_idx
].
grabKeyboar
d
()
self
.
mainwin
.
modules
[
newmod_idx
].
focusPreviousChil
d
()
def
send
(
self
,
to
,
**
kwargs
):
mod_idx
=
self
.
mainwin
.
findMod
(
to
)
...
...
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