|
26 | 26 | #include "plugin/plugin_manager.h" |
27 | 27 | #include "plugin/plugin_data.h" |
28 | 28 | #include "markdown/markdown_interactive.h" |
| 29 | +#include "drag_scale.h" // Added this line |
29 | 30 |
|
30 | 31 | /* ============================================================================ |
31 | 32 | * External Declarations |
@@ -297,53 +298,11 @@ void StartPomodoroTimer(HWND hwnd) { |
297 | 298 | extern BOOL g_IsTransitioning; |
298 | 299 |
|
299 | 300 | 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 | | - |
306 | 301 | 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); |
322 | 303 | } 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); |
342 | 305 | } |
343 | | - |
344 | | - // Force immediate update |
345 | | - InvalidateRect(hwnd, NULL, TRUE); |
346 | | - UpdateWindow(hwnd); |
347 | 306 | } |
348 | 307 |
|
349 | 308 | void TogglePauseResume(HWND hwnd) { |
|
0 commit comments