-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgui.py
28 lines (23 loc) · 1.01 KB
/
gui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from PyQt5.QtWidgets import QMainWindow, QPushButton, QVBoxLayout, QWidget
from PyQt5.QtCore import Qt
from screenshot_capture import VSCodeTerminalScreenshotCapture
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("VSCode Terminal Screenshot Capture")
self.setGeometry(100, 100, 300, 150)
self.capture = VSCodeTerminalScreenshotCapture()
layout = QVBoxLayout()
self.toggle_button = QPushButton("Start Capturing")
self.toggle_button.clicked.connect(self.toggle_capture)
layout.addWidget(self.toggle_button)
container = QWidget()
container.setLayout(layout)
self.setCentralWidget(container)
def toggle_capture(self):
if self.toggle_button.text() == "Start Capturing":
self.capture.toggle_capture(True)
self.toggle_button.setText("Stop Capturing")
else:
self.capture.toggle_capture(False)
self.toggle_button.setText("Start Capturing")