Skip to content

Commit

Permalink
Resize configuration window to active screen
Browse files Browse the repository at this point in the history
  • Loading branch information
vtvrv authored and Acly committed Dec 15, 2023
1 parent 45bb882 commit 332204a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ai_diffusion/ui/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
QAction,
)
from PyQt5.QtCore import Qt, QSize, QUrl, pyqtSignal
from PyQt5.QtGui import QDesktopServices, QGuiApplication, QIcon
from PyQt5.QtGui import QDesktopServices, QGuiApplication, QIcon, QCursor
from krita import Krita

from ..resources import CustomNode, MissingResource, ResourceKind, required_models
Expand Down Expand Up @@ -1056,7 +1056,7 @@ def __init__(self, server: Server):

self.setWindowTitle("Configure Image Diffusion")
self.setMinimumSize(QSize(840, 480))
if screen := QGuiApplication.primaryScreen():
if screen := QGuiApplication.screenAt(QCursor.pos()):
size = screen.availableSize()
self.resize(QSize(max(900, int(size.width() * 0.6)), int(size.height() * 0.8)))

Expand Down

0 comments on commit 332204a

Please sign in to comment.