[Update] Config Window: UI Size変更対応(指定していたものは全て対応したはず)。コンパクトモードのラベル日本語対応。
[Refactor] CTkScrollableFrameを使用しているwidgetのUI Size変更対応やCTKのheight bug修正をui_utils.pyへ関数切り出し。
This commit is contained in:
@@ -13,7 +13,7 @@ def _createSettingBoxCompactModeButton(parent_widget, config_window, settings, v
|
||||
|
||||
|
||||
config_window.setting_box_compact_mode_button_container = CTkFrame(parent_widget, corner_radius=0, fg_color=settings.ctm.TOP_BAR_BG_COLOR, width=0, height=0)
|
||||
config_window.setting_box_compact_mode_button_container.grid(row=0, column=1, padx=(0, 20), sticky="nsw")
|
||||
config_window.setting_box_compact_mode_button_container.grid(row=0, column=1, padx=settings.uism.COMPACT_MODE_PADX, sticky="nsw")
|
||||
|
||||
|
||||
|
||||
@@ -26,12 +26,13 @@ def _createSettingBoxCompactModeButton(parent_widget, config_window, settings, v
|
||||
config_window.setting_box_compact_mode_label = CTkLabel(
|
||||
config_window.setting_box_compact_mode_button_container,
|
||||
height=0,
|
||||
text="Compact Mode",
|
||||
# text="Compact Mode",
|
||||
textvariable=view_variable.VAR_CONFIG_WINDOW_COMPACT_MODE_LABEL,
|
||||
anchor="w",
|
||||
font=CTkFont(family=settings.FONT_FAMILY, size=12, weight="normal"),
|
||||
font=CTkFont(family=settings.FONT_FAMILY, size=settings.uism.COMPACT_MODE_LABEL_FONT_SIZE, weight="normal"),
|
||||
text_color=settings.ctm.LABELS_TEXT_COLOR
|
||||
)
|
||||
config_window.setting_box_compact_mode_label.grid(row=0, column=0, padx=(0,10))
|
||||
config_window.setting_box_compact_mode_label.grid(row=0, column=0, padx=settings.uism.COMPACT_MODE_LABEL_PADX)
|
||||
|
||||
|
||||
|
||||
@@ -50,14 +51,14 @@ def _createSettingBoxCompactModeButton(parent_widget, config_window, settings, v
|
||||
width=0,
|
||||
# corner_radius=0,
|
||||
border_width=0,
|
||||
switch_width=40,
|
||||
switch_height=16,
|
||||
switch_width=settings.uism.COMPACT_MODE_SWITCH_WIDTH,
|
||||
switch_height=settings.uism.COMPACT_MODE_SWITCH_HEIGHT,
|
||||
onvalue=True,
|
||||
offvalue=False,
|
||||
command=switchConfigWindowCompactMode,
|
||||
# fg_color="",
|
||||
# bg_color="red",
|
||||
progress_color=settings.ctm.SB__SWITCH_BOX_ACTIVE_BG_COLOR, # SB__SWITCH_BOX_ACTIVE_BG_COLOR is for SB. change it later.
|
||||
progress_color=settings.ctm.COMPACT_MODE_SWITCH_BOX_ACTIVE_BG_COLOR,
|
||||
)
|
||||
|
||||
config_window.setting_box_compact_mode_switch_box.grid(row=0, column=0)
|
||||
@@ -30,7 +30,7 @@ def _createSettingBoxContainer(config_window, settings, view_variable, setting_b
|
||||
setting_box_row=0
|
||||
for i, setting_box_setting in enumerate(setting_box_container_settings["setting_boxes"]):
|
||||
# Top-Padding that can be container the section title
|
||||
setting_box_top_padding = CTkFrame(setting_box_container_widget, corner_radius=0, fg_color=settings.ctm.MAIN_BG_COLOR, width=0, height=60)
|
||||
setting_box_top_padding = CTkFrame(setting_box_container_widget, corner_radius=0, fg_color=settings.ctm.MAIN_BG_COLOR, width=0, height=settings.uism.SB__TOP_PADY)
|
||||
setting_box_top_padding.grid(row=setting_box_row, column=0, sticky="ew", padx=0, pady=0)
|
||||
setting_box_top_padding.grid_columnconfigure(0, weight=1)
|
||||
setting_box_row+=1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from customtkinter import CTkFrame, CTkScrollableFrame
|
||||
|
||||
from ....ui_utils import _setDefaultActiveTab
|
||||
from ....ui_utils import _setDefaultActiveTab, applyUiScalingAndFixTheBugScrollBar
|
||||
|
||||
from ._addConfigSideMenuItem import _addConfigSideMenuItem
|
||||
from ._createSettingBoxContainer import _createSettingBoxContainer
|
||||
@@ -41,6 +41,12 @@ def createSideMenuAndSettingsBoxContainers(config_window, settings, view_variabl
|
||||
config_window.main_setting_box_scrollable_container = CTkScrollableFrame(config_window.main_bg_container, corner_radius=0, fg_color=settings.ctm.MAIN_BG_COLOR)
|
||||
config_window.main_setting_box_scrollable_container.grid(row=1, column=0, sticky="nsew")
|
||||
|
||||
applyUiScalingAndFixTheBugScrollBar(
|
||||
scrollbar_widget=config_window.main_setting_box_scrollable_container,
|
||||
padx=settings.uism.SCROLLBAR_IPADX,
|
||||
width=settings.uism.SCROLLBAR_WIDTH,
|
||||
)
|
||||
|
||||
|
||||
config_window.main_setting_box_bg_wrapper = CTkFrame(config_window.main_setting_box_scrollable_container, corner_radius=0, width=0, height=0, fg_color=settings.ctm.MAIN_BG_COLOR)
|
||||
config_window.main_setting_box_bg_wrapper.grid(row=0, column=0, pady=settings.uism.SB__BOTTOM_MARGIN, sticky="n")
|
||||
|
||||
@@ -21,7 +21,7 @@ class _SettingBoxGenerator():
|
||||
setting_box_frame = CTkFrame(self.parent_widget, corner_radius=0, fg_color=self.settings.ctm.SB__BG_COLOR, width=0, height=0)
|
||||
|
||||
# "pady=(0,1)" is for bottom padding. It can be removed(override) when you do like "self.attr_name.grid(row=row, pady=0)"
|
||||
setting_box_frame.grid(column=0, padx=0, pady=(0,1), sticky="ew")
|
||||
setting_box_frame.grid(column=0, padx=0, pady=self.settings.uism.SB__FAKE_BOTTOM_BORDER_SIZE, sticky="ew")
|
||||
setting_box_frame.grid_columnconfigure(0, weight=1)
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ class _SettingBoxGenerator():
|
||||
setting_box_labels_frame,
|
||||
textvariable=for_var_label_text,
|
||||
anchor="w",
|
||||
# height=0,
|
||||
height=0,
|
||||
font=CTkFont(family=self.settings.FONT_FAMILY, size=self.settings.uism.SB__LABEL_FONT_SIZE, weight="normal"),
|
||||
text_color=self.settings.ctm.LABELS_TEXT_COLOR
|
||||
)
|
||||
@@ -66,7 +66,7 @@ class _SettingBoxGenerator():
|
||||
textvariable=for_var_desc_text,
|
||||
anchor="w",
|
||||
justify="left",
|
||||
# height=0,
|
||||
height=0,
|
||||
wraplength=int(self.settings.uism.MAIN_AREA_MIN_WIDTH / 2),
|
||||
font=CTkFont(family=self.settings.FONT_FAMILY, size=self.settings.uism.SB__DESC_FONT_SIZE, weight="normal"),
|
||||
text_color=self.settings.ctm.LABELS_DESC_TEXT_COLOR
|
||||
@@ -88,9 +88,9 @@ class _SettingBoxGenerator():
|
||||
optionmenu_bg_color=self.settings.ctm.SB__OPTIONMENU_BG_COLOR,
|
||||
optionmenu_hovered_bg_color=self.settings.ctm.SB__OPTIONMENU_HOVERED_BG_COLOR,
|
||||
optionmenu_clicked_bg_color=self.settings.ctm.SB__OPTIONMENU_CLICKED_BG_COLOR,
|
||||
optionmenu_ipadx=(8,8),
|
||||
optionmenu_ipady=2,
|
||||
optionmenu_ipady_between_img=8,
|
||||
optionmenu_ipadx=self.settings.uism.SB__OPTIONMENU_IPADX,
|
||||
optionmenu_ipady=self.settings.uism.SB__OPTIONMENU_IPADY,
|
||||
optionmenu_padx_between_img=self.settings.uism.SB__OPTIONMENU_IPADX_BETWEEN_IMG,
|
||||
optionmenu_min_height=self.settings.uism.SB__OPTIONMENU_MIN_HEIGHT,
|
||||
optionmenu_min_width=self.settings.uism.SB__OPTIONMENU_MIN_WIDTH,
|
||||
variable=variable,
|
||||
@@ -98,7 +98,7 @@ class _SettingBoxGenerator():
|
||||
font_size=self.settings.uism.SB__OPTION_MENU_FONT_SIZE,
|
||||
text_color=self.settings.ctm.LABELS_TEXT_COLOR,
|
||||
image_file=self.settings.image_file.ARROW_LEFT.rotate(90),
|
||||
image_size=(14,14),
|
||||
image_size=self.settings.uism.SB__OPTIONMENU_IMG_SIZE,
|
||||
optionmenu_clicked_command=lambda _e: self.dropdown_menu_window.show(
|
||||
dropdown_menu_widget_id=optionmenu_attr_name,
|
||||
),
|
||||
@@ -187,8 +187,12 @@ class _SettingBoxGenerator():
|
||||
def createSettingBoxSlider(self, for_var_label_text, for_var_desc_text, slider_attr_name, slider_range, command, variable, slider_number_of_steps: Union[int, None] = None):
|
||||
(setting_box_frame, setting_box_item_frame) = self._createSettingBoxFrame(for_var_label_text, for_var_desc_text)
|
||||
|
||||
# print(self.settings.uism.SB__SLIDER_WIDTH)
|
||||
# print(self.settings.uism.SB__SLIDER_HEIGHT)
|
||||
slider_widget = CTkSlider(
|
||||
setting_box_item_frame,
|
||||
width=self.settings.uism.SB__SLIDER_WIDTH,
|
||||
height=self.settings.uism.SB__SLIDER_HEIGHT,
|
||||
from_=slider_range[0],
|
||||
to=slider_range[1],
|
||||
number_of_steps=slider_number_of_steps,
|
||||
|
||||
Reference in New Issue
Block a user