Skip to content

Commit d0f541d

Browse files
committed
feat(tray_animation): added a constant preview to the display battery, and simplified the logic of preview settings
1 parent 1a5699c commit d0f541d

File tree

1 file changed

+4
-26
lines changed

1 file changed

+4
-26
lines changed

src/window_procedure/window_menus.c

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,35 +34,13 @@ extern BOOL CLOCK_HOLOGRAPHIC_EFFECT;
3434
* ============================================================================ */
3535

3636
BOOL DispatchMenuPreview(HWND hwnd, UINT menuId) {
37-
if (menuId == CLOCK_IDM_ANIMATIONS_USE_LOGO) {
38-
StartAnimationPreview("__logo__");
37+
/* Handle all animations (builtin + custom) via unified lookup */
38+
char animName[MAX_PATH];
39+
if (GetAnimationNameFromMenuId(menuId, animName, sizeof(animName))) {
40+
StartAnimationPreview(animName);
3941
return TRUE;
4042
}
4143

42-
if (menuId == CLOCK_IDM_ANIMATIONS_USE_CPU) {
43-
StartAnimationPreview("__cpu__");
44-
return TRUE;
45-
}
46-
47-
if (menuId == CLOCK_IDM_ANIMATIONS_USE_MEM) {
48-
StartAnimationPreview("__mem__");
49-
return TRUE;
50-
}
51-
52-
if (menuId == CLOCK_IDM_ANIMATIONS_USE_NONE) {
53-
StartAnimationPreview("__none__");
54-
return TRUE;
55-
}
56-
57-
if (menuId >= CLOCK_IDM_ANIMATIONS_BASE && menuId < CLOCK_IDM_ANIMATIONS_END) {
58-
char animName[MAX_PATH];
59-
if (GetAnimationNameFromMenuId(menuId, animName, sizeof(animName))) {
60-
StartAnimationPreview(animName);
61-
return TRUE;
62-
}
63-
return FALSE;
64-
}
65-
6644
if (menuId >= CMD_FONT_SELECTION_BASE && menuId < CMD_FONT_SELECTION_END) {
6745
char fontPath[MAX_PATH];
6846
if (GetFontPathFromMenuId(menuId, fontPath, sizeof(fontPath))) {

0 commit comments

Comments
 (0)