[Update] 設定画面から透明度変更時に、メイン画面のカバーを一時的に外すように。

スライダークリック時(ドラッグ時)にカバーを外し、リリース時に戻す。
リリースはCTkSlider側で設定されていないのでうまくいくけど、
CTkSliderはbind ButtonPress(クリック)はオーバーライドされるので引数command(クリックイベント)に無理やり挟み込み。
This commit is contained in:
Sakamoto Shiina
2023-10-13 13:41:10 +09:00
parent 77500adb8d
commit 508cca8215
3 changed files with 26 additions and 3 deletions

11
view.py
View File

@@ -156,6 +156,8 @@ class View():
SLIDER_RANGE_TRANSPARENCY=(50, 100),
CALLBACK_SET_TRANSPARENCY=None,
VAR_TRANSPARENCY=IntVar(value=config.TRANSPARENCY),
CALLBACK_BUTTON_PRESS_TRANSPARENCY=self._closeTheCoverOfMainWindow,
CALLBACK_BUTTON_RELEASE_TRANSPARENCY=self._openTheCoverOfMainWindow,
VAR_LABEL_APPEARANCE_THEME=StringVar(value=i18n.t("config_window.appearance_theme.label")),
VAR_DESC_APPEARANCE_THEME=StringVar(value=i18n.t("config_window.appearance_theme.desc")),
@@ -539,6 +541,15 @@ class View():
vrct_gui.attributes("-topmost", False)
@staticmethod
def _openTheCoverOfMainWindow():
vrct_gui.modal_window.show()
vrct_gui.config_window.lift()
@staticmethod
def _closeTheCoverOfMainWindow():
vrct_gui.modal_window.withdraw()
def enableMainWindowSidebarCompactMode(self):
self.view_variable.IS_MAIN_WINDOW_SIDEBAR_COMPACT_MODE = True
vrct_gui._enableMainWindowSidebarCompactMode()