Skip to content

Commit 67e0235

Browse files
committed
pref(window): 仅主窗口加载图标
- 移除 _configure_ui 中的默认图标加载逻辑 - 将默认图标加载逻辑移至 _configure_ui_withdraw 中 - 优化代码结构,提高可读性和可维护性
1 parent 778d520 commit 67e0235

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/vcf_generator_lite/window/base/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,11 @@ def __init__(self):
3838
self._configure_ui()
3939

4040
def _configure_ui_withdraw(self):
41-
self.__apply_default_icon()
4241
self.__apply_default_events()
4342

4443
def _configure_ui(self):
4544
self.center()
4645

47-
def __apply_default_icon(self):
48-
_logger.debug(f"窗口 {self.winfo_name()} 默认图标为 icon-48.png")
49-
self.iconphoto(True, PhotoImage(master=self, data=resources.read_binary("images/icon-48.png")))
50-
5146
def __apply_default_events(self):
5247
self.protocol("WM_DELETE_WINDOW", lambda: self.event_generate(EVENT_EXIT))
5348
self.bind(EVENT_EXIT, lambda _: self.destroy())
@@ -66,6 +61,10 @@ def _configure_ui_withdraw(self):
6661
if not self._theme_applied:
6762
self.set_theme(create_platform_theme())
6863
super()._configure_ui_withdraw()
64+
self.__apply_default_icon()
65+
66+
def __apply_default_icon(self):
67+
self.iconphoto(True, PhotoImage(master=self, data=resources.read_binary("images/icon-48.png")))
6968

7069
def set_theme(self, theme: Theme):
7170
theme.apply_theme(self, Style(self))

0 commit comments

Comments
 (0)