Skip to content

Commit

Permalink
More robust way to determine initial settings dialog size
Browse files Browse the repository at this point in the history
  • Loading branch information
Acly committed Sep 16, 2023
1 parent 2ca3cf7 commit 12f446b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ai_diffusion/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Generative AI plugin for Krita using Stable Diffusion"""

__version__ = "1.0.0"
__version__ = "1.0.1"

from . import util
from .settings import Settings, Setting, settings, PerformancePreset, ServerBackend, ServerMode
Expand Down
5 changes: 3 additions & 2 deletions ai_diffusion/ui/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
QWidget,
)
from PyQt5.QtCore import Qt, QSize, QUrl, pyqtSignal
from PyQt5.QtGui import QDesktopServices
from PyQt5.QtGui import QDesktopServices, QGuiApplication
from krita import Krita

from .. import (
Expand Down Expand Up @@ -776,8 +776,9 @@ def __init__(self, main_window: QMainWindow, server: Server):

self.setWindowTitle("Configure Image Diffusion")
self.setMinimumSize(QSize(840, 480))
screen_size = QGuiApplication.primaryScreen().availableSize()
self.resize(
QSize(max(900, int(main_window.width() * 0.6)), int(main_window.height() * 0.8))
QSize(max(900, int(screen_size.width() * 0.6)), int(screen_size.height() * 0.8))
)

layout = QHBoxLayout()
Expand Down

0 comments on commit 12f446b

Please sign in to comment.