From 98ac2232a3aa7c88fa9a67206a54b6d07e5b85a9 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Tue, 17 Oct 2023 23:24:41 +0900 Subject: [PATCH] =?UTF-8?q?[Refactor]=20Main=20Window:=20=E3=83=A1?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E7=94=BB=E9=9D=A2=E3=82=AB=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=81=AEgeometry=E8=A8=88=E7=AE=97=E3=82=92show=E6=99=82?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vrct_gui/_CreateWindowCover.py | 16 ++++++---------- vrct_gui/vrct_gui.py | 1 - 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/vrct_gui/_CreateWindowCover.py b/vrct_gui/_CreateWindowCover.py index f86929c1..d2fc22ce 100644 --- a/vrct_gui/_CreateWindowCover.py +++ b/vrct_gui/_CreateWindowCover.py @@ -22,16 +22,6 @@ class _CreateWindowCover(CTkToplevel): self.settings = settings self._view_variable = view_variable - - self.attach_window.update_idletasks() - self.x_pos = self.attach_window.winfo_rootx() - self.y_pos = self.attach_window.winfo_rooty() - self.width_new = self.attach_window.winfo_width() - self.height_new = self.attach_window.winfo_height() - - - self.geometry("{}x{}+{}+{}".format(self.width_new, self.height_new, self.x_pos, self.y_pos)) - self.grid_rowconfigure(0,weight=1) self.grid_columnconfigure(0,weight=1) self.cover_container = CTkFrame(self, corner_radius=0, fg_color="black", width=0, height=0) @@ -53,4 +43,10 @@ class _CreateWindowCover(CTkToplevel): def show(self): self.attributes("-alpha", 0) self.deiconify() + self.attach_window.update_idletasks() + self.x_pos = self.attach_window.winfo_rootx() + self.y_pos = self.attach_window.winfo_rooty() + self.width_new = self.attach_window.winfo_width() + self.height_new = self.attach_window.winfo_height() + self.geometry("{}x{}+{}+{}".format(self.width_new, self.height_new, self.x_pos, self.y_pos)) fadeInAnimation(self, steps=5, interval=0.005, max_alpha=0.5) diff --git a/vrct_gui/vrct_gui.py b/vrct_gui/vrct_gui.py index ae3b8fcb..0c3446d6 100644 --- a/vrct_gui/vrct_gui.py +++ b/vrct_gui/vrct_gui.py @@ -132,7 +132,6 @@ class VRCT_GUI(CTk): def _openConfigWindow(self, _e): callFunctionIfCallable(self._view_variable.CALLBACK_OPEN_CONFIG_WINDOW) - self._adjustToMainWindowGeometry() self.main_window_cover.show() self.BIND_CONFIGURE_ADJUSTED_GEOMETRY_FUNC_ID = self.bind("", self._adjustToMainWindowGeometry, "+")