[bugfix] Main Window: Main Window Cover: UI崩壊修正続き。SetProcessDpiAwareness 1 -> 0

[bugfix] 設定画面を開いた時にカバーするWindowがずれるのを修正するため、メイン画面を移動した時に毎回lift(最前面に表示)する機能を削除。
[Update] Main Window: ウィンドウサイズの幅を縮めた時に、テキストボックスのサイズが一定以上縮まず、ログが折り返されなかったので、折り返されるように改善。それにより幅固定を外したので、起動時にgeometryを指定するなどしている。
※上記相互に影響しているためまとめて編集しました。
This commit is contained in:
Sakamoto Shiina
2023-10-16 10:09:59 +09:00
parent 465f9f9628
commit 16cac0d557
5 changed files with 19 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
import ctypes
ctypes.windll.shcore.SetProcessDpiAwareness(1)
ctypes.windll.shcore.SetProcessDpiAwareness(0)
from vrct_gui.splash_window import SplashWindow
splash = SplashWindow()

View File

@@ -11,17 +11,23 @@ def createMainWindowWidgets(vrct_gui, settings, view_variable):
vrct_gui.iconbitmap(getImagePath("vrct_logo_mark_black.ico"))
vrct_gui.title("VRCT")
vrct_gui.minsize(200, 200)
# vrct_gui.minsize(200, 200)
# Main Container
vrct_gui.grid_columnconfigure(1, weight=1, minsize=settings.uism.MAIN_AREA_MIN_WIDTH)
vrct_gui.grid_columnconfigure(0, weight=1)
vrct_gui.grid_rowconfigure(0, weight=1)
# vrct_gui.grid_columnconfigure(0, weight=1, minsize=settings.uism.MAIN_AREA_MIN_WIDTH)
vrct_gui.configure(fg_color="#ff7f50")
vrct_gui.toplevel_wrapper = CTkFrame(vrct_gui, corner_radius=0, fg_color=settings.ctm.MAIN_BG_COLOR, width=0, height=0)
vrct_gui.toplevel_wrapper.grid(row=0, column=0, sticky="nsew")
vrct_gui.toplevel_wrapper.grid_columnconfigure(1, weight=1)
# Main Container
vrct_gui.main_bg_container = CTkFrame(vrct_gui, corner_radius=0, fg_color=settings.ctm.MAIN_BG_COLOR, width=0, height=0)
vrct_gui.main_bg_container = CTkFrame(vrct_gui.toplevel_wrapper, corner_radius=0, fg_color=settings.ctm.MAIN_BG_COLOR, width=0, height=0)
vrct_gui.main_bg_container.grid(row=0, column=1, sticky="nsew")

View File

@@ -6,9 +6,9 @@ from ._create_sidebar import createSidebarFeatures, createSidebarLanguagesSettin
def createSidebar(settings, main_window, view_variable):
# Side Bar Container
main_window.grid_rowconfigure(0, weight=1)
main_window.toplevel_wrapper.grid_rowconfigure(0, weight=1)
main_window.sidebar_bg_container_wrapper = CTkFrame(main_window, corner_radius=0, fg_color=settings.ctm.SIDEBAR_BG_COLOR, width=0, height=0)
main_window.sidebar_bg_container_wrapper = CTkFrame(main_window.toplevel_wrapper, corner_radius=0, fg_color=settings.ctm.SIDEBAR_BG_COLOR, width=0, height=0)
main_window.sidebar_bg_container_wrapper.grid(row=0, column=0, sticky="nsew")
@@ -16,7 +16,7 @@ def createSidebar(settings, main_window, view_variable):
main_window.sidebar_compact_mode_bg_container = CTkFrame(main_window.sidebar_bg_container_wrapper, corner_radius=0, fg_color=settings.ctm.SIDEBAR_BG_COLOR, width=0, height=0)
main_window.sidebar_bg_container.grid_columnconfigure(0, weight=1)
main_window.sidebar_bg_container.grid_columnconfigure(0, weight=1, minsize=settings.uism.SIDEBAR_MIN_WIDTH)
main_window.sidebar_compact_mode_bg_container.grid_columnconfigure(0, weight=1)

View File

@@ -29,6 +29,7 @@ class UiScalingManager():
# Main
self.main.MAIN_AREA_MIN_WIDTH = self._calculateUiSize(640)
self.main.SIDEBAR_MIN_WIDTH = self._calculateUiSize(230)
self.main.TEXTBOX_PADX = self._calculateUiSize(16)
self.main.TEXTBOX_CORNER_RADIUS = self._calculateUiSize(6)

View File

@@ -19,7 +19,6 @@ class VRCT_GUI(CTk):
def __init__(self):
super().__init__()
self.withdraw()
self.adjusted_event=None
self.is_config_window_already_opened_once=False
self.BIND_CONFIGURE_ADJUSTED_GEOMETRY_FUNC_ID=None
self.BIND_FOCUS_IN_MODAL_WINDOW_LIFT_CONFIG_WINDOW_FUNC_ID=None
@@ -45,6 +44,10 @@ class VRCT_GUI(CTk):
def _showGUI(self):
self.attributes("-alpha", 0)
self.deiconify()
self.geometry("{}x{}".format(
self.settings.main.uism.MAIN_AREA_MIN_WIDTH + self.settings.main.uism.SIDEBAR_MIN_WIDTH,
self.winfo_height()
))
setGeometryToCenterOfScreen(root_widget=self)
if self._view_variable.IS_MAIN_WINDOW_SIDEBAR_COMPACT_MODE is True:
self._enableMainWindowSidebarCompactMode()
@@ -94,7 +97,7 @@ class VRCT_GUI(CTk):
)
self.main_window_cover = _CreateWindowCover(
attach_window=self,
attach_window=self.toplevel_wrapper,
settings=self.settings.main_window_cover,
view_variable=self._view_variable
)
@@ -266,18 +269,6 @@ class VRCT_GUI(CTk):
self.main_window_cover.geometry("{}x{}+{}+{}".format(width_new, height_new, x_pos, y_pos))
self.main_window_cover.lift()
if self.adjusted_event == str(e):
self.after(150, lambda: self.config_window.lift())
elif self.adjusted_event is None:
self.after(150, lambda: self.config_window.lift())
else:
pass
self.config_window.focus_set()
if e is not None:
self.adjusted_event=str(e)
def _showErrorMessage(self, target_widget):
self.error_message_window.show(target_widget=target_widget)