From 01d579991406364f59e961883c8f0e73f3092cfa Mon Sep 17 00:00:00 2001 From: messypy Date: Tue, 28 Jul 2026 00:05:41 +0900 Subject: [PATCH] Fix settings panel control overlap --- cmd/vrc_osc_gui/window_windows.go | 40 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/cmd/vrc_osc_gui/window_windows.go b/cmd/vrc_osc_gui/window_windows.go index 1a6a07c..91631ff 100644 --- a/cmd/vrc_osc_gui/window_windows.go +++ b/cmd/vrc_osc_gui/window_windows.go @@ -638,38 +638,42 @@ func runNativeGUI(initialTab string) error { app.btnFontDown, _, _ = createWindowEx.Call(0, uintptr(unsafe.Pointer(buttonClass)), uintptr(unsafe.Pointer(fontDownTitle)), buttonStyle, leftPaneWidth+32, contentTop+178, 52, 30, hwnd, 3006, hInstance, 0) app.btnFontUp, _, _ = createWindowEx.Call(0, uintptr(unsafe.Pointer(buttonClass)), uintptr(unsafe.Pointer(fontUpTitle)), buttonStyle, leftPaneWidth+92, contentTop+178, 52, 30, hwnd, 3007, hInstance, 0) exportDirTitle, _ := syscall.UTF16PtrFromString("") + exportDirRect := settingsHistoryExportDirRect() app.settingsExportDirEdit, _, _ = createWindowEx.Call( 0, uintptr(unsafe.Pointer(editClassTitle)), uintptr(unsafe.Pointer(exportDirTitle)), uintptr(wsChild|wsVisible|wsBorder|wsTabstop|esAutohscroll), - 116, 410, 520, 24, + uintptr(exportDirRect.Left), uintptr(exportDirRect.Top), uintptr(exportDirRect.Right-exportDirRect.Left), uintptr(exportDirRect.Bottom-exportDirRect.Top), app.settingsPaneHwnd, idHistoryExportDir, hInstance, 0, ) browseStyle := uintptr(wsChild | wsTabstop) + browseRect := settingsHistoryExportBrowseRect() app.settingsExportBrowseBtn, _, _ = createWindowEx.Call( 0, uintptr(unsafe.Pointer(buttonClass)), uintptr(unsafe.Pointer(browseTitle)), browseStyle, - 644, 410, 92, 24, + uintptr(browseRect.Left), uintptr(browseRect.Top), uintptr(browseRect.Right-browseRect.Left), uintptr(browseRect.Bottom-browseRect.Top), app.settingsPaneHwnd, idHistoryExportBrowse, hInstance, 0, ) exportCustomTitle, _ := syscall.UTF16PtrFromString("") + customRect := settingsHistoryExportCustomRect() app.settingsExportCustomEdit, _, _ = createWindowEx.Call( 0, uintptr(unsafe.Pointer(editClassTitle)), uintptr(unsafe.Pointer(exportCustomTitle)), uintptr(wsChild|wsVisible|wsBorder|wsTabstop|esAutohscroll), - 116, 520, 520, 24, + uintptr(customRect.Left), uintptr(customRect.Top), uintptr(customRect.Right-customRect.Left), uintptr(customRect.Bottom-customRect.Top), app.settingsPaneHwnd, idHistoryExportCustom, hInstance, 0, ) + saveRect := settingsHistoryExportCustomSaveRect() app.settingsExportCustomSaveBtn, _, _ = createWindowEx.Call( 0, uintptr(unsafe.Pointer(buttonClass)), uintptr(unsafe.Pointer(saveTitle)), browseStyle, - 644, 520, 92, 24, + uintptr(saveRect.Left), uintptr(saveRect.Top), uintptr(saveRect.Right-saveRect.Left), uintptr(saveRect.Bottom-saveRect.Top), app.settingsPaneHwnd, idHistoryExportSave, hInstance, 0, ) applyRefreshTimer(hwnd, &app) @@ -1872,19 +1876,13 @@ func paintSettingsPane(hwnd uintptr, app *guiApp) uintptr { drawPaneText(hdc, 24, 190, "文字サイズ", app.hFont, clrMutedText) drawSettingsRefreshControl(hdc, app) drawSettingsFontControl(hdc, app) - drawPaneText(hdc, 24, 390, "履歴 Export", app.hFont, clrMutedText) - drawPaneText(hdc, 24, 414, "出力先フォルダ", app.hFont, clrMutedText) - drawSettingsBox(hdc, settingsHistoryExportDirRect(), 0x0038281a, clrPaneBorder) - drawPaneText(hdc, 120, 414, exportDirDisplayText(app.historyExportDir), app.hFont, clrText) - drawSettingsWideButton(hdc, settingsHistoryExportBrowseRect(), "参照", "", app.hFont, true) + drawPaneText(hdc, 24, 374, "履歴 Export", app.hFont, clrMutedText) + drawPaneText(hdc, 24, 396, "出力先フォルダ", app.hFont, clrMutedText) drawSettingsWideButton(hdc, settingsHistoryExportTimeRect(), "Time", onOffBool(app.historyExportIncludeTime), app.hFont, app.historyExportIncludeTime) drawSettingsWideButton(hdc, settingsHistoryExportWorldRect(), "World", onOffBool(app.historyExportIncludeWorld), app.hFont, app.historyExportIncludeWorld) drawSettingsWideButton(hdc, settingsHistoryExportJoinLeaveRect(), "Join/Leave", onOffBool(app.historyExportIncludeJoinLeave), app.hFont, app.historyExportIncludeJoinLeave) drawSettingsWideButton(hdc, settingsHistoryExportCustomToggleRect(), "Custom", onOffBool(app.historyExportCustomEnabled), app.hFont, app.historyExportCustomEnabled) - drawPaneText(hdc, 24, 522, "Custom 条件", app.hFont, clrMutedText) - drawSettingsBox(hdc, settingsHistoryExportCustomRect(), 0x0038281a, clrPaneBorder) - drawPaneText(hdc, 120, 522, previewLine(app.historyExportCustom, 60), app.hFont, clrText) - drawSettingsWideButton(hdc, settingsHistoryExportCustomSaveRect(), "保存", "", app.hFont, true) + drawPaneText(hdc, 24, 516, "Custom 条件", app.hFont, clrMutedText) return 0 } @@ -1925,35 +1923,35 @@ func settingsFontUpRect() winRect { } func settingsHistoryExportDirRect() winRect { - return winRect{Left: 116, Top: 410, Right: 636, Bottom: 434} + return winRect{Left: 116, Top: 420, Right: 636, Bottom: 444} } func settingsHistoryExportBrowseRect() winRect { - return winRect{Left: 644, Top: 410, Right: 736, Bottom: 434} + return winRect{Left: 644, Top: 420, Right: 736, Bottom: 444} } func settingsHistoryExportTimeRect() winRect { - return winRect{Left: 24, Top: 442, Right: 360, Bottom: 476} + return winRect{Left: 24, Top: 452, Right: 360, Bottom: 482} } func settingsHistoryExportWorldRect() winRect { - return winRect{Left: 376, Top: 442, Right: 736, Bottom: 476} + return winRect{Left: 376, Top: 452, Right: 736, Bottom: 482} } func settingsHistoryExportJoinLeaveRect() winRect { - return winRect{Left: 24, Top: 480, Right: 360, Bottom: 514} + return winRect{Left: 24, Top: 488, Right: 360, Bottom: 518} } func settingsHistoryExportCustomToggleRect() winRect { - return winRect{Left: 376, Top: 480, Right: 736, Bottom: 514} + return winRect{Left: 376, Top: 488, Right: 736, Bottom: 518} } func settingsHistoryExportCustomRect() winRect { - return winRect{Left: 116, Top: 520, Right: 636, Bottom: 544} + return winRect{Left: 116, Top: 536, Right: 636, Bottom: 558} } func settingsHistoryExportCustomSaveRect() winRect { - return winRect{Left: 644, Top: 520, Right: 736, Bottom: 544} + return winRect{Left: 644, Top: 536, Right: 736, Bottom: 558} } func handleSettingsPaneClick(app *guiApp, x, y int32, getWindowText, setWindowText *syscall.LazyProc) bool {