Skip to content

Commit 82d0cc1

Browse files
committed
[WLANWIZ] Improve visual accessibility of the connection mode/state
1 parent 996cada commit 82d0cc1

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

dll/shellext/wlanwiz/draw.cpp

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,15 +417,32 @@ LRESULT CWlanWizard::OnDrawItem(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b
417417
? IDS_WLANWIZ_CONNECTED_AUTO
418418
: IDS_WLANWIZ_CONNECTED_MANU);
419419

420-
RECT rcConnMode =
420+
RECT rConnMode =
421421
{
422-
.left = pdis->rcItem.right - 70,
423-
.top = pdis->rcItem.top + 3,
422+
.left = pdis->rcItem.right - 100,
423+
.top = pdis->rcItem.top + 4,
424424
.right = pdis->rcItem.right - 25,
425425
.bottom = pdis->rcItem.top + 22
426426
};
427427

428-
DrawTextW(pdis->hDC, cswConnState, cswConnState.GetLength(), &rcConnMode, DT_RIGHT);
428+
RECT rCalc = rConnMode;
429+
430+
/* Network relation had to be drawn bold and painted in COLOR_3DFACE
431+
* out of queue and this breaks the pipeline. Refactoring help needed!
432+
*/
433+
COLORREF oldRelationColor = SetTextColor(pdis->hDC, GetSysColor(pdis->itemState & ODS_SELECTED ? COLOR_HIGHLIGHTTEXT : COLOR_GRAYTEXT));
434+
this->lfCaption.lfWeight = FW_BOLD;
435+
hfCaption = CreateFontIndirectW(&this->lfCaption);
436+
437+
hOld = SelectObject(pdis->hDC, hfCaption);
438+
DrawTextW(pdis->hDC, cswConnState, cswConnState.GetLength(), &rCalc, DT_CALCRECT | DT_RIGHT | DT_NOCLIP | DT_WORDBREAK);
439+
DrawTextW(pdis->hDC, cswConnState, cswConnState.GetLength(), &rConnMode, DT_RIGHT | DT_NOCLIP | DT_WORDBREAK);
440+
SelectObject(pdis->hDC, hOld);
441+
442+
DeleteObject(hfCaption);
443+
this->lfCaption.lfWeight = FW_NORMAL;
444+
hfCaption = CreateFontIndirectW(&this->lfCaption);
445+
SetTextColor(pdis->hDC, oldRelationColor);
429446

430447
HICON hFav = LoadIconW(GetModuleHandleW(L"shell32.dll"), MAKEINTRESOURCE(IDI_SHELL32_FAVORITES));
431448

0 commit comments

Comments
 (0)