Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds wordwrap and text selectability for messages and replies #1050

Closed
wants to merge 17 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
type annotations: event handlers on SecureQPlainTextEdit
  • Loading branch information
redshiftzero committed Apr 21, 2020
commit 3f8db24e74208c852c1f14e5462699f1c4ee2dc2
6 changes: 3 additions & 3 deletions securedrop_client/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from PyQt5.QtWidgets import QLabel, QHBoxLayout, QPlainTextEdit, QPushButton, QWidget
from PyQt5.QtCore import QSize, Qt
from PyQt5.QtGui import QFont
from PyQt5.QtGui import QFocusEvent, QFont, QMouseEvent

from securedrop_client.resources import load_svg, load_icon

Expand Down Expand Up @@ -244,11 +244,11 @@ def setPlainText(self, text: str) -> None:
self.height = self.HEIGHT_BASE + (document_lines * self.LINE_HEIGHT)
self.setFixedHeight(self.height)

def mouseReleaseEvent(self, event):
def mouseReleaseEvent(self, event: QMouseEvent) -> None:
self.setFocus()
super().mouseReleaseEvent(event)

def focusOutEvent(self, event):
def focusOutEvent(self, event: QFocusEvent) -> None:
clear_text_cursor = self.textCursor()
clear_text_cursor.clearSelection()
self.setTextCursor(clear_text_cursor)
Expand Down