From ce2809b72bce9ea47ca99e77dfa66a6948780422 Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Tue, 4 May 2021 13:01:04 +0100 Subject: [PATCH] Progress tweaks. --- README.md | 2 +- progress_windows.go | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 145e14a..93415e4 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ as well as a *“port”* of the `zenity` command to both Windows and macOS base Implemented dialogs: * [message](https://github.com/ncruces/zenity/wiki/Message-dialog) (error, info, question, warning) -* [text entry](https://github.com/ncruces/zenity/wiki/Text-Entry-dialog) +* [text entry](https://github.com/ncruces/zenity/wiki/Text-entry-dialog) * [list](https://github.com/ncruces/zenity/wiki/List-dialog) (simple) * [password](https://github.com/ncruces/zenity/wiki/Password-dialog) * [file selection](https://github.com/ncruces/zenity/wiki/File-selection-dialog) diff --git a/progress_windows.go b/progress_windows.go index 8047bb8..0d2d58d 100644 --- a/progress_windows.go +++ b/progress_windows.go @@ -54,24 +54,24 @@ func progressDlg(opts options, dlg *progressDialog) (err error) { sendMessage.Call(dlg.okBtn, 0x0030 /* WM_SETFONT */, hfont, 1) sendMessage.Call(dlg.cancelBtn, 0x0030 /* WM_SETFONT */, hfont, 1) sendMessage.Call(dlg.extraBtn, 0x0030 /* WM_SETFONT */, hfont, 1) - setWindowPos.Call(dlg.wnd, 0, 0, 0, dpi.Scale(281), dpi.Scale(141), 0x6) // SWP_NOZORDER|SWP_NOMOVE + setWindowPos.Call(dlg.wnd, 0, 0, 0, dpi.Scale(281), dpi.Scale(133), 0x6) // SWP_NOZORDER|SWP_NOMOVE setWindowPos.Call(dlg.textCtl, 0, dpi.Scale(12), dpi.Scale(10), dpi.Scale(241), dpi.Scale(16), 0x4) // SWP_NOZORDER - setWindowPos.Call(dlg.progCtl, 0, dpi.Scale(12), dpi.Scale(30), dpi.Scale(241), dpi.Scale(24), 0x4) // SWP_NOZORDER + setWindowPos.Call(dlg.progCtl, 0, dpi.Scale(12), dpi.Scale(30), dpi.Scale(241), dpi.Scale(16), 0x4) // SWP_NOZORDER if dlg.extraBtn == 0 { if dlg.cancelBtn == 0 { - setWindowPos.Call(dlg.okBtn, 0, dpi.Scale(178), dpi.Scale(66), dpi.Scale(75), dpi.Scale(24), 0x4) // SWP_NOZORDER + setWindowPos.Call(dlg.okBtn, 0, dpi.Scale(178), dpi.Scale(58), dpi.Scale(75), dpi.Scale(24), 0x4) // SWP_NOZORDER } else { - setWindowPos.Call(dlg.okBtn, 0, dpi.Scale(95), dpi.Scale(66), dpi.Scale(75), dpi.Scale(24), 0x4) // SWP_NOZORDER - setWindowPos.Call(dlg.cancelBtn, 0, dpi.Scale(178), dpi.Scale(66), dpi.Scale(75), dpi.Scale(24), 0x4) // SWP_NOZORDER + setWindowPos.Call(dlg.okBtn, 0, dpi.Scale(95), dpi.Scale(58), dpi.Scale(75), dpi.Scale(24), 0x4) // SWP_NOZORDER + setWindowPos.Call(dlg.cancelBtn, 0, dpi.Scale(178), dpi.Scale(58), dpi.Scale(75), dpi.Scale(24), 0x4) // SWP_NOZORDER } } else { if dlg.cancelBtn == 0 { - setWindowPos.Call(dlg.okBtn, 0, dpi.Scale(95), dpi.Scale(66), dpi.Scale(75), dpi.Scale(24), 0x4) // SWP_NOZORDER - setWindowPos.Call(dlg.extraBtn, 0, dpi.Scale(178), dpi.Scale(66), dpi.Scale(75), dpi.Scale(24), 0x4) // SWP_NOZORDER + setWindowPos.Call(dlg.okBtn, 0, dpi.Scale(95), dpi.Scale(58), dpi.Scale(75), dpi.Scale(24), 0x4) // SWP_NOZORDER + setWindowPos.Call(dlg.extraBtn, 0, dpi.Scale(178), dpi.Scale(58), dpi.Scale(75), dpi.Scale(24), 0x4) // SWP_NOZORDER } else { - setWindowPos.Call(dlg.okBtn, 0, dpi.Scale(12), dpi.Scale(66), dpi.Scale(75), dpi.Scale(24), 0x4) // SWP_NOZORDER - setWindowPos.Call(dlg.extraBtn, 0, dpi.Scale(95), dpi.Scale(66), dpi.Scale(75), dpi.Scale(24), 0x4) // SWP_NOZORDER - setWindowPos.Call(dlg.cancelBtn, 0, dpi.Scale(178), dpi.Scale(66), dpi.Scale(75), dpi.Scale(24), 0x4) // SWP_NOZORDER + setWindowPos.Call(dlg.okBtn, 0, dpi.Scale(12), dpi.Scale(58), dpi.Scale(75), dpi.Scale(24), 0x4) // SWP_NOZORDER + setWindowPos.Call(dlg.extraBtn, 0, dpi.Scale(95), dpi.Scale(58), dpi.Scale(75), dpi.Scale(24), 0x4) // SWP_NOZORDER + setWindowPos.Call(dlg.cancelBtn, 0, dpi.Scale(178), dpi.Scale(58), dpi.Scale(75), dpi.Scale(24), 0x4) // SWP_NOZORDER } } } @@ -129,7 +129,7 @@ func progressDlg(opts options, dlg *progressDialog) (err error) { 0x84c80000, // WS_POPUPWINDOW|WS_CLIPSIBLINGS|WS_DLGFRAME 0x80000000, // CW_USEDEFAULT 0x80000000, // CW_USEDEFAULT - 281, 141, 0, 0, instance, 0) + 281, 133, 0, 0, instance, 0) dlg.textCtl, _, _ = createWindowEx.Call(0, strptr("STATIC"), 0, @@ -143,23 +143,23 @@ func progressDlg(opts options, dlg *progressDialog) (err error) { dlg.progCtl, _, _ = createWindowEx.Call(0, strptr("msctls_progress32"), // PROGRESS_CLASS 0, flags, - 12, 30, 241, 24, dlg.wnd, 0, instance, 0) + 12, 30, 241, 16, dlg.wnd, 0, instance, 0) dlg.okBtn, _, _ = createWindowEx.Call(0, strptr("BUTTON"), strptr(*opts.okLabel), 0x58030001, // WS_CHILD|WS_VISIBLE|WS_DISABLED|WS_GROUP|WS_TABSTOP|BS_DEFPUSHBUTTON - 12, 66, 75, 24, dlg.wnd, 1 /* IDOK */, instance, 0) + 12, 58, 75, 24, dlg.wnd, 1 /* IDOK */, instance, 0) if !opts.noCancel { dlg.cancelBtn, _, _ = createWindowEx.Call(0, strptr("BUTTON"), strptr(*opts.cancelLabel), 0x50010000, // WS_CHILD|WS_VISIBLE|WS_GROUP|WS_TABSTOP - 12, 66, 75, 24, dlg.wnd, 2 /* IDCANCEL */, instance, 0) + 12, 58, 75, 24, dlg.wnd, 2 /* IDCANCEL */, instance, 0) } if opts.extraButton != nil { dlg.extraBtn, _, _ = createWindowEx.Call(0, strptr("BUTTON"), strptr(*opts.extraButton), 0x50010000, // WS_CHILD|WS_VISIBLE|WS_GROUP|WS_TABSTOP - 12, 66, 75, 24, dlg.wnd, 7 /* IDNO */, instance, 0) + 12, 58, 75, 24, dlg.wnd, 7 /* IDNO */, instance, 0) } layout(getDPI(dlg.wnd))