[Chore] Remove the code that is useless. and change the function getLongestText for somehow.
This commit is contained in:
@@ -132,12 +132,6 @@ class _CreateDropdownMenuWindow(CTkToplevel):
|
||||
|
||||
|
||||
|
||||
|
||||
self.dropdown_menu_values_box = CTkFrame(self.scroll_frame_container, corner_radius=0, fg_color=self.window_bg_color, width=0, height=0)
|
||||
self.dropdown_menu_values_box.grid(row=0, column=0, sticky="nsew")
|
||||
self.dropdown_menu_values_box.grid_columnconfigure(0, weight=1)
|
||||
|
||||
|
||||
self._createDropdownMenuValues(dropdown_menu_widget_id, dropdown_menu_values, command)
|
||||
|
||||
applyUiScalingAndFixTheBugScrollBar(
|
||||
|
||||
@@ -32,15 +32,14 @@ def getLatestHeight(target_widget):
|
||||
target_widget.update_idletasks()
|
||||
return target_widget.winfo_height()
|
||||
|
||||
def getLongestText(settings):
|
||||
max_length = max(len(item["text"]) for item in settings)
|
||||
def getLongestText(text_list:list):
|
||||
max_length = 0
|
||||
longest_text = ""
|
||||
|
||||
for item in settings:
|
||||
if len(item["text"]) > max_length:
|
||||
max_length = len(item["text"])
|
||||
longest_text = item["text"]
|
||||
for text in text_list:
|
||||
if len(text) > max_length:
|
||||
max_length = len(text)
|
||||
longest_text = text
|
||||
return longest_text
|
||||
|
||||
def bindEnterAndLeaveColor(target_widgets, enter_color, leave_color):
|
||||
|
||||
Reference in New Issue
Block a user