[Update(tmp)] ※Dropdown Menu開きません。 Config Window: Option Menu系widgetを全てframeを使った自作widgetにすり替え。
This commit is contained in:
@@ -142,14 +142,18 @@ def createButtonWithImage(parent_widget, button_fg_color, button_enter_color, bu
|
||||
return button_wrapper
|
||||
|
||||
|
||||
def createOptionMenuBox(parent_widget, optionmenu_bg_color, optionmenu_hovered_bg_color, optionmenu_clicked_bg_color, optionmenu_ipadx, optionmenu_ipady, variable, font_family, font_size, text_color, image_file, image_size, command, optionmenu_position=None, setattr_widget=None, image_widget_attr_name=None):
|
||||
def createOptionMenuBox(parent_widget, optionmenu_bg_color, optionmenu_hovered_bg_color, optionmenu_clicked_bg_color, optionmenu_ipadx, optionmenu_ipady, variable, font_family, font_size, text_color, image_file, image_size, command, optionmenu_position=None, optionmenu_ipady_between_img=0, optionmenu_min_height=None, optionmenu_min_width=None, setattr_widget=None, image_widget_attr_name=None):
|
||||
|
||||
option_menu_box = CTkFrame(parent_widget, corner_radius=4, fg_color=optionmenu_bg_color, cursor="hand2")
|
||||
option_menu_box = CTkFrame(parent_widget, corner_radius=6, fg_color=optionmenu_bg_color, cursor="hand2")
|
||||
|
||||
option_menu_box.grid_rowconfigure(0, weight=1)
|
||||
if optionmenu_min_height is not None: option_menu_box.grid_rowconfigure(0, minsize=optionmenu_min_height)
|
||||
|
||||
option_menu_box.grid_columnconfigure(0, weight=1)
|
||||
option_menu_box.grid_rowconfigure(0, weight=1)
|
||||
if optionmenu_min_width is not None: option_menu_box.grid_columnconfigure(0, minsize=optionmenu_min_width)
|
||||
|
||||
optionmenu_label_wrapper = CTkFrame(option_menu_box, corner_radius=0, fg_color=optionmenu_bg_color)
|
||||
optionmenu_label_wrapper.grid(row=0, column=0, sticky="ew")
|
||||
optionmenu_label_wrapper.grid(row=0, column=0, padx=(optionmenu_ipadx[0],0), pady=optionmenu_ipady, sticky="ew")
|
||||
|
||||
LABEL_COLUMN=0
|
||||
if optionmenu_position == "center":
|
||||
@@ -163,7 +167,7 @@ def createOptionMenuBox(parent_widget, optionmenu_bg_color, optionmenu_hovered_b
|
||||
font=CTkFont(family=font_family, size=font_size, weight="normal"),
|
||||
text_color=text_color
|
||||
)
|
||||
optionmenu_label_widget.grid(row=0, column=LABEL_COLUMN, padx=optionmenu_ipadx, pady=optionmenu_ipady)
|
||||
optionmenu_label_widget.grid(row=0, column=LABEL_COLUMN, padx=(0, optionmenu_ipady_between_img))
|
||||
|
||||
|
||||
optionmenu_img_widget = CTkLabel(
|
||||
@@ -177,7 +181,7 @@ def createOptionMenuBox(parent_widget, optionmenu_bg_color, optionmenu_hovered_b
|
||||
if image_widget_attr_name is not None:
|
||||
setattr(setattr_widget, image_widget_attr_name, optionmenu_img_widget)
|
||||
|
||||
optionmenu_img_widget.grid(row=0, column=1, padx=0, pady=0)
|
||||
optionmenu_img_widget.grid(row=0, column=1, padx=(0, optionmenu_ipadx[1]), pady=optionmenu_ipady)
|
||||
|
||||
|
||||
bindEnterAndLeaveColor([optionmenu_label_wrapper, option_menu_box, optionmenu_label_widget, optionmenu_img_widget], optionmenu_hovered_bg_color, optionmenu_bg_color)
|
||||
|
||||
Reference in New Issue
Block a user