Skip to content

Commit 7112b46

Browse files
committed
fix(cli): unified the call logic of catime e to avoid the problem of black edges on the edges when entering compilation mode
1 parent e17c92a commit 7112b46

File tree

1 file changed

+3
-44
lines changed

1 file changed

+3
-44
lines changed

src/window_procedure/window_procedure.c

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "plugin/plugin_manager.h"
2727
#include "plugin/plugin_data.h"
2828
#include "markdown/markdown_interactive.h"
29+
#include "drag_scale.h" // Added this line
2930

3031
/* ============================================================================
3132
* External Declarations
@@ -297,53 +298,11 @@ void StartPomodoroTimer(HWND hwnd) {
297298
extern BOOL g_IsTransitioning;
298299

299300
void ToggleEditMode(HWND hwnd) {
300-
CLOCK_EDIT_MODE = !CLOCK_EDIT_MODE;
301-
302-
// Start transition period to hide rendering artifacts
303-
g_IsTransitioning = TRUE;
304-
SetTimer(hwnd, TIMER_ID_TRANSITION_END, 50, NULL);
305-
306301
if (CLOCK_EDIT_MODE) {
307-
PREVIOUS_TOPMOST_STATE = CLOCK_WINDOW_TOPMOST;
308-
309-
// 1. Enable interaction first (modifies WS_EX_TRANSPARENT)
310-
SetClickThrough(hwnd, FALSE);
311-
312-
// 2. Enable visual effect (Acrylic Blur)
313-
SetBlurBehind(hwnd, TRUE);
314-
315-
// 3. Change Z-order last (triggers heavy window pos changes)
316-
if (!CLOCK_WINDOW_TOPMOST) {
317-
SetWindowTopmost(hwnd, TRUE);
318-
}
319-
320-
ShowWindow(hwnd, SW_SHOW);
321-
SetForegroundWindow(hwnd);
302+
EndEditMode(hwnd);
322303
} else {
323-
extern char CLOCK_TEXT_COLOR[COLOR_HEX_BUFFER];
324-
extern int CLOCK_WINDOW_OPACITY;
325-
326-
// 1. Disable visual effect
327-
SetBlurBehind(hwnd, FALSE);
328-
329-
// 2. Disable interaction
330-
SetClickThrough(hwnd, TRUE);
331-
332-
SaveWindowSettings(hwnd);
333-
WriteConfigColor(CLOCK_TEXT_COLOR);
334-
335-
if (!PREVIOUS_TOPMOST_STATE) {
336-
SetWindowTopmost(hwnd, FALSE);
337-
338-
// Force a delayed redraw to clean up any artifacts
339-
KillTimer(hwnd, TIMER_ID_FORCE_REDRAW);
340-
SetTimer(hwnd, TIMER_ID_FORCE_REDRAW, 150, NULL);
341-
}
304+
StartEditMode(hwnd);
342305
}
343-
344-
// Force immediate update
345-
InvalidateRect(hwnd, NULL, TRUE);
346-
UpdateWindow(hwnd);
347306
}
348307

349308
void TogglePauseResume(HWND hwnd) {

0 commit comments

Comments
 (0)