@@ -415,15 +415,32 @@ LRESULT CWlanWizard::OnDrawItem(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b
415415 ? IDS_WLANWIZ_CONNECTED_AUTO
416416 : IDS_WLANWIZ_CONNECTED_MANU);
417417
418- RECT rcConnMode =
418+ RECT rConnMode =
419419 {
420- .left = pdis->rcItem .right - 70 ,
421- .top = pdis->rcItem .top + 3 ,
420+ .left = pdis->rcItem .right - 100 ,
421+ .top = pdis->rcItem .top + 4 ,
422422 .right = pdis->rcItem .right - 25 ,
423423 .bottom = pdis->rcItem .top + 22
424424 };
425425
426- DrawTextW (pdis->hDC , cswConnState, cswConnState.GetLength (), &rcConnMode, DT_RIGHT);
426+ RECT rCalc = rConnMode;
427+
428+ /* Network relation had to be drawn bold and painted in COLOR_3DFACE
429+ * out of queue and this breaks the pipeline. Refactoring help needed!
430+ */
431+ COLORREF oldRelationColor = SetTextColor (pdis->hDC , GetSysColor (pdis->itemState & ODS_SELECTED ? COLOR_HIGHLIGHTTEXT : COLOR_GRAYTEXT));
432+ this ->lfCaption .lfWeight = FW_BOLD;
433+ hfCaption = CreateFontIndirectW (&this ->lfCaption );
434+
435+ hOld = SelectObject (pdis->hDC , hfCaption);
436+ DrawTextW (pdis->hDC , cswConnState, cswConnState.GetLength (), &rCalc, DT_CALCRECT | DT_RIGHT | DT_NOCLIP | DT_WORDBREAK);
437+ DrawTextW (pdis->hDC , cswConnState, cswConnState.GetLength (), &rConnMode, DT_RIGHT | DT_NOCLIP | DT_WORDBREAK);
438+ SelectObject (pdis->hDC , hOld);
439+
440+ DeleteObject (hfCaption);
441+ this ->lfCaption .lfWeight = FW_NORMAL;
442+ hfCaption = CreateFontIndirectW (&this ->lfCaption );
443+ SetTextColor (pdis->hDC , oldRelationColor);
427444
428445 HICON hFav = LoadIconW (GetModuleHandleW (L" shell32.dll" ), MAKEINTRESOURCE (IDI_SHELL32_FAVORITES));
429446
0 commit comments