Skip to content

Commit

Permalink
set prompt width and height after initial display; set prompt minimum…
Browse files Browse the repository at this point in the history
… and maximum size using initial width and height values
  • Loading branch information
ryanolton authored and gustavo-iniguez-goya committed Nov 4, 2021
1 parent 34911f6 commit 4224fd7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ui/opensnitch/dialogs/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def __init__(self, parent=None):
self._cfg = Config.get()
self.setupUi(self)

self._width = self.width()
self._height = self.height()
self._width = None
self._height = None

dialog_geometry = self._cfg.getSettings("promptDialog/geometry")
if dialog_geometry == QtCore.QByteArray:
Expand Down Expand Up @@ -106,6 +106,12 @@ def __init__(self, parent=None):
def showEvent(self, event):
super(PromptDialog, self).showEvent(event)
self.activateWindow()

if self._width is None or self._height is None:
self._width = self.width()
self._height = self.height()

self.setMinimumSize(self._width, self._height)
self.setMaximumSize(self._width, self._height)
self.move_popup()

Expand Down

0 comments on commit 4224fd7

Please sign in to comment.