Skip to content

Commit

Permalink
chore:layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Guovin committed Nov 15, 2024
1 parent 2754b45 commit 9249970
Showing 1 changed file with 29 additions and 23 deletions.
52 changes: 29 additions & 23 deletions tkinter_ui/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def init_ui(self, root):
frame_default_channel_column1, text="频道接口数量:", width=12
)
self.urls_limit_label.pack(side=tk.LEFT, padx=4, pady=8)
self.urls_limit_entry = tk.Entry(frame_default_channel_column1)
self.urls_limit_entry = tk.Entry(frame_default_channel_column1, width=8)
self.urls_limit_entry.pack(side=tk.LEFT, padx=4, pady=8)
self.urls_limit_entry.insert(0, config.urls_limit)
self.urls_limit_entry.bind("<KeyRelease>", self.update_urls_limit)
Expand All @@ -150,7 +150,7 @@ def init_ui(self, root):
frame_default_channel_column2, text="接口协议类型:", width=12
)
self.ipv_type_label.pack(side=tk.LEFT, padx=4, pady=8)
self.ipv_type_combo = ttk.Combobox(frame_default_channel_column2)
self.ipv_type_combo = ttk.Combobox(frame_default_channel_column2, width=5)
self.ipv_type_combo.pack(side=tk.LEFT, padx=4, pady=8)
self.ipv_type_combo["values"] = ("IPv4", "IPv6", "全部")
if config.ipv_type == "ipv4":
Expand All @@ -161,22 +161,16 @@ def init_ui(self, root):
self.ipv_type_combo.current(2)
self.ipv_type_combo.bind("<<ComboboxSelected>>", self.update_ipv_type)

frame_default_sort = tk.Frame(root)
frame_default_sort.pack(fill=tk.X)
frame_default_sort_column1 = tk.Frame(frame_default_sort)
frame_default_sort_column1.pack(side=tk.LEFT, fill=tk.Y)
frame_default_sort_column2 = tk.Frame(frame_default_sort)
frame_default_sort_column2.pack(side=tk.LEFT, fill=tk.Y)
frame_default_sort_column3 = tk.Frame(frame_default_sort)
frame_default_sort_column3.pack(side=tk.RIGHT, fill=tk.Y)
frame_default_open_keep_all = tk.Frame(root)
frame_default_open_keep_all.pack(fill=tk.X)

self.open_keep_all_label = tk.Label(
frame_default_sort_column1, text="保留模式:", width=12
frame_default_open_keep_all, text="保留模式:", width=12
)
self.open_keep_all_label.pack(side=tk.LEFT, padx=4, pady=8)
self.open_keep_all_var = tk.BooleanVar(value=config.open_keep_all)
self.open_keep_all_checkbutton = ttk.Checkbutton(
frame_default_sort_column1,
frame_default_open_keep_all,
variable=self.open_keep_all_var,
onvalue=True,
offvalue=False,
Expand All @@ -185,13 +179,20 @@ def init_ui(self, root):
)
self.open_keep_all_checkbutton.pack(side=tk.LEFT, padx=4, pady=8)

frame_default_sort = tk.Frame(root)
frame_default_sort.pack(fill=tk.X)
frame_default_sort_column1 = tk.Frame(frame_default_sort)
frame_default_sort_column1.pack(side=tk.LEFT, fill=tk.Y)
frame_default_sort_column2 = tk.Frame(frame_default_sort)
frame_default_sort_column2.pack(side=tk.RIGHT, fill=tk.Y)

self.open_sort_label = tk.Label(
frame_default_sort_column2, text="测速排序:", width=12
frame_default_sort_column1, text="测速排序:", width=12
)
self.open_sort_label.pack(side=tk.LEFT, padx=4, pady=8)
self.open_sort_var = tk.BooleanVar(value=config.open_sort)
self.open_sort_checkbutton = ttk.Checkbutton(
frame_default_sort_column2,
frame_default_sort_column1,
variable=self.open_sort_var,
onvalue=True,
offvalue=False,
Expand All @@ -200,10 +201,10 @@ def init_ui(self, root):
self.open_sort_checkbutton.pack(side=tk.LEFT, padx=4, pady=8)

self.sort_timeout_label = tk.Label(
frame_default_sort_column3, text="测速超时:", width=12
frame_default_sort_column2, text="测速超时:", width=12
)
self.sort_timeout_label.pack(side=tk.LEFT, padx=4, pady=8)
self.sort_timeout_entry = tk.Entry(frame_default_sort_column3)
self.sort_timeout_entry = tk.Entry(frame_default_sort_column2, width=8)
self.sort_timeout_entry.pack(side=tk.LEFT, padx=4, pady=8)
self.sort_timeout_entry.insert(0, config.sort_timeout)
self.sort_timeout_entry.bind("<KeyRelease>", self.update_sort_timeout)
Expand Down Expand Up @@ -241,7 +242,7 @@ def init_ui(self, root):
onvalue=True,
offvalue=False,
command=self.update_open_m3u_result,
text="(支持频道图标)",
text="(开启频道图标)",
)
self.open_m3u_result_checkbutton.pack(side=tk.LEFT, padx=4, pady=8)

Expand Down Expand Up @@ -277,7 +278,9 @@ def init_ui(self, root):
frame_default_resolution_params_column2, text="最小分辨率:", width=12
)
self.min_resolution_label.pack(side=tk.LEFT, padx=4, pady=8)
self.min_resolution_entry = tk.Entry(frame_default_resolution_params_column2)
self.min_resolution_entry = tk.Entry(
frame_default_resolution_params_column2, width=10
)
self.min_resolution_entry.pack(side=tk.LEFT, padx=4, pady=8)
self.min_resolution_entry.insert(0, config.min_resolution)
self.min_resolution_entry.bind("<KeyRelease>", self.update_min_resolution)
Expand Down Expand Up @@ -345,26 +348,29 @@ def init_ui(self, root):
self.open_update_time_checkbutton.pack(side=tk.LEFT, padx=4, pady=8)

self.open_url_info_label = tk.Label(
frame_default_open_update_info_column1, text="显示接口信息:", width=12
frame_default_open_update_info_column2, text="显示接口信息:", width=12
)
self.open_url_info_label.pack(side=tk.LEFT, padx=4, pady=8)
self.open_url_info_var = tk.BooleanVar(value=config.open_url_info)
self.open_url_info_checkbutton = ttk.Checkbutton(
frame_default_open_update_info_column1,
frame_default_open_update_info_column2,
variable=self.open_url_info_var,
onvalue=True,
offvalue=False,
command=self.update_open_url_info,
)
self.open_url_info_checkbutton.pack(side=tk.LEFT, padx=4, pady=8)

frame_default_open_empty_category = tk.Frame(root)
frame_default_open_empty_category.pack(fill=tk.X)

self.open_empty_category_label = tk.Label(
frame_default_open_update_info_column2, text="无结果频道分类:", width=12
frame_default_open_empty_category, text="显示无结果分类:", width=12
)
self.open_empty_category_label.pack(side=tk.LEFT, padx=4, pady=8)
self.open_empty_category_var = tk.BooleanVar(value=config.open_empty_category)
self.open_empty_category_checkbutton = ttk.Checkbutton(
frame_default_open_update_info_column2,
frame_default_open_empty_category,
variable=self.open_empty_category_var,
onvalue=True,
offvalue=False,
Expand All @@ -380,7 +386,7 @@ def init_ui(self, root):
)
self.url_keywords_blacklist_label.pack(side=tk.LEFT, padx=4, pady=8)
self.url_keywords_blacklist_text = scrolledtext.ScrolledText(
frame_default_url_keywords_blacklist, height=2
frame_default_url_keywords_blacklist, height=5
)
self.url_keywords_blacklist_text.pack(
side=tk.LEFT, padx=4, pady=8, expand=True, fill=tk.BOTH
Expand Down

0 comments on commit 9249970

Please sign in to comment.