@@ -645,25 +645,21 @@ BOOL QuickOpenDlg::onDrawItem(LPDRAWITEMSTRUCT drawItem)
645645 if (ODA_FOCUS == (drawItem->itemAction & ODA_FOCUS)) {
646646 return TRUE ;
647647 }
648-
649648 const HDC& hdc = drawItem->hDC ;
649+ ThemeRenderer& theme = ThemeRenderer::Instance ();
650+
650651 COLORREF backgroundMatchColor = RGB (254 , 230 , 177 );
651652 COLORREF matchColor = RGB (0 , 0 , 0 );
652-
653- COLORREF backgroundColor = ThemeRenderer::Instance ().GetColors ().secondary_bg ;
654- COLORREF textColor1 = ThemeRenderer::Instance ().GetColors ().secondary ;
653+ COLORREF backgroundColor = theme.GetColors ().secondary_bg ;
654+ COLORREF textColor1 = theme.GetColors ().secondary ;
655655 COLORREF textColor2 = RGB (128 , 128 , 128 );
656-
656+ HBRUSH backgroundBrush = theme. GetBrush (ThemeRenderer::BrushType::SecondaryBg);
657657 if (ODS_SELECTED == ((drawItem->itemState ) & (ODS_SELECTED))) {
658- backgroundColor = ThemeRenderer::Instance () .GetColors ().primary_bg ;
659- textColor1 = ThemeRenderer::Instance () .GetColors ().primary ;
660- textColor2 = RGB ( 128 , 128 , 128 );
658+ backgroundColor = theme .GetColors ().primary_bg ;
659+ textColor1 = theme .GetColors ().primary ;
660+ backgroundBrush = theme. GetBrush (ThemeRenderer::BrushType::PrimaryBg );
661661 }
662-
663- // Fill background
664- const HBRUSH hBrush = ::CreateSolidBrush (backgroundColor);
665- ::FillRect (hdc, &drawItem->rcItem, hBrush);
666- ::DeleteObject (hBrush);
662+ ::FillRect (hdc, &drawItem->rcItem, backgroundBrush);
667663
668664 RECT drawPosition = drawItem->rcItem ;
669665 drawPosition.top += _layout.itemMargin ;
0 commit comments