From 2b77f25e43cbd24d13599d3a0afcf1cd68305f28 Mon Sep 17 00:00:00 2001 From: Mounir Lamouri Date: Wed, 4 May 2011 16:56:42 +0200 Subject: [PATCH] Bug 641517 (1/2) - Use PP_FILL instead of PP_CHUNK to show the progress bar on Windows Vista and Windows 7. r=jimm --- widget/src/windows/nsNativeThemeWin.cpp | 8 ++++++-- widget/src/windows/nsUXThemeConstants.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/widget/src/windows/nsNativeThemeWin.cpp b/widget/src/windows/nsNativeThemeWin.cpp index 830a7b8e2e1a..76cd54bf48b1 100644 --- a/widget/src/windows/nsNativeThemeWin.cpp +++ b/widget/src/windows/nsNativeThemeWin.cpp @@ -349,6 +349,8 @@ static CaptionButtonPadding buttonData[3] = { // PP_CHUNK is overflowing on the bottom for no appearant reasons. // This is a fix around this issue. static const PRInt32 kProgressDeterminedXPOverflow = 11; +// Same thing but for PP_FILL. +static const PRInt32 kProgressDeterminedVistaOverflow = 4; // Adds "hot" caption button padding to minimum widget size. static void AddPaddingRect(nsIntSize* aSize, CaptionButton button) { @@ -665,7 +667,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType, return NS_OK; } case NS_THEME_PROGRESSBAR_CHUNK: { - aPart = PP_CHUNK; + aPart = nsUXThemeData::sIsVistaOrLater ? PP_FILL : PP_CHUNK; aState = TS_NORMAL; return NS_OK; } @@ -1297,7 +1299,9 @@ RENDER_AGAIN: else if (aWidgetType == NS_THEME_WINDOW_BUTTON_CLOSE) { OffsetBackgroundRect(widgetRect, CAPTIONBUTTON_CLOSE); } else if (aWidgetType == NS_THEME_PROGRESSBAR_CHUNK) { - widgetRect.bottom -= kProgressDeterminedXPOverflow; + widgetRect.bottom -= nsUXThemeData::sIsVistaOrLater + ? kProgressDeterminedVistaOverflow + : kProgressDeterminedXPOverflow; } // widgetRect is the bounding box for a widget, yet the scale track is only diff --git a/widget/src/windows/nsUXThemeConstants.h b/widget/src/windows/nsUXThemeConstants.h index 0398a6f9e556..38202e9b9cb1 100644 --- a/widget/src/windows/nsUXThemeConstants.h +++ b/widget/src/windows/nsUXThemeConstants.h @@ -116,6 +116,7 @@ #define PP_BARVERT 2 #define PP_CHUNK 3 #define PP_CHUNKVERT 4 +#define PP_FILL 5 // Tab constants #define TABP_TAB 4