From 92ab32c6717dfd9cc162fbcc9d0e8bdcb104bda8 Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Sat, 5 Jan 2002 00:33:40 +0000 Subject: [PATCH] Fix for 115753, windows xp tooltip support, r=bryner, sr=sspitzer git-svn-id: svn://10.0.0.236/trunk@111379 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/src/windows/nsNativeThemeWin.cpp | 23 ++++++++++++++++++-- mozilla/gfx/src/windows/nsNativeThemeWin.h | 1 + mozilla/themes/classic/global/win/popup.css | 1 + 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/mozilla/gfx/src/windows/nsNativeThemeWin.cpp b/mozilla/gfx/src/windows/nsNativeThemeWin.cpp index e9fdf4d1cb1..719814cffc3 100644 --- a/mozilla/gfx/src/windows/nsNativeThemeWin.cpp +++ b/mozilla/gfx/src/windows/nsNativeThemeWin.cpp @@ -94,7 +94,10 @@ #define TABP_TAB 4 #define TABP_TAB_SELECTED 5 #define TABP_TAB_PANE 9 - + +// Tooltip constants +#define TTP_STANDARD 1 + NS_IMPL_ISUPPORTS1(nsNativeThemeWin, nsITheme) typedef HANDLE (WINAPI*OpenThemeDataPtr)(HWND hwnd, LPCWSTR pszClassList); @@ -132,6 +135,7 @@ nsNativeThemeWin::nsNativeThemeWin() { NS_INIT_ISUPPORTS(); mThemeDLL = NULL; mButtonTheme = NULL; + mTooltipTheme = NULL; mToolbarTheme = NULL; mRebarTheme = NULL; mProgressTheme = NULL; @@ -189,6 +193,11 @@ nsNativeThemeWin::GetTheme(PRUint8 aWidgetType) mButtonTheme = openTheme(NULL, L"Button"); return mButtonTheme; } + case NS_THEME_TOOLTIP: { + if (!mTooltipTheme) + mTooltipTheme = openTheme(NULL, L"Tooltip"); + return mTooltipTheme; + } case NS_THEME_TOOLBOX: { if (!mRebarTheme) mRebarTheme = openTheme(NULL, L"Rebar"); @@ -377,6 +386,11 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType, aState += 4; // 4 unchecked states, 4 checked states. return NS_OK; } + case NS_THEME_TOOLTIP: { + aPart = TTP_STANDARD; + aState = TS_NORMAL; + return NS_OK; + } case NS_THEME_PROGRESSBAR: { aPart = PP_BAR; aState = TS_NORMAL; @@ -703,7 +717,8 @@ nsNativeThemeWin::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType, aWidgetType == NS_THEME_PROGRESSBAR_CHUNK || aWidgetType == NS_THEME_PROGRESSBAR_CHUNK_VERTICAL || aWidgetType == NS_THEME_PROGRESSBAR || - aWidgetType == NS_THEME_PROGRESSBAR_VERTICAL) { + aWidgetType == NS_THEME_PROGRESSBAR_VERTICAL || + aWidgetType == NS_THEME_TOOLTIP) { *aShouldRepaint = PR_FALSE; return NS_OK; } @@ -750,6 +765,10 @@ nsNativeThemeWin::CloseData() closeTheme(mButtonTheme); mButtonTheme = NULL; } + if (mTooltipTheme) { + closeTheme(mTooltipTheme); + mTooltipTheme = NULL; + } if (mStatusbarTheme) { closeTheme(mStatusbarTheme); mStatusbarTheme = NULL; diff --git a/mozilla/gfx/src/windows/nsNativeThemeWin.h b/mozilla/gfx/src/windows/nsNativeThemeWin.h index 28fde66d656..3709a2609f5 100644 --- a/mozilla/gfx/src/windows/nsNativeThemeWin.h +++ b/mozilla/gfx/src/windows/nsNativeThemeWin.h @@ -70,6 +70,7 @@ protected: private: HMODULE mThemeDLL; HANDLE mButtonTheme; + HANDLE mTooltipTheme; HANDLE mToolbarTheme; HANDLE mRebarTheme; HANDLE mProgressTheme; diff --git a/mozilla/themes/classic/global/win/popup.css b/mozilla/themes/classic/global/win/popup.css index 402ed0cc41b..8ca0e67aa74 100644 --- a/mozilla/themes/classic/global/win/popup.css +++ b/mozilla/themes/classic/global/win/popup.css @@ -44,6 +44,7 @@ popup { /* ::::: tooltip ::::: */ tooltip { + -moz-appearance: tooltip; margin-top: 21px; border: 1px solid InfoText; padding: 2px 3px;