comparison src/gui_w32.c @ 21355:fcccc29bd386 v8.2.1228

patch 8.2.1228: scrollbars not flush against the window edges when maximised Commit: https://github.com/vim/vim/commit/203ec7760d255d9f92950c8779ddfc587d7896e0 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jul 17 20:43:43 2020 +0200 patch 8.2.1228: scrollbars not flush against the window edges when maximised Problem: Scrollbars not flush against the window edges when maximised. Solution: Add padding. (Ken Takata, closes https://github.com/vim/vim/issues/5602, closes https://github.com/vim/vim/issues/6466)
author Bram Moolenaar <Bram@vim.org>
date Fri, 17 Jul 2020 20:45:07 +0200
parents a4f213630151
children 75514c95b948
comparison
equal deleted inserted replaced
21354:428b1c6355eb 21355:fcccc29bd386
1408 int w, 1408 int w,
1409 int h) 1409 int h)
1410 { 1410 {
1411 SetWindowPos(sb->id, NULL, x, y, w, h, 1411 SetWindowPos(sb->id, NULL, x, y, w, h,
1412 SWP_NOZORDER | SWP_NOACTIVATE | SWP_SHOWWINDOW); 1412 SWP_NOZORDER | SWP_NOACTIVATE | SWP_SHOWWINDOW);
1413 }
1414
1415 int
1416 gui_mch_get_scrollbar_xpadding(void)
1417 {
1418 RECT rcTxt, rcWnd;
1419 int xpad;
1420
1421 GetWindowRect(s_textArea, &rcTxt);
1422 GetWindowRect(s_hwnd, &rcWnd);
1423 xpad = rcWnd.right - rcTxt.right - gui.scrollbar_width
1424 - GetSystemMetrics(SM_CXFRAME)
1425 - GetSystemMetrics(SM_CXPADDEDBORDER);
1426 return (xpad < 0) ? 0 : xpad;
1427 }
1428
1429 int
1430 gui_mch_get_scrollbar_ypadding(void)
1431 {
1432 RECT rcTxt, rcWnd;
1433 int ypad;
1434
1435 GetWindowRect(s_textArea, &rcTxt);
1436 GetWindowRect(s_hwnd, &rcWnd);
1437 ypad = rcWnd.bottom - rcTxt.bottom - gui.scrollbar_height
1438 - GetSystemMetrics(SM_CYFRAME)
1439 - GetSystemMetrics(SM_CXPADDEDBORDER);
1440 return (ypad < 0) ? 0 : ypad;
1413 } 1441 }
1414 1442
1415 void 1443 void
1416 gui_mch_create_scrollbar( 1444 gui_mch_create_scrollbar(
1417 scrollbar_T *sb, 1445 scrollbar_T *sb,