From cc8fcd9bade20740212a6dd1c408e08dcc2c02fb Mon Sep 17 00:00:00 2001 From: Fan Jiang Date: Wed, 14 Feb 2024 19:38:16 -0500 Subject: [PATCH] Add screenshot capture and about window functionality --- README.md | 2 ++ standalone_app/Snap2LaTeX.py | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9229eba..3e1e2a8 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ Click on it and select "Capture" to capture a screenshot of the equation. The ap ![](./images/screenshot.png) +Double click on the LaTeX code and right click to copy. + # Build ```bash diff --git a/standalone_app/Snap2LaTeX.py b/standalone_app/Snap2LaTeX.py index fae8ac6..57e6b75 100644 --- a/standalone_app/Snap2LaTeX.py +++ b/standalone_app/Snap2LaTeX.py @@ -31,7 +31,8 @@ # Create the icon from os import path - path_to_icon = path.abspath(path.join(path.dirname(__file__), 'icon.png')) + + path_to_icon = path.abspath(path.join(path.dirname(__file__), "icon.png")) icon = QIcon(path_to_icon) # Create the tray @@ -101,6 +102,20 @@ def capture(): action.triggered.connect(capture) menu.addAction(action) + # Add About option to the menu + def about_window(): + dialog = QMessageBox() + dialog.setText( + """Snap2LaTeX ©2024 Fan Jiang +Snap2LaTeX is a tool that converts a picture of a mathematical equation into a LaTeX code. Model by @NormXU: https://github.com/NormXU/nougat-latex-ocr. + """ + ) + dialog.exec() + + about = QAction("About") + about.triggered.connect(about_window) + menu.addAction(about) + # Add a Quit option to the menu. quit = QAction("Quit") quit.triggered.connect(app.quit)