Skip to content

Commit

Permalink
Merge pull request #1634 from janezd/focus-adjustments
Browse files Browse the repository at this point in the history
Focus adjustments
  • Loading branch information
kernc authored Oct 7, 2016
2 parents 3668622 + 63355d2 commit 97863cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions Orange/widgets/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,7 @@ def __textEdited(self):
self.__changed = True

def returnPressedHandler(self):
self.clearFocus()
if self.__changed:
self.__changed = False
if hasattr(self, "cback") and self.cback:
Expand Down
3 changes: 3 additions & 0 deletions Orange/widgets/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ def __new__(cls, *args, captionTitle=None, **kwargs):

sc = QShortcut(QKeySequence.Copy, self)
sc.activated.connect(self.copy_to_clipboard)
if self.controlArea is not None:
# Otherwise, the first control has focus
self.controlArea.setFocus(Qt.ActiveWindowFocusReason)
return self

# pylint: disable=super-init-not-called
Expand Down

0 comments on commit 97863cf

Please sign in to comment.