mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[ui] fix language button right alignment
This commit is contained in:
parent
991a77b62f
commit
1b65a6eac0
1 changed files with 7 additions and 7 deletions
14
src/rufus.c
14
src/rufus.c
|
@ -1554,7 +1554,7 @@ void InitDialog(HWND hDlg)
|
||||||
HINSTANCE hINetCplDllInst;
|
HINSTANCE hINetCplDllInst;
|
||||||
HIMAGELIST hLangToolbarImageList;
|
HIMAGELIST hLangToolbarImageList;
|
||||||
TBBUTTON tbLangToolbarButtons[1];
|
TBBUTTON tbLangToolbarButtons[1];
|
||||||
RECT rcClient;
|
RECT rcDeviceList;
|
||||||
RECT rcToolbarButton;
|
RECT rcToolbarButton;
|
||||||
DWORD len;
|
DWORD len;
|
||||||
SIZE sz;
|
SIZE sz;
|
||||||
|
@ -1700,7 +1700,7 @@ void InitDialog(HWND hDlg)
|
||||||
hIconUp = (HICON)LoadImage(hMainInstance, MAKEINTRESOURCE(IDI_UP), IMAGE_ICON, 16, 16, 0);
|
hIconUp = (HICON)LoadImage(hMainInstance, MAKEINTRESOURCE(IDI_UP), IMAGE_ICON, 16, 16, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
hLangToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_TABSTOP | TBSTYLE_TRANSPARENT | CCS_NOPARENTALIGN | CCS_NORESIZE | CCS_NODIVIDER, 0, 0, 0, 0, hMainDialog, NULL, hMainInstance, NULL);
|
hLangToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | TBSTYLE_TRANSPARENT | CCS_NOPARENTALIGN | CCS_NORESIZE | CCS_NODIVIDER, 0, 0, 0, 0, hMainDialog, NULL, hMainInstance, NULL);
|
||||||
|
|
||||||
hLangToolbarImageList = ImageList_Create(i16, i16, ILC_COLOR32, 1, 0);
|
hLangToolbarImageList = ImageList_Create(i16, i16, ILC_COLOR32, 1, 0);
|
||||||
|
|
||||||
|
@ -1718,16 +1718,16 @@ void InitDialog(HWND hDlg)
|
||||||
|
|
||||||
SendMessage(hLangToolbar, TB_GETRECT, idLangButton, (LPARAM)&rcToolbarButton);
|
SendMessage(hLangToolbar, TB_GETRECT, idLangButton, (LPARAM)&rcToolbarButton);
|
||||||
|
|
||||||
// get the dimensions of the dialog
|
// get the position of the device list combobox so that the button can be aligned to its right edge
|
||||||
GetClientRect(hDlg, &rcClient);
|
GetWindowRect(hDeviceList, &rcDeviceList);
|
||||||
|
MapWindowPoints(NULL, hDlg, (POINT*)&rcDeviceList, 2);
|
||||||
|
|
||||||
// make the toolbar window just big enough to hold the button
|
// make the toolbar window just big enough to hold the button
|
||||||
// set the top margin to 4 DIPs and the right margin to 12 DIPs
|
|
||||||
SetWindowPos(
|
SetWindowPos(
|
||||||
hLangToolbar,
|
hLangToolbar,
|
||||||
NULL,
|
NULL,
|
||||||
rcClient.right - rcToolbarButton.right - (int)(12.0f * fScale),
|
rcDeviceList.right - rcToolbarButton.right, // right margin: same as the device list combobox
|
||||||
(int)(4.0f * fScale),
|
(int)(4.0f * fScale), // top margin: 4 DIPs
|
||||||
rcToolbarButton.right,
|
rcToolbarButton.right,
|
||||||
rcToolbarButton.bottom,
|
rcToolbarButton.bottom,
|
||||||
0);
|
0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue