Skip to content

Commit

Permalink
Merge pull request #196 from FrankFrank9/patch-2
Browse files Browse the repository at this point in the history
Update Snip button on MacOs
  • Loading branch information
lukas-blecher authored Sep 25, 2022
2 parents b9274d3 + 930428c commit ffcde25
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pix2tex/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ def initUI(self):
self.tempField.setSingleStep(0.1)

# Create snip button
self.snipButton = QPushButton('Snip [Alt+S]', self)
self.snipButton.clicked.connect(self.onClick)
if sys.platform == "darwin":
self.snipButton = QPushButton('Snip [Option+S]', self)
self.snipButton.clicked.connect(self.onClick)
else:
self.snipButton = QPushButton('Snip [Alt+S]', self)
self.snipButton.clicked.connect(self.onClick)

self.shortcut = QShortcut(QKeySequence("Alt+S"), self)
self.shortcut.activated.connect(self.onClick)
Expand Down Expand Up @@ -94,7 +98,10 @@ def toggleProcessing(self, value=None):
text = 'Interrupt'
func = self.interrupt
else:
text = 'Snip [Alt+S]'
if sys.platform == "darwin":
text = 'Snip [Option+S]'
else:
text = 'Snip [Alt+S]'
func = self.onClick
self.retryButton.setEnabled(True)
self.shortcut.setEnabled(not self.isProcessing)
Expand Down

0 comments on commit ffcde25

Please sign in to comment.