Files
VRCT/vrct_gui/config_window/ConfigWindow.py
Sakamoto Shiina 53cb8d9088 [Update] Config Window:
エラーメッセージ表示機能(メッセージ内容は仮置き): バリデーションにより無効な値を入力した場合にエラーメッセージを表示。エラーメッセージは新しくWindowを作って被せる形にしています。他の部分をクリックしたり、ホイールによるスクロールなどで画面外へいった時に消したりなどの処理も実装。

Entry Widget系フォーカスアウト機能:そのWidget外をクリックした時にちゃんとフォーカスアウトし、その際にconfigに保存されている有効な値をセット。
(今のところTranscription項目内のEntry Widgetがある項目のみ)

[bugfix] Main Window: Modal Windowのevent unbindに、ちゃんとIDを指定してunbindするように。(vrct_gui.py line 90)
2023-10-05 10:51:15 +09:00

37 lines
1.3 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.title("Settings")
self.geometry(f"{1080}x{680}")
self.configure(fg_color="#ff7f50")
self.protocol("WM_DELETE_WINDOW", vrct_gui.closeConfigWindow)
self.settings = settings
self._view_variable = view_variable
# 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)
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(), "+")