diff --git a/ui/app.ico b/ui/app.ico new file mode 100644 index 0000000..609541d Binary files /dev/null and b/ui/app.ico differ diff --git a/ui/editor.py b/ui/editor.py index 90cd252..726ea92 100644 --- a/ui/editor.py +++ b/ui/editor.py @@ -1,10 +1,19 @@ -# v3.0.0 editor.py +# v4.1.0 editor-link-click-fix-v1 import re import webbrowser -from PyQt6.QtCore import Qt, QUrl -from PyQt6.QtGui import QDesktopServices -from PyQt6.QtWidgets import QTextEdit +from PyQt6.QtCore import ( + Qt, + QUrl, +) + +from PyQt6.QtGui import ( + QDesktopServices, +) + +from PyQt6.QtWidgets import ( + QTextEdit, +) URL_PATTERN = re.compile( @@ -15,9 +24,14 @@ URL_PATTERN = re.compile( class LinkTextEdit(QTextEdit): - def mouseReleaseEvent(self, event) -> None: + def mouseReleaseEvent( + self, + event, + ) -> None: if ( - event.modifiers() + event.button() + == Qt.MouseButton.LeftButton + and event.modifiers() & Qt.KeyboardModifier.ControlModifier ): cursor = self.cursorForPosition( @@ -47,14 +61,19 @@ class LinkTextEdit(QTextEdit): ) try: - webbrowser.open(target) + webbrowser.open( + target + ) except Exception: QDesktopServices.openUrl( QUrl(target) ) + event.accept() + return - super().mouseReleaseEvent(event) - + super().mouseReleaseEvent( + event + ) \ No newline at end of file diff --git a/ui/styles.py b/ui/styles.py index 5f1bf4c..4fd3408 100644 --- a/ui/styles.py +++ b/ui/styles.py @@ -28,7 +28,7 @@ def build_stylesheet( QWidget#container {{ background: {background}; border: 1px solid {border}; - border-radius: 16px; + border-radius: 7px; }} QWidget#container:hover {{