Skip to content

Commit

Permalink
issue #93
Browse files Browse the repository at this point in the history
Fix the issue when the wrong height is in geometry string applied (now the actual height is always used)
  • Loading branch information
pozitronik committed Dec 26, 2023
1 parent a533b7b commit 7057b8d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions sinner/gui/GUIForm.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ def __init__(self, parameters: Namespace):
# self.GUIWindow.iconphoto(True, PhotoImage(file=get_app_dir("sinner/gui/icons/sinner_64.png"))) # the taskbar icon may not be changed due tkinter limitations
self.GUIWindow.title('sinner controls')
self.GUIWindow.minsize(500, 0)
if self.geometry:
self.GUIWindow.geometry(self.geometry)
if self.state:
self.GUIWindow.wm_state(self.state)
self.GUIWindow.protocol('WM_DELETE_WINDOW', lambda: on_player_window_close())

def on_player_window_close() -> None:
Expand Down Expand Up @@ -232,6 +228,16 @@ def show(self) -> CTk:
self.GUIModel.update_preview()
self.GUIWindow.wm_attributes("-topmost", self.topmost)
self.GUIModel.Player.set_topmost()
if self.geometry:
self.GUIWindow.update()
self.GUIWindow.update_idletasks()
current_size_part, _ = self.GUIWindow.geometry().split('+', 1)
current_height = int(current_size_part.split('x')[1])
size_part, position_part = self.geometry.split('+', 1)
requested_width = int(size_part.split('x')[0])
self.GUIWindow.geometry(f"{requested_width}x{current_height}+{position_part}")
if self.state:
self.GUIWindow.wm_state(self.state)
return self.GUIWindow

def change_source(self) -> bool:
Expand Down

0 comments on commit 7057b8d

Please sign in to comment.