[COMCTL32] rebar: Remove some hacks and fix checking for transparent background
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Fri, 12 Jan 2018 16:49:09 +0000 (18:49 +0200)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 15 Jan 2018 10:57:06 +0000 (12:57 +0200)
dll/win32/comctl32/rebar.c

index 525c4cc..d489614 100644 (file)
@@ -1826,43 +1826,28 @@ static LRESULT REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc)
     RECT cr;
     COLORREF old = CLR_NONE, new;
     HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
-#ifdef __REACTOS__
-    HRGN hrgn;
-#endif
 
     GetClientRect (infoPtr->hwndSelf, &cr);
 
 #ifdef __REACTOS__
-
     if (theme)
     {
-        if (IsThemeBackgroundPartiallyTransparent(theme, RP_BACKGROUND, 0))
+        if (IsThemeBackgroundPartiallyTransparent(theme, 0, 0))
         {
             DrawThemeParentBackground (infoPtr->hwndSelf, hdc, &cr);
         }
         DrawThemeBackground (theme, hdc, 0, 0, &cr, NULL);
     }
-
-    hrgn = CreateRectRgn(cr.left, cr.top, cr.right, cr.bottom);
-
 #endif
 
     oldrow = -1;
     for(i=0; i<infoPtr->uNumBands; i++) {
         RECT rcBand;
-#ifdef __REACTOS__
-        RECT rcBandReal;
-        HRGN hrgnBand;
-#endif
 
         lpBand = REBAR_GetBand(infoPtr, i);
        if (HIDDENBAND(lpBand)) continue;
         translate_rect(infoPtr, &rcBand, &lpBand->rcBand);
 
-#ifdef __REACTOS__
-        rcBandReal = rcBand;
-#endif
-
        /* draw band separator between rows */
        if (lpBand->iRow != oldrow) {
            oldrow = lpBand->iRow;
@@ -1887,9 +1872,6 @@ static LRESULT REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc)
                }
                 TRACE ("drawing band separator bottom (%s)\n",
                        wine_dbgstr_rect(&rcRowSep));
-#ifdef __REACTOS__
-        rcBandReal = rcRowSep;
-#endif
            }
        }
 
@@ -1900,9 +1882,6 @@ static LRESULT REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc)
            if (infoPtr->dwStyle & CCS_VERT) {
                 rcSep.bottom = rcSep.top;
                rcSep.top -= SEP_WIDTH_SIZE;
-#ifdef __REACTOS__
-        rcBandReal.top -= SEP_WIDTH_SIZE;
-#endif
                 if (theme)
                     DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcSep, EDGE_ETCHED, BF_BOTTOM, NULL);
                 else
@@ -1911,9 +1890,6 @@ static LRESULT REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc)
            else {
                 rcSep.right = rcSep.left;
                rcSep.left -= SEP_WIDTH_SIZE;
-#ifdef __REACTOS__
-        rcBandReal.left -= SEP_WIDTH_SIZE;
-#endif
                 if (theme)
                     DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcSep, EDGE_ETCHED, BF_RIGHT, NULL);
                 else
@@ -1944,9 +1920,6 @@ static LRESULT REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc)
 #endif
        }
 
-#ifdef __REACTOS__
-        if (!theme)
-#else
         if (theme)
         {
             /* When themed, the background color is ignored (but not a
@@ -1954,7 +1927,6 @@ static LRESULT REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc)
             DrawThemeBackground (theme, hdc, 0, 0, &cr, &rcBand);
         }
         else
-#endif
         {
             old = SetBkColor (hdc, new);
             TRACE("%s background color=0x%06x, band %s\n",
@@ -1965,26 +1937,7 @@ static LRESULT REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc)
             if (lpBand->clrBack != CLR_NONE)
                 SetBkColor (hdc, old);
         }
-
-#ifdef __REACTOS__
-        hrgnBand = CreateRectRgn(rcBandReal.left, rcBandReal.top, rcBandReal.right, rcBandReal.bottom);
-        CombineRgn(hrgn, hrgn, hrgnBand, RGN_DIFF);
-        DeleteObject(hrgnBand);
-#endif
     }
-
-#if 1
-#ifdef __REACTOS__
-    if (!theme)
-#endif
-    {
-        //FIXME: Apparently painting the remaining area is a v6 feature
-        HBRUSH hbrush = CreateSolidBrush(new);
-        FillRgn(hdc, hrgn, hbrush);
-        DeleteObject(hbrush);
-    }
-    DeleteObject(hrgn);
-#endif
     return TRUE;
 }