Files
VRCT/vrct_gui/config_window/ConfigWindow.py
Sakamoto Shiina 61ecbe1e84 [Refactor] createGUIを、createGUIとshowGUIに分割。createGUIでは画面を表示せず中身の組み立てや関数登録。showGUIで表示するように。
その他関数名変更(vrct_gui. から呼ぶ関数はすべてアンダーバーをつける。view.pyで呼ばれる関数と区別するため。)
2023-10-11 13:20:09 +09:00

37 lines
1.4 KiB
Python

from .widgets import createConfigWindowTitle, createSideMenuAndSettingsBoxContainers, createSettingBoxTopBar
from customtkinter import CTkToplevel
from ..ui_utils import getImagePath
class ConfigWindow(CTkToplevel):
def __init__(self, vrct_gui, settings, view_variable):
super().__init__()
self.withdraw()
# configure window
self.after(200, lambda: self.iconbitmap(getImagePath("vrct_logo_mark_black.ico")))
self.geometry(f"{settings.uism.DEFAULT_WIDTH}x{settings.uism.DEFAULT_HEIGHT}")
self.configure(fg_color="#ff7f50")
self.protocol("WM_DELETE_WINDOW", vrct_gui._closeConfigWindow)
self.settings = settings
self._view_variable = view_variable
self.title(self._view_variable.VAR_CONFIG_WINDOW_TITLE.get())
# When the configuration window's compact mode is turned on, it will call `grid_remove()` on each widget appended to this array. In the opposite case, `grid()` will be called.
self.additional_widgets = []
createConfigWindowTitle(config_window=self, settings=self.settings, view_variable=self._view_variable)
createSettingBoxTopBar(config_window=self, settings=self.settings, view_variable=self._view_variable)
createSideMenuAndSettingsBoxContainers(config_window=self, settings=self.settings, view_variable=self._view_variable)
self.bind_all("<Button-1>", lambda event: event.widget.focus_set(), "+")