Added detect screen resolution function
parent
2e68a5eaf2
commit
2f6b1a8a33
|
@ -3,6 +3,8 @@ import os
|
|||
|
||||
from tape_editor_widgets import *
|
||||
|
||||
from PIL import ImageGrab
|
||||
|
||||
from pathlib import Path
|
||||
import yaml
|
||||
|
||||
|
@ -41,6 +43,7 @@ class OptionsWidget(QWidget):
|
|||
self.height_spinbox.setValue(1080)
|
||||
|
||||
self.detect_pushbutton = QPushButton("Detect screen resolution")
|
||||
self.detect_pushbutton.clicked.connect(self.update_screen_res)
|
||||
|
||||
self.resolution_hbox = QVBoxLayout()
|
||||
self.resolution_hbox.addWidget(self.width_spinbox)
|
||||
|
@ -96,6 +99,11 @@ class OptionsWidget(QWidget):
|
|||
|
||||
# def update_label_description(self):
|
||||
|
||||
def update_screen_res(self):
|
||||
img = ImageGrab.grab()
|
||||
self.width_spinbox.setValue(img.size[0])
|
||||
self.height_spinbox.setValue(img.size[1])
|
||||
|
||||
|
||||
# TODO: implement random local mod name
|
||||
|
||||
|
|
Loading…
Reference in New Issue