mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Checking in 115757, enabling of Windows XP Theme Support under Classic skin.,r=bryner,sr=hewitt
This commit is contained in:
parent
8d877b024f
commit
e3f61bf44f
@ -1833,23 +1833,7 @@ SetFont(nsIPresContext* aPresContext, nsIStyleContext* aContext,
|
||||
if (dc) {
|
||||
// GetSystemFont sets the font face but not necessarily the size
|
||||
aFont->mFont.size = defaultVariableFont.size;
|
||||
// If our font type is theme, then check for appearance data and
|
||||
// obtain our font based off our widget type.
|
||||
if (sysID == eSystemFont_Theme) {
|
||||
const nsStyleDisplay* display = (const nsStyleDisplay*)
|
||||
aContext->GetStyleData(eStyleStruct_Display);
|
||||
if (display->mAppearance) {
|
||||
// Get our theme.
|
||||
nsCOMPtr<nsITheme> theme;
|
||||
aPresContext->GetTheme(getter_AddRefs(theme));
|
||||
if (theme) {
|
||||
nsCOMPtr<nsIDeviceContext> deviceContext;
|
||||
aPresContext->GetDeviceContext(getter_AddRefs(deviceContext));
|
||||
theme->GetWidgetFont(deviceContext, display->mAppearance, &aFont->mFont);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (NS_FAILED(dc->GetSystemFont(sysID, &aFont->mFont))) {
|
||||
if (NS_FAILED(dc->GetSystemFont(sysID, &aFont->mFont))) {
|
||||
aFont->mFont.name = defaultVariableFont.name;
|
||||
}
|
||||
aFont->mSize = aFont->mFont.size; // this becomes our cascading size
|
||||
|
@ -3955,19 +3955,6 @@ PRBool CSSParserImpl::ParseAzimuth(PRInt32& aErrorCode, nsCSSValue& aValue)
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
static PRBool HasForegroundContent(PRUint8 aAppearance)
|
||||
{
|
||||
return ((aAppearance == NS_THEME_BUTTON) ||
|
||||
(aAppearance == NS_THEME_TOOLBAR_BUTTON) ||
|
||||
(aAppearance == NS_THEME_TOOLBAR_DUAL_BUTTON) ||
|
||||
(aAppearance == NS_THEME_LISTBOX_LISTITEM) ||
|
||||
(aAppearance == NS_THEME_TREEVIEW_TREEITEM) ||
|
||||
(aAppearance == NS_THEME_TREEVIEW_HEADER_CELL) ||
|
||||
(aAppearance == NS_THEME_TAB) ||
|
||||
(aAppearance == NS_THEME_TOOLTIP) ||
|
||||
(aAppearance == NS_THEME_TEXTFIELD));
|
||||
}
|
||||
|
||||
PRBool CSSParserImpl::ParseAppearance(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration,
|
||||
PRInt32& aChangeHint)
|
||||
{
|
||||
@ -3980,24 +3967,6 @@ PRBool CSSParserImpl::ParseAppearance(PRInt32& aErrorCode, nsICSSDeclaration* aD
|
||||
else
|
||||
return PR_FALSE;
|
||||
|
||||
if (appearance.GetIntValue() && HasForegroundContent(appearance.GetIntValue())) {
|
||||
// When an appearance is specified, it can act as a shorthand that
|
||||
// specifies color and font information as well.
|
||||
// Add in font information.
|
||||
PRInt32 index = SearchKeywordTable(eCSSKeyword_theme, nsCSSProps::kFontKTable);
|
||||
if (index > 0) {
|
||||
nsCSSValue val(nsCSSProps::kFontKTable[index], eCSSUnit_Enumerated);
|
||||
AppendValue(aDeclaration, eCSSProperty_font_family, val, aChangeHint);
|
||||
}
|
||||
|
||||
// Add in color information.
|
||||
index = SearchKeywordTable(eCSSKeyword_theme, nsCSSProps::kColorKTable);
|
||||
if (index > 0) {
|
||||
nsCSSValue val(nsCSSProps::kColorKTable[index], eCSSUnit_Integer);
|
||||
AppendValue(aDeclaration, eCSSProperty_color, val, aChangeHint);
|
||||
}
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
|
@ -421,8 +421,8 @@ CSS_KEY(dualbutton, dualbutton)
|
||||
CSS_KEY(dualbutton-dropdown, dualbutton_dropdown)
|
||||
CSS_KEY(separator, separator)
|
||||
CSS_KEY(statusbar, statusbar)
|
||||
CSS_KEY(statusbarpane, statusbar_pane)
|
||||
CSS_KEY(resizerpane, resizer_pane)
|
||||
CSS_KEY(statusbarpanel, statusbarpanel)
|
||||
CSS_KEY(resizerpanel, resizerpanel)
|
||||
CSS_KEY(resizer, resizer)
|
||||
CSS_KEY(listbox, listbox)
|
||||
CSS_KEY(listitem, listitem)
|
||||
@ -441,12 +441,16 @@ CSS_KEY(tooltip, tooltip)
|
||||
CSS_KEY(spinner, spinner)
|
||||
CSS_KEY(spinner-upbutton, spinner_upbutton)
|
||||
CSS_KEY(spinner-downbutton, spinner_downbutton)
|
||||
CSS_KEY(scrollbarbutton, scrollbarbutton)
|
||||
CSS_KEY(scrollbartrack, scrollbartrack)
|
||||
CSS_KEY(scrollbartrackstart, scrollbartrackstart)
|
||||
CSS_KEY(scrollbartrackend, scrollbartrackend)
|
||||
CSS_KEY(scrollbarthumb, scrollbarthumb)
|
||||
CSS_KEY(scrollbargripper, scrollbargripper)
|
||||
CSS_KEY(scrollbarbutton-up, scrollbarbutton_up)
|
||||
CSS_KEY(scrollbarbutton-down, scrollbarbutton_down)
|
||||
CSS_KEY(scrollbarbutton-left, scrollbarbutton_left)
|
||||
CSS_KEY(scrollbarbutton-right, scrollbarbutton_right)
|
||||
CSS_KEY(scrollbartrack-horizontal, scrollbartrack_horizontal)
|
||||
CSS_KEY(scrollbartrack-vertical, scrollbartrack_vertical)
|
||||
CSS_KEY(scrollbarthumb-horizontal, scrollbarthumb_horizontal)
|
||||
CSS_KEY(scrollbarthumb-vertical, scrollbarthumb_vertical)
|
||||
CSS_KEY(scrollbargripper-horizontal, scrollbargripper_horizontal)
|
||||
CSS_KEY(scrollbargripper-vertical, scrollbargripper_vertical)
|
||||
CSS_KEY(textfield, textfield)
|
||||
CSS_KEY(caret, caret)
|
||||
CSS_KEY(menulist, menulist)
|
||||
|
@ -137,8 +137,8 @@ const PRInt32 nsCSSProps::kAppearanceKTable[] = {
|
||||
eCSSKeyword_dualbutton_dropdown, NS_THEME_TOOLBAR_DUAL_BUTTON_DROPDOWN,
|
||||
eCSSKeyword_separator, NS_THEME_TOOLBAR_SEPARATOR,
|
||||
eCSSKeyword_statusbar, NS_THEME_STATUSBAR,
|
||||
eCSSKeyword_statusbar_pane, NS_THEME_STATUSBAR_PANE,
|
||||
eCSSKeyword_resizer_pane, NS_THEME_STATUSBAR_RESIZER_PANE,
|
||||
eCSSKeyword_statusbarpanel, NS_THEME_STATUSBAR_PANEL,
|
||||
eCSSKeyword_resizerpanel, NS_THEME_STATUSBAR_RESIZER_PANEL,
|
||||
eCSSKeyword_resizer, NS_THEME_RESIZER,
|
||||
eCSSKeyword_listbox, NS_THEME_LISTBOX,
|
||||
eCSSKeyword_listitem, NS_THEME_LISTBOX_LISTITEM,
|
||||
@ -158,12 +158,16 @@ const PRInt32 nsCSSProps::kAppearanceKTable[] = {
|
||||
eCSSKeyword_spinner_upbutton, NS_THEME_SPINNER_UP_BUTTON,
|
||||
eCSSKeyword_spinner_downbutton, NS_THEME_SPINNER_DOWN_BUTTON,
|
||||
eCSSKeyword_scrollbar, NS_THEME_SCROLLBAR,
|
||||
eCSSKeyword_scrollbarbutton, NS_THEME_SCROLLBAR_BUTTON,
|
||||
eCSSKeyword_scrollbartrack, NS_THEME_SCROLLBAR_TRACK,
|
||||
eCSSKeyword_scrollbartrackstart, NS_THEME_SCROLLBAR_TRACK_START,
|
||||
eCSSKeyword_scrollbartrackend, NS_THEME_SCROLLBAR_TRACK_END,
|
||||
eCSSKeyword_scrollbarthumb, NS_THEME_SCROLLBAR_THUMB,
|
||||
eCSSKeyword_scrollbargripper, NS_THEME_SCROLLBAR_GRIPPER,
|
||||
eCSSKeyword_scrollbarbutton_up, NS_THEME_SCROLLBAR_BUTTON_UP,
|
||||
eCSSKeyword_scrollbarbutton_down, NS_THEME_SCROLLBAR_BUTTON_DOWN,
|
||||
eCSSKeyword_scrollbarbutton_left, NS_THEME_SCROLLBAR_BUTTON_LEFT,
|
||||
eCSSKeyword_scrollbarbutton_right, NS_THEME_SCROLLBAR_BUTTON_RIGHT,
|
||||
eCSSKeyword_scrollbartrack_horizontal, NS_THEME_SCROLLBAR_TRACK_HORIZONTAL,
|
||||
eCSSKeyword_scrollbartrack_vertical, NS_THEME_SCROLLBAR_TRACK_VERTICAL,
|
||||
eCSSKeyword_scrollbarthumb_horizontal, NS_THEME_SCROLLBAR_THUMB_HORIZONTAL,
|
||||
eCSSKeyword_scrollbarthumb_vertical, NS_THEME_SCROLLBAR_THUMB_VERTICAL,
|
||||
eCSSKeyword_scrollbargripper_horizontal, NS_THEME_SCROLLBAR_GRIPPER_HORIZONTAL,
|
||||
eCSSKeyword_scrollbargripper_vertical, NS_THEME_SCROLLBAR_GRIPPER_VERTICAL,
|
||||
eCSSKeyword_textfield, NS_THEME_TEXTFIELD,
|
||||
eCSSKeyword_caret, NS_THEME_TEXTFIELD_CARET,
|
||||
eCSSKeyword_menulist, NS_THEME_DROPDOWN,
|
||||
|
@ -1029,13 +1029,13 @@ PRInt32 nsStyleDisplay::CalcDifference(const nsStyleDisplay& aOther) const
|
||||
|
||||
if ((mDisplay == aOther.mDisplay) &&
|
||||
(mFloats == aOther.mFloats) &&
|
||||
(mOverflow == aOther.mOverflow) &&
|
||||
(mAppearance == aOther.mAppearance)) {
|
||||
(mOverflow == aOther.mOverflow)) {
|
||||
if ((mBreakType == aOther.mBreakType) &&
|
||||
(mBreakBefore == aOther.mBreakBefore) &&
|
||||
(mBreakAfter == aOther.mBreakAfter) &&
|
||||
(mClipFlags == aOther.mClipFlags) &&
|
||||
(mClip == aOther.mClip)) {
|
||||
(mClip == aOther.mClip) &&
|
||||
(mAppearance == aOther.mAppearance)) {
|
||||
return NS_STYLE_HINT_NONE;
|
||||
}
|
||||
return NS_STYLE_HINT_REFLOW;
|
||||
|
@ -75,6 +75,7 @@
|
||||
#include "nsIXBLPrototypeBinding.h"
|
||||
#include "nsIXBLDocumentInfo.h"
|
||||
#include "nsXBLAtoms.h"
|
||||
#include "nsXULAtoms.h"
|
||||
|
||||
#include "nsIXBLPrototypeHandler.h"
|
||||
|
||||
@ -538,7 +539,6 @@ PRUint32 nsXBLService::gClassLRUListLength = 0;
|
||||
PRUint32 nsXBLService::gClassLRUListQuota = 64;
|
||||
|
||||
nsIAtom* nsXBLService::kEventAtom = nsnull;
|
||||
nsIAtom* nsXBLService::kScrollbarAtom = nsnull;
|
||||
nsIAtom* nsXBLService::kInputAtom = nsnull;
|
||||
|
||||
// Enabled by default. Must be over-ridden to disable
|
||||
@ -565,7 +565,6 @@ nsXBLService::nsXBLService(void)
|
||||
|
||||
// Create our atoms
|
||||
kEventAtom = NS_NewAtom("event");
|
||||
kScrollbarAtom = NS_NewAtom("scrollbar");
|
||||
kInputAtom = NS_NewAtom("input");
|
||||
|
||||
// Find out if the XUL cache is on or off
|
||||
@ -590,7 +589,6 @@ nsXBLService::~nsXBLService(void)
|
||||
|
||||
// Release our atoms
|
||||
NS_RELEASE(kEventAtom);
|
||||
NS_RELEASE(kScrollbarAtom);
|
||||
NS_RELEASE(kInputAtom);
|
||||
|
||||
// Walk the LRU list removing and deleting the nsXBLJSClasses.
|
||||
@ -1113,7 +1111,8 @@ nsXBLService::LoadBindingDocumentInfo(nsIContent* aBoundElement, nsIDocument* aB
|
||||
nsCOMPtr<nsIAtom> tagName;
|
||||
if (aBoundElement)
|
||||
aBoundElement->GetTag(*getter_AddRefs(tagName));
|
||||
if (!info && bindingManager && (tagName.get() != kScrollbarAtom) && (tagName.get() != kInputAtom)
|
||||
if (!info && bindingManager && (tagName.get() != nsXULAtoms::scrollbar) &&
|
||||
(tagName.get() != nsXULAtoms::thumb) && (tagName.get() != kInputAtom)
|
||||
&& !aForceSyncLoad) {
|
||||
// The third line of defense is to investigate whether or not the
|
||||
// document is currently being loaded asynchronously. If so, there's no
|
||||
@ -1217,7 +1216,8 @@ nsXBLService::FetchBindingDocument(nsIContent* aBoundElement, nsIDocument* aBoun
|
||||
if (aBoundElement)
|
||||
aBoundElement->GetTag(*getter_AddRefs(tagName));
|
||||
|
||||
if (tagName.get() == kScrollbarAtom || IsResourceURI(aURI))
|
||||
if (tagName.get() == nsXULAtoms::scrollbar || tagName.get() == nsXULAtoms::thumb ||
|
||||
IsResourceURI(aURI))
|
||||
aForceSyncLoad = PR_TRUE;
|
||||
|
||||
nsCOMPtr<nsIStreamListener> listener;
|
||||
|
@ -133,7 +133,6 @@ public:
|
||||
|
||||
// XBL Atoms
|
||||
static nsIAtom* kEventAtom;
|
||||
static nsIAtom* kScrollbarAtom;
|
||||
static nsIAtom* kInputAtom;
|
||||
|
||||
nsFixedSizeAllocator mPool;
|
||||
|
@ -55,20 +55,10 @@ public:
|
||||
const nsRect& aRect,
|
||||
const nsRect& aClipRect)=0;
|
||||
|
||||
NS_IMETHOD GetWidgetPadding(nsIDeviceContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
nsMargin* aResult)=0;
|
||||
|
||||
NS_IMETHOD GetWidgetFont(nsIDeviceContext* aContext,
|
||||
PRUint8 aWidgetType,
|
||||
nsFont* aFont)=0;
|
||||
|
||||
NS_IMETHOD GetWidgetColor(nsIPresContext* aPresContext,
|
||||
nsIRenderingContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
nscolor* aFont)=0;
|
||||
NS_IMETHOD GetWidgetBorder(nsIDeviceContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
nsMargin* aResult)=0;
|
||||
|
||||
NS_IMETHOD GetMinimumWidgetSize(nsIRenderingContext* aContext, nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
|
@ -35,11 +35,11 @@
|
||||
#define NS_THEME_STATUSBAR 21
|
||||
|
||||
// A single pane of a status bar.
|
||||
#define NS_THEME_STATUSBAR_PANE 21
|
||||
#define NS_THEME_STATUSBAR_PANEL 22
|
||||
|
||||
// The resizer background area in a status bar
|
||||
// for the resizer widget in the corner of a window.
|
||||
#define NS_THEME_STATUSBAR_RESIZER_PANE 23
|
||||
#define NS_THEME_STATUSBAR_RESIZER_PANEL 23
|
||||
|
||||
// The resizer itself.
|
||||
#define NS_THEME_RESIZER 24
|
||||
@ -99,28 +99,28 @@
|
||||
#define NS_THEME_SCROLLBAR 81
|
||||
|
||||
// A scrollbar button (up/down/left/right)
|
||||
#define NS_THEME_SCROLLBAR_BUTTON 82
|
||||
#define NS_THEME_SCROLLBAR_BUTTON_UP 82
|
||||
#define NS_THEME_SCROLLBAR_BUTTON_DOWN 83
|
||||
#define NS_THEME_SCROLLBAR_BUTTON_LEFT 84
|
||||
#define NS_THEME_SCROLLBAR_BUTTON_RIGHT 85
|
||||
|
||||
// The scrollbar track
|
||||
#define NS_THEME_SCROLLBAR_TRACK 83
|
||||
|
||||
// The start of a scrollbar track
|
||||
#define NS_THEME_SCROLLBAR_TRACK_START 84
|
||||
|
||||
// The end of a scrollbar track
|
||||
#define NS_THEME_SCROLLBAR_TRACK_END 85
|
||||
#define NS_THEME_SCROLLBAR_TRACK_HORIZONTAL 86
|
||||
#define NS_THEME_SCROLLBAR_TRACK_VERTICAL 87
|
||||
|
||||
// The scrollbar thumb
|
||||
#define NS_THEME_SCROLLBAR_THUMB 86
|
||||
#define NS_THEME_SCROLLBAR_THUMB_HORIZONTAL 88
|
||||
#define NS_THEME_SCROLLBAR_THUMB_VERTICAL 89
|
||||
|
||||
// The gripper that goes on the thumb
|
||||
#define NS_THEME_SCROLLBAR_GRIPPER 87
|
||||
#define NS_THEME_SCROLLBAR_GRIPPER_HORIZONTAL 90
|
||||
#define NS_THEME_SCROLLBAR_GRIPPER_VERTICAL 91
|
||||
|
||||
// A textfield or text area
|
||||
#define NS_THEME_TEXTFIELD 91
|
||||
#define NS_THEME_TEXTFIELD 95
|
||||
|
||||
// The caret of a text area
|
||||
#define NS_THEME_TEXTFIELD_CARET 92
|
||||
#define NS_THEME_TEXTFIELD_CARET 96
|
||||
|
||||
// A dropdown list.
|
||||
#define NS_THEME_DROPDOWN 101
|
||||
|
@ -98,8 +98,8 @@ WIN_LIBS= \
|
||||
!if defined(NGLAYOUT_DDRAW)
|
||||
ole32.lib \
|
||||
!endif
|
||||
winspool.lib \
|
||||
comdlg32.lib
|
||||
winspool.lib \
|
||||
comdlg32.lib
|
||||
|
||||
LLFLAGS = $(LLFLAGS)
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
@ -356,12 +356,16 @@ NS_IMETHODIMP nsDeviceContextWin :: GetScrollBarDimensions(float &aWidth, float
|
||||
}
|
||||
|
||||
nsresult nsDeviceContextWin::CopyLogFontToNSFont(HDC* aHDC, const LOGFONT* ptrLogFont,
|
||||
nsFont* aFont) const
|
||||
nsFont* aFont, PRBool aIsWide) const
|
||||
{
|
||||
PRUnichar name[LF_FACESIZE];
|
||||
name[0] = 0;
|
||||
MultiByteToWideChar(CP_ACP, 0, ptrLogFont->lfFaceName,
|
||||
strlen(ptrLogFont->lfFaceName) + 1, name, sizeof(name)/sizeof(name[0]));
|
||||
if (aIsWide)
|
||||
memcpy(name, ptrLogFont->lfFaceName, LF_FACESIZE*2);
|
||||
else {
|
||||
MultiByteToWideChar(CP_ACP, 0, ptrLogFont->lfFaceName,
|
||||
strlen(ptrLogFont->lfFaceName) + 1, name, sizeof(name)/sizeof(name[0]));
|
||||
}
|
||||
aFont->name = name;
|
||||
|
||||
// Do Style
|
||||
|
@ -104,7 +104,8 @@ protected:
|
||||
void ComputeFullAreaUsingScreen ( nsRect* outRect ) ;
|
||||
nsresult GetSysFontInfo(HDC aHDC, nsSystemFontID anID, nsFont* aFont) const;
|
||||
|
||||
nsresult CopyLogFontToNSFont(HDC* aHDC, const LOGFONT* ptrLogFont, nsFont* aFont) const;
|
||||
nsresult CopyLogFontToNSFont(HDC* aHDC, const LOGFONT* ptrLogFont, nsFont* aFont,
|
||||
PRBool aIsWide = PR_FALSE) const;
|
||||
|
||||
PRBool mCachedClientRect;
|
||||
PRBool mCachedFullRect;
|
||||
|
@ -54,6 +54,7 @@
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsIPresContext.h"
|
||||
#include "nsILookAndFeel.h"
|
||||
#include <malloc.h>
|
||||
|
||||
#define THEME_COLOR 204
|
||||
#define THEME_FONT 210
|
||||
@ -137,14 +138,11 @@ nsNativeThemeWin::nsNativeThemeWin() {
|
||||
drawThemeBG = (DrawThemeBackgroundPtr)GetProcAddress(mThemeDLL, "DrawThemeBackground");
|
||||
getThemeContentRect = (GetThemeContentRectPtr)GetProcAddress(mThemeDLL, "GetThemeBackgroundContentRect");
|
||||
getThemePartSize = (GetThemePartSizePtr)GetProcAddress(mThemeDLL, "GetThemePartSize");
|
||||
getThemeFont = (GetThemeFontPtr)GetProcAddress(mThemeDLL, "GetThemeFont");
|
||||
getThemeSysFont = (GetThemeSysFontPtr)GetProcAddress(mThemeDLL, "GetThemeSysFont");
|
||||
getThemeTextMetrics = (GetThemeTextMetricsPtr)GetProcAddress(mThemeDLL, "GetThemeTextMetrics");
|
||||
getThemeColor = (GetThemeColorPtr)GetProcAddress(mThemeDLL, "GetThemeColor");
|
||||
|
||||
mCheckedAtom = getter_AddRefs(NS_NewAtom("checked"));
|
||||
mDisabledAtom = getter_AddRefs(NS_NewAtom("disabled"));
|
||||
mSBOrientAtom = getter_AddRefs(NS_NewAtom("sborient"));
|
||||
mSelectedAtom = getter_AddRefs(NS_NewAtom("selected"));
|
||||
mTypeAtom = getter_AddRefs(NS_NewAtom("type"));
|
||||
}
|
||||
@ -197,15 +195,26 @@ nsNativeThemeWin::GetTheme(PRUint8 aWidgetType)
|
||||
return mTabTheme;
|
||||
}
|
||||
case NS_THEME_SCROLLBAR:
|
||||
case NS_THEME_SCROLLBAR_TRACK:
|
||||
case NS_THEME_SCROLLBAR_BUTTON:
|
||||
case NS_THEME_SCROLLBAR_THUMB:
|
||||
case NS_THEME_SCROLLBAR_GRIPPER: {
|
||||
case NS_THEME_SCROLLBAR_TRACK_VERTICAL:
|
||||
case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL:
|
||||
case NS_THEME_SCROLLBAR_BUTTON_UP:
|
||||
case NS_THEME_SCROLLBAR_BUTTON_DOWN:
|
||||
case NS_THEME_SCROLLBAR_BUTTON_LEFT:
|
||||
case NS_THEME_SCROLLBAR_BUTTON_RIGHT:
|
||||
case NS_THEME_SCROLLBAR_THUMB_VERTICAL:
|
||||
case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL:
|
||||
case NS_THEME_SCROLLBAR_GRIPPER_VERTICAL:
|
||||
case NS_THEME_SCROLLBAR_GRIPPER_HORIZONTAL:
|
||||
{
|
||||
if (!mScrollbarTheme)
|
||||
mScrollbarTheme = openTheme(NULL, L"Scrollbar");
|
||||
return mScrollbarTheme;
|
||||
}
|
||||
case NS_THEME_STATUSBAR: {
|
||||
case NS_THEME_STATUSBAR:
|
||||
case NS_THEME_STATUSBAR_PANEL:
|
||||
case NS_THEME_STATUSBAR_RESIZER_PANEL:
|
||||
case NS_THEME_RESIZER:
|
||||
{
|
||||
if (!mStatusbarTheme)
|
||||
mStatusbarTheme = openTheme(NULL, L"Status");
|
||||
return mStatusbarTheme;
|
||||
@ -369,10 +378,12 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType,
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
case NS_THEME_SCROLLBAR_BUTTON: {
|
||||
case NS_THEME_SCROLLBAR_BUTTON_UP:
|
||||
case NS_THEME_SCROLLBAR_BUTTON_DOWN:
|
||||
case NS_THEME_SCROLLBAR_BUTTON_LEFT:
|
||||
case NS_THEME_SCROLLBAR_BUTTON_RIGHT: {
|
||||
aPart = SP_BUTTON;
|
||||
aState = 8; // Assume horizontal by default.
|
||||
// States are 4 vert up, 4 vert down, 4 horz left, 4 horz right
|
||||
aState = (aWidgetType - NS_THEME_SCROLLBAR_BUTTON_UP)*4;
|
||||
if (!aFrame)
|
||||
aState += BP_NORMAL;
|
||||
else if (IsDisabled(aFrame))
|
||||
@ -386,41 +397,19 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType,
|
||||
else
|
||||
aState += BP_NORMAL;
|
||||
}
|
||||
|
||||
if (aFrame) {
|
||||
nsCOMPtr<nsIContent> content;
|
||||
aFrame->GetContent(getter_AddRefs(content));
|
||||
|
||||
// Get our parent frame's orientation. If we are a horizontal scrollbar,
|
||||
// then subtract 8 from the result to get the correct offset.
|
||||
if (HasAttrValue(content, mSBOrientAtom, "vertical"))
|
||||
aState -= 8; // We're vertical instead.
|
||||
|
||||
// Are we the start button or end button? If we are the end button, add 4
|
||||
// to the result to get the correct offset.
|
||||
if (HasAttrValue(content, mTypeAtom, "increment"))
|
||||
aState += 4;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
case NS_THEME_SCROLLBAR_TRACK: {
|
||||
aPart = SP_TRACKSTARTHOR;
|
||||
case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL:
|
||||
case NS_THEME_SCROLLBAR_TRACK_VERTICAL: {
|
||||
aPart = (aWidgetType == NS_THEME_SCROLLBAR_TRACK_HORIZONTAL) ?
|
||||
SP_TRACKSTARTHOR : SP_TRACKSTARTVERT;
|
||||
aState = BP_NORMAL;
|
||||
if (aFrame) {
|
||||
nsCOMPtr<nsIContent> content;
|
||||
aFrame->GetContent(getter_AddRefs(content));
|
||||
|
||||
// Get our scrollbar frame's orientation. If we are a vertical scrollbar,
|
||||
// then add 2 to get the correct val
|
||||
if (HasAttrValue(content, mSBOrientAtom, "vertical"))
|
||||
aPart += 2; // We're vertical instead.
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
case NS_THEME_SCROLLBAR_THUMB: {
|
||||
aPart = SP_THUMBHOR;
|
||||
case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL:
|
||||
case NS_THEME_SCROLLBAR_THUMB_VERTICAL: {
|
||||
aPart = (aWidgetType == NS_THEME_SCROLLBAR_THUMB_HORIZONTAL) ?
|
||||
SP_THUMBHOR : SP_THUMBVERT;
|
||||
if (!aFrame)
|
||||
aState = BP_NORMAL;
|
||||
else if (IsDisabled(aFrame))
|
||||
@ -436,26 +425,19 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType,
|
||||
else
|
||||
aState = BP_NORMAL;
|
||||
}
|
||||
|
||||
if (aFrame) {
|
||||
nsCOMPtr<nsIContent> content;
|
||||
aFrame->GetContent(getter_AddRefs(content));
|
||||
|
||||
// Get our parent frame's orientation. If we are a horizontal scrollbar,
|
||||
// then subtract 8 from the result to get the correct offset.
|
||||
if (HasAttrValue(content, mSBOrientAtom, "vertical"))
|
||||
aPart = SP_THUMBVERT; // We're vertical instead.
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
case NS_THEME_SCROLLBAR_GRIPPER: {
|
||||
aPart = SP_GRIPPERHOR;
|
||||
case NS_THEME_SCROLLBAR_GRIPPER_VERTICAL:
|
||||
case NS_THEME_SCROLLBAR_GRIPPER_HORIZONTAL: {
|
||||
aPart = (aWidgetType == NS_THEME_SCROLLBAR_GRIPPER_HORIZONTAL) ?
|
||||
SP_GRIPPERHOR : SP_GRIPPERVERT;
|
||||
if (!aFrame)
|
||||
aState = BP_NORMAL;
|
||||
else if (IsDisabled(aFrame))
|
||||
aState = BP_DISABLED;
|
||||
else {
|
||||
// XXXdwh The gripper needs to get a hover attribute set on it, since it
|
||||
// never goes into :hover.
|
||||
PRInt32 eventState = GetContentState(aFrame);
|
||||
if (eventState & NS_EVENT_STATE_ACTIVE) // Hover is not also a requirement for
|
||||
// the gripper, since the drag is not canceled
|
||||
@ -466,22 +448,21 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType,
|
||||
else
|
||||
aState = BP_NORMAL;
|
||||
}
|
||||
|
||||
if (aFrame) {
|
||||
nsCOMPtr<nsIContent> content;
|
||||
aFrame->GetContent(getter_AddRefs(content));
|
||||
|
||||
if (HasAttrValue(content, mSBOrientAtom, "vertical"))
|
||||
aPart = SP_GRIPPERVERT; // We're vertical instead.
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
case NS_THEME_TOOLBOX:
|
||||
case NS_THEME_STATUSBAR: {
|
||||
case NS_THEME_STATUSBAR:
|
||||
case NS_THEME_SCROLLBAR: {
|
||||
aPart = aState = 0;
|
||||
return NS_OK; // These have no part or state.
|
||||
}
|
||||
case NS_THEME_STATUSBAR_PANEL:
|
||||
case NS_THEME_STATUSBAR_RESIZER_PANEL:
|
||||
case NS_THEME_RESIZER: {
|
||||
aPart = (aWidgetType - NS_THEME_STATUSBAR_PANEL) + 1;
|
||||
aState = BP_NORMAL;
|
||||
return NS_OK;
|
||||
}
|
||||
case NS_THEME_TAB: {
|
||||
aPart = TABP_TAB;
|
||||
if (!aFrame) {
|
||||
@ -585,15 +566,20 @@ nsNativeThemeWin::DrawWidgetBackground(nsIRenderingContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNativeThemeWin::GetWidgetPadding(nsIDeviceContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
nsMargin* aResult)
|
||||
nsNativeThemeWin::GetWidgetBorder(nsIDeviceContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
nsMargin* aResult)
|
||||
{
|
||||
if (!getThemeContentRect)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (aWidgetType == NS_THEME_TOOLBOX || aWidgetType == NS_THEME_TOOLBAR || aWidgetType == NS_THEME_STATUSBAR)
|
||||
if (aWidgetType == NS_THEME_TOOLBOX || aWidgetType == NS_THEME_TOOLBAR ||
|
||||
aWidgetType == NS_THEME_STATUSBAR ||
|
||||
aWidgetType == NS_THEME_RESIZER ||
|
||||
aWidgetType == NS_THEME_SCROLLBAR ||
|
||||
aWidgetType == NS_THEME_SCROLLBAR_TRACK_VERTICAL ||
|
||||
aWidgetType == NS_THEME_SCROLLBAR_TRACK_HORIZONTAL)
|
||||
return NS_OK; // Don't worry about it.
|
||||
|
||||
HANDLE theme = GetTheme(aWidgetType);
|
||||
@ -624,88 +610,6 @@ nsNativeThemeWin::GetWidgetPadding(nsIDeviceContext* aContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNativeThemeWin::GetWidgetFont(nsIDeviceContext* aContext,
|
||||
PRUint8 aWidgetType,
|
||||
nsFont* aFont)
|
||||
{
|
||||
if (!getThemeFont)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
HANDLE theme = GetTheme(aWidgetType);
|
||||
if (!theme)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
PRInt32 part, state;
|
||||
nsresult rv = GetThemePartAndState(nsnull, aWidgetType, part, state);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
nsDeviceContextWin* dcWin = (nsDeviceContextWin*)aContext;
|
||||
HWND hwnd;
|
||||
HDC tdc;
|
||||
if (!dcWin->mDC) {
|
||||
hwnd = (HWND)dcWin->mWidget;
|
||||
tdc = ::GetDC(hwnd);
|
||||
}
|
||||
else
|
||||
tdc = dcWin->mDC;
|
||||
|
||||
// Get our info.
|
||||
// LOGFONT logFont;
|
||||
// HRESULT res = getThemeFont(theme, tdc, part, state, THEME_FONT, &logFont);
|
||||
// if (FAILED(res)) {
|
||||
// Part didn't define a font. Get the font from the system metrics
|
||||
// instead.
|
||||
nsSystemFontID sysID;
|
||||
rv = GetSystemFont(aWidgetType, sysID);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
dcWin->GetSysFontInfo(tdc, sysID, aFont);
|
||||
// }
|
||||
// else
|
||||
// dcWin->CopyLogFontToNSFont(&tdc, &logFont, aFont);
|
||||
|
||||
// Release the dc
|
||||
if (!dcWin->mDC)
|
||||
::ReleaseDC(hwnd, tdc);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNativeThemeWin::GetWidgetColor(nsIPresContext* aPresContext,
|
||||
nsIRenderingContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
nscolor* aColor)
|
||||
{
|
||||
HANDLE theme = GetTheme(aWidgetType);
|
||||
|
||||
PRInt32 part, state;
|
||||
nsresult rv = GetThemePartAndState(aFrame, aWidgetType, part, state);
|
||||
|
||||
HDC hdc = ((nsRenderingContextWin*)aContext)->mDC;
|
||||
if (!hdc)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
//COLORREF color;
|
||||
//HRESULT res = getThemeColor(theme, hdc, part, state, THEME_COLOR, &color);
|
||||
//if (FAILED(res)) {
|
||||
// Try to get a system color based off the widget type.
|
||||
nsCOMPtr<nsILookAndFeel> lf;
|
||||
aPresContext->GetLookAndFeel(getter_AddRefs(lf));
|
||||
nsILookAndFeel::nsColorID colorID;
|
||||
rv = GetSystemColor(aWidgetType, colorID);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
lf->GetColor(colorID, *aColor);
|
||||
// }
|
||||
|
||||
// Copy the colorref into an nscolor.
|
||||
// *aColor = color;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNativeThemeWin::GetMinimumWidgetSize(nsIRenderingContext* aContext, nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
@ -714,7 +618,8 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsIRenderingContext* aContext, nsIFrame*
|
||||
if (!getThemePartSize)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (aWidgetType == NS_THEME_TOOLBOX || aWidgetType == NS_THEME_TOOLBAR || aWidgetType == NS_THEME_STATUSBAR)
|
||||
if (aWidgetType == NS_THEME_TOOLBOX || aWidgetType == NS_THEME_TOOLBAR ||
|
||||
aWidgetType == NS_THEME_STATUSBAR)
|
||||
return NS_OK; // Don't worry about it.
|
||||
|
||||
HANDLE theme = GetTheme(aWidgetType);
|
||||
@ -731,7 +636,8 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsIRenderingContext* aContext, nsIFrame*
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
PRInt32 sizeReq = 1; // Best-fit size.
|
||||
if (aWidgetType == NS_THEME_SCROLLBAR_THUMB)
|
||||
if (aWidgetType == NS_THEME_SCROLLBAR_THUMB_VERTICAL ||
|
||||
aWidgetType == NS_THEME_SCROLLBAR_THUMB_HORIZONTAL)
|
||||
sizeReq = 0; // Best-fit size for scrollbar thumbs is too large for most themes.
|
||||
// In our app, we want the thumb to be able to really shrink down,
|
||||
// so use the min-size request value (of 0).
|
||||
@ -748,7 +654,10 @@ nsNativeThemeWin::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType,
|
||||
{
|
||||
// Some widget types just never change state.
|
||||
if (aWidgetType == NS_THEME_TOOLBOX || aWidgetType == NS_THEME_TOOLBAR ||
|
||||
aWidgetType == NS_THEME_SCROLLBAR_TRACK || aWidgetType == NS_THEME_STATUSBAR) {
|
||||
aWidgetType == NS_THEME_SCROLLBAR_TRACK_VERTICAL ||
|
||||
aWidgetType == NS_THEME_SCROLLBAR_TRACK_HORIZONTAL ||
|
||||
aWidgetType == NS_THEME_STATUSBAR || aWidgetType == NS_THEME_STATUSBAR_PANEL ||
|
||||
aWidgetType == NS_THEME_STATUSBAR_RESIZER_PANEL) {
|
||||
*aShouldRepaint = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -38,20 +38,10 @@ public:
|
||||
const nsRect& aRect,
|
||||
const nsRect& aClipRect);
|
||||
|
||||
NS_IMETHOD GetWidgetPadding(nsIDeviceContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
nsMargin* aResult);
|
||||
|
||||
NS_IMETHOD GetWidgetFont(nsIDeviceContext* aContext,
|
||||
PRUint8 aWidgetType,
|
||||
nsFont* aFont);
|
||||
|
||||
NS_IMETHOD GetWidgetColor(nsIPresContext* aPresContext,
|
||||
nsIRenderingContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
nscolor* aFont);
|
||||
NS_IMETHOD GetWidgetBorder(nsIDeviceContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
nsMargin* aResult);
|
||||
|
||||
NS_IMETHOD GetMinimumWidgetSize(nsIRenderingContext* aContext, nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
@ -89,7 +79,6 @@ private:
|
||||
|
||||
nsCOMPtr<nsIAtom> mCheckedAtom;
|
||||
nsCOMPtr<nsIAtom> mDisabledAtom;
|
||||
nsCOMPtr<nsIAtom> mSBOrientAtom;
|
||||
nsCOMPtr<nsIAtom> mSelectedAtom;
|
||||
nsCOMPtr<nsIAtom> mTypeAtom;
|
||||
};
|
||||
|
@ -421,8 +421,8 @@ CSS_KEY(dualbutton, dualbutton)
|
||||
CSS_KEY(dualbutton-dropdown, dualbutton_dropdown)
|
||||
CSS_KEY(separator, separator)
|
||||
CSS_KEY(statusbar, statusbar)
|
||||
CSS_KEY(statusbarpane, statusbar_pane)
|
||||
CSS_KEY(resizerpane, resizer_pane)
|
||||
CSS_KEY(statusbarpanel, statusbarpanel)
|
||||
CSS_KEY(resizerpanel, resizerpanel)
|
||||
CSS_KEY(resizer, resizer)
|
||||
CSS_KEY(listbox, listbox)
|
||||
CSS_KEY(listitem, listitem)
|
||||
@ -441,12 +441,16 @@ CSS_KEY(tooltip, tooltip)
|
||||
CSS_KEY(spinner, spinner)
|
||||
CSS_KEY(spinner-upbutton, spinner_upbutton)
|
||||
CSS_KEY(spinner-downbutton, spinner_downbutton)
|
||||
CSS_KEY(scrollbarbutton, scrollbarbutton)
|
||||
CSS_KEY(scrollbartrack, scrollbartrack)
|
||||
CSS_KEY(scrollbartrackstart, scrollbartrackstart)
|
||||
CSS_KEY(scrollbartrackend, scrollbartrackend)
|
||||
CSS_KEY(scrollbarthumb, scrollbarthumb)
|
||||
CSS_KEY(scrollbargripper, scrollbargripper)
|
||||
CSS_KEY(scrollbarbutton-up, scrollbarbutton_up)
|
||||
CSS_KEY(scrollbarbutton-down, scrollbarbutton_down)
|
||||
CSS_KEY(scrollbarbutton-left, scrollbarbutton_left)
|
||||
CSS_KEY(scrollbarbutton-right, scrollbarbutton_right)
|
||||
CSS_KEY(scrollbartrack-horizontal, scrollbartrack_horizontal)
|
||||
CSS_KEY(scrollbartrack-vertical, scrollbartrack_vertical)
|
||||
CSS_KEY(scrollbarthumb-horizontal, scrollbarthumb_horizontal)
|
||||
CSS_KEY(scrollbarthumb-vertical, scrollbarthumb_vertical)
|
||||
CSS_KEY(scrollbargripper-horizontal, scrollbargripper_horizontal)
|
||||
CSS_KEY(scrollbargripper-vertical, scrollbargripper_vertical)
|
||||
CSS_KEY(textfield, textfield)
|
||||
CSS_KEY(caret, caret)
|
||||
CSS_KEY(menulist, menulist)
|
||||
|
@ -3955,19 +3955,6 @@ PRBool CSSParserImpl::ParseAzimuth(PRInt32& aErrorCode, nsCSSValue& aValue)
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
static PRBool HasForegroundContent(PRUint8 aAppearance)
|
||||
{
|
||||
return ((aAppearance == NS_THEME_BUTTON) ||
|
||||
(aAppearance == NS_THEME_TOOLBAR_BUTTON) ||
|
||||
(aAppearance == NS_THEME_TOOLBAR_DUAL_BUTTON) ||
|
||||
(aAppearance == NS_THEME_LISTBOX_LISTITEM) ||
|
||||
(aAppearance == NS_THEME_TREEVIEW_TREEITEM) ||
|
||||
(aAppearance == NS_THEME_TREEVIEW_HEADER_CELL) ||
|
||||
(aAppearance == NS_THEME_TAB) ||
|
||||
(aAppearance == NS_THEME_TOOLTIP) ||
|
||||
(aAppearance == NS_THEME_TEXTFIELD));
|
||||
}
|
||||
|
||||
PRBool CSSParserImpl::ParseAppearance(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration,
|
||||
PRInt32& aChangeHint)
|
||||
{
|
||||
@ -3980,24 +3967,6 @@ PRBool CSSParserImpl::ParseAppearance(PRInt32& aErrorCode, nsICSSDeclaration* aD
|
||||
else
|
||||
return PR_FALSE;
|
||||
|
||||
if (appearance.GetIntValue() && HasForegroundContent(appearance.GetIntValue())) {
|
||||
// When an appearance is specified, it can act as a shorthand that
|
||||
// specifies color and font information as well.
|
||||
// Add in font information.
|
||||
PRInt32 index = SearchKeywordTable(eCSSKeyword_theme, nsCSSProps::kFontKTable);
|
||||
if (index > 0) {
|
||||
nsCSSValue val(nsCSSProps::kFontKTable[index], eCSSUnit_Enumerated);
|
||||
AppendValue(aDeclaration, eCSSProperty_font_family, val, aChangeHint);
|
||||
}
|
||||
|
||||
// Add in color information.
|
||||
index = SearchKeywordTable(eCSSKeyword_theme, nsCSSProps::kColorKTable);
|
||||
if (index > 0) {
|
||||
nsCSSValue val(nsCSSProps::kColorKTable[index], eCSSUnit_Integer);
|
||||
AppendValue(aDeclaration, eCSSProperty_color, val, aChangeHint);
|
||||
}
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
|
@ -137,8 +137,8 @@ const PRInt32 nsCSSProps::kAppearanceKTable[] = {
|
||||
eCSSKeyword_dualbutton_dropdown, NS_THEME_TOOLBAR_DUAL_BUTTON_DROPDOWN,
|
||||
eCSSKeyword_separator, NS_THEME_TOOLBAR_SEPARATOR,
|
||||
eCSSKeyword_statusbar, NS_THEME_STATUSBAR,
|
||||
eCSSKeyword_statusbar_pane, NS_THEME_STATUSBAR_PANE,
|
||||
eCSSKeyword_resizer_pane, NS_THEME_STATUSBAR_RESIZER_PANE,
|
||||
eCSSKeyword_statusbarpanel, NS_THEME_STATUSBAR_PANEL,
|
||||
eCSSKeyword_resizerpanel, NS_THEME_STATUSBAR_RESIZER_PANEL,
|
||||
eCSSKeyword_resizer, NS_THEME_RESIZER,
|
||||
eCSSKeyword_listbox, NS_THEME_LISTBOX,
|
||||
eCSSKeyword_listitem, NS_THEME_LISTBOX_LISTITEM,
|
||||
@ -158,12 +158,16 @@ const PRInt32 nsCSSProps::kAppearanceKTable[] = {
|
||||
eCSSKeyword_spinner_upbutton, NS_THEME_SPINNER_UP_BUTTON,
|
||||
eCSSKeyword_spinner_downbutton, NS_THEME_SPINNER_DOWN_BUTTON,
|
||||
eCSSKeyword_scrollbar, NS_THEME_SCROLLBAR,
|
||||
eCSSKeyword_scrollbarbutton, NS_THEME_SCROLLBAR_BUTTON,
|
||||
eCSSKeyword_scrollbartrack, NS_THEME_SCROLLBAR_TRACK,
|
||||
eCSSKeyword_scrollbartrackstart, NS_THEME_SCROLLBAR_TRACK_START,
|
||||
eCSSKeyword_scrollbartrackend, NS_THEME_SCROLLBAR_TRACK_END,
|
||||
eCSSKeyword_scrollbarthumb, NS_THEME_SCROLLBAR_THUMB,
|
||||
eCSSKeyword_scrollbargripper, NS_THEME_SCROLLBAR_GRIPPER,
|
||||
eCSSKeyword_scrollbarbutton_up, NS_THEME_SCROLLBAR_BUTTON_UP,
|
||||
eCSSKeyword_scrollbarbutton_down, NS_THEME_SCROLLBAR_BUTTON_DOWN,
|
||||
eCSSKeyword_scrollbarbutton_left, NS_THEME_SCROLLBAR_BUTTON_LEFT,
|
||||
eCSSKeyword_scrollbarbutton_right, NS_THEME_SCROLLBAR_BUTTON_RIGHT,
|
||||
eCSSKeyword_scrollbartrack_horizontal, NS_THEME_SCROLLBAR_TRACK_HORIZONTAL,
|
||||
eCSSKeyword_scrollbartrack_vertical, NS_THEME_SCROLLBAR_TRACK_VERTICAL,
|
||||
eCSSKeyword_scrollbarthumb_horizontal, NS_THEME_SCROLLBAR_THUMB_HORIZONTAL,
|
||||
eCSSKeyword_scrollbarthumb_vertical, NS_THEME_SCROLLBAR_THUMB_VERTICAL,
|
||||
eCSSKeyword_scrollbargripper_horizontal, NS_THEME_SCROLLBAR_GRIPPER_HORIZONTAL,
|
||||
eCSSKeyword_scrollbargripper_vertical, NS_THEME_SCROLLBAR_GRIPPER_VERTICAL,
|
||||
eCSSKeyword_textfield, NS_THEME_TEXTFIELD,
|
||||
eCSSKeyword_caret, NS_THEME_TEXTFIELD_CARET,
|
||||
eCSSKeyword_menulist, NS_THEME_DROPDOWN,
|
||||
|
@ -1833,23 +1833,7 @@ SetFont(nsIPresContext* aPresContext, nsIStyleContext* aContext,
|
||||
if (dc) {
|
||||
// GetSystemFont sets the font face but not necessarily the size
|
||||
aFont->mFont.size = defaultVariableFont.size;
|
||||
// If our font type is theme, then check for appearance data and
|
||||
// obtain our font based off our widget type.
|
||||
if (sysID == eSystemFont_Theme) {
|
||||
const nsStyleDisplay* display = (const nsStyleDisplay*)
|
||||
aContext->GetStyleData(eStyleStruct_Display);
|
||||
if (display->mAppearance) {
|
||||
// Get our theme.
|
||||
nsCOMPtr<nsITheme> theme;
|
||||
aPresContext->GetTheme(getter_AddRefs(theme));
|
||||
if (theme) {
|
||||
nsCOMPtr<nsIDeviceContext> deviceContext;
|
||||
aPresContext->GetDeviceContext(getter_AddRefs(deviceContext));
|
||||
theme->GetWidgetFont(deviceContext, display->mAppearance, &aFont->mFont);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (NS_FAILED(dc->GetSystemFont(sysID, &aFont->mFont))) {
|
||||
if (NS_FAILED(dc->GetSystemFont(sysID, &aFont->mFont))) {
|
||||
aFont->mFont.name = defaultVariableFont.name;
|
||||
}
|
||||
aFont->mSize = aFont->mFont.size; // this becomes our cascading size
|
||||
|
@ -1029,13 +1029,13 @@ PRInt32 nsStyleDisplay::CalcDifference(const nsStyleDisplay& aOther) const
|
||||
|
||||
if ((mDisplay == aOther.mDisplay) &&
|
||||
(mFloats == aOther.mFloats) &&
|
||||
(mOverflow == aOther.mOverflow) &&
|
||||
(mAppearance == aOther.mAppearance)) {
|
||||
(mOverflow == aOther.mOverflow)) {
|
||||
if ((mBreakType == aOther.mBreakType) &&
|
||||
(mBreakBefore == aOther.mBreakBefore) &&
|
||||
(mBreakAfter == aOther.mBreakAfter) &&
|
||||
(mClipFlags == aOther.mClipFlags) &&
|
||||
(mClip == aOther.mClip)) {
|
||||
(mClip == aOther.mClip) &&
|
||||
(mAppearance == aOther.mAppearance)) {
|
||||
return NS_STYLE_HINT_NONE;
|
||||
}
|
||||
return NS_STYLE_HINT_REFLOW;
|
||||
|
@ -665,8 +665,8 @@ nsBox::GetBorder(nsMargin& aMargin)
|
||||
nsCOMPtr<nsIDeviceContext> dc;
|
||||
context->GetDeviceContext(getter_AddRefs(dc));
|
||||
nsMargin margin(0,0,0,0);
|
||||
gTheme->GetWidgetPadding(dc, frame,
|
||||
disp->mAppearance, &margin);
|
||||
gTheme->GetWidgetBorder(dc, frame,
|
||||
disp->mAppearance, &margin);
|
||||
float p2t;
|
||||
context->GetScaledPixelsToTwips(&p2t);
|
||||
aMargin.top = NSIntPixelsToTwips(margin.top, p2t);
|
||||
|
@ -405,33 +405,7 @@ nsTextBoxFrame::PaintTitle(nsIPresContext* aPresContext,
|
||||
CalculateUnderline(aRenderingContext);
|
||||
|
||||
const nsStyleColor* colorStyle = (const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color);
|
||||
PRBool useStyleColor = PR_TRUE;
|
||||
if (colorStyle->mColorFlags & NS_COLORFLAGS_THEME) {
|
||||
// Obtain the color dynamically from the theme if possible.
|
||||
nsCOMPtr<nsITheme> theme;
|
||||
aPresContext->GetTheme(getter_AddRefs(theme));
|
||||
if (theme) {
|
||||
// Find the nearest enclosing style context that defined an appearance.
|
||||
nsIFrame* curr = this;
|
||||
while (curr) {
|
||||
const nsStyleDisplay* disp;
|
||||
curr->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)disp);
|
||||
if (disp->mAppearance) {
|
||||
nscolor color;
|
||||
if (NS_SUCCEEDED(theme->GetWidgetColor(aPresContext, &aRenderingContext, curr,
|
||||
disp->mAppearance, &color))) {
|
||||
useStyleColor = PR_FALSE;
|
||||
aRenderingContext.SetColor(color);
|
||||
}
|
||||
break;
|
||||
}
|
||||
curr->GetParent(&curr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (useStyleColor)
|
||||
aRenderingContext.SetColor(colorStyle->mColor);
|
||||
aRenderingContext.SetColor(colorStyle->mColor);
|
||||
|
||||
#ifdef IBMBIDI
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
|
@ -30,6 +30,7 @@
|
||||
/* :::::::::: button :::::::::: */
|
||||
|
||||
button {
|
||||
-moz-appearance: button;
|
||||
margin: 1px 5px 2px 5px;
|
||||
min-width: 6.3em;
|
||||
border: 3px solid;
|
||||
@ -42,7 +43,6 @@ button {
|
||||
}
|
||||
|
||||
.button-box {
|
||||
margin: 1px;
|
||||
border: 1px solid transparent;
|
||||
padding: 1px 4px 2px 3px;
|
||||
}
|
||||
|
@ -68,6 +68,7 @@ checkbox[disabled="true"] {
|
||||
/* ::::: checkmark image ::::: */
|
||||
|
||||
.checkbox-check {
|
||||
-moz-appearance: checkbox;
|
||||
-moz-box-align: center;
|
||||
border: 2px solid;
|
||||
-moz-border-top-colors: ThreeDShadow ThreeDDarkShadow;
|
||||
|
@ -106,6 +106,7 @@ iframe {
|
||||
/* ::::: statusbar ::::: */
|
||||
|
||||
statusbar {
|
||||
-moz-appearance: statusbar;
|
||||
border-top: 1px solid ThreeDLightShadow;
|
||||
border-left: 1px solid ThreeDShadow;
|
||||
border-right: 1px solid ThreeDHighlight;
|
||||
@ -116,7 +117,8 @@ statusbar {
|
||||
background-color: -moz-Dialog;
|
||||
}
|
||||
|
||||
statusbarpanel {
|
||||
statusbarpanel, .statusbar-resizerpanel {
|
||||
-moz-appearance: statusbarpanel;
|
||||
-moz-box-align: center;
|
||||
-moz-box-pack: center;
|
||||
border-left: 1px solid ThreeDHighlight;
|
||||
@ -126,6 +128,13 @@ statusbarpanel {
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.statusbar-resizerpanel {
|
||||
-moz-box-align: end;
|
||||
-moz-box-pack: end;
|
||||
-moz-appearance: resizerpanel;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.statusbarpanel-iconic {
|
||||
padding: 0px;
|
||||
}
|
||||
|
@ -30,6 +30,7 @@
|
||||
/* ::::: scrollbar ::::: */
|
||||
|
||||
scrollbar {
|
||||
-moz-appearance: scrollbar;
|
||||
-moz-binding: url("chrome://global/content/bindings/scrollbar.xml#scrollbar");
|
||||
cursor: default;
|
||||
}
|
||||
@ -37,11 +38,13 @@ scrollbar {
|
||||
/* ::::: slider ::::: */
|
||||
|
||||
slider {
|
||||
-moz-appearance: scrollbartrack-horizontal;
|
||||
height: 16px;
|
||||
background: url("chrome://global/skin/scrollbar/slider.gif") scrollbar;
|
||||
}
|
||||
|
||||
slider[orient="vertical"] {
|
||||
-moz-appearance: scrollbartrack-vertical;
|
||||
width: 16px;
|
||||
}
|
||||
|
||||
@ -60,18 +63,26 @@ scrollbarbutton {
|
||||
/* ::::: thumb (horizontal) ::::: */
|
||||
|
||||
thumb {
|
||||
-moz-appearance: scrollbarthumb-vertical;
|
||||
min-height: 8px;
|
||||
}
|
||||
|
||||
thumb[orient="horizontal"] {
|
||||
-moz-appearance: scrollbarthumb-horizontal;
|
||||
min-width: 8px;
|
||||
}
|
||||
|
||||
thumb > gripper {
|
||||
-moz-appearance: scrollbargripper-vertical;
|
||||
}
|
||||
|
||||
thumb[orient="horizontal"] > gripper {
|
||||
-moz-appearance: scrollbargripper-horizontal;
|
||||
}
|
||||
|
||||
/* ::::: scrollbar button ::::: */
|
||||
|
||||
scrollbarbutton {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background: -moz-Dialog no-repeat 0px 1px;
|
||||
}
|
||||
|
||||
@ -86,20 +97,24 @@ scrollbarbutton:hover:active {
|
||||
/* ..... increment .... */
|
||||
|
||||
scrollbarbutton[type="increment"] {
|
||||
-moz-appearance: scrollbarbutton-right;
|
||||
background-image: url("chrome://global/skin/arrow/arrow-rit.gif")
|
||||
}
|
||||
|
||||
scrollbar[orient="vertical"] > scrollbarbutton[type="increment"] {
|
||||
-moz-appearance: scrollbarbutton-down;
|
||||
background-image: url("chrome://global/skin/arrow/arrow-dn.gif")
|
||||
}
|
||||
|
||||
/* ..... decrement .... */
|
||||
|
||||
scrollbarbutton[type="decrement"] {
|
||||
-moz-appearance: scrollbarbutton-left;
|
||||
background-image: url("chrome://global/skin/arrow/arrow-lft.gif")
|
||||
}
|
||||
|
||||
scrollbar[orient="vertical"] > scrollbarbutton[type="decrement"] {
|
||||
-moz-appearance: scrollbarbutton-up;
|
||||
background-image: url("chrome://global/skin/arrow/arrow-up.gif")
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
/* ::::: toolbox ::::: */
|
||||
|
||||
toolbox {
|
||||
-moz-appearance: toolbox;
|
||||
background-color: -moz-Dialog;
|
||||
border-left: 1px solid ThreeDShadow;
|
||||
border-top: 1px solid ThreeDShadow;
|
||||
|
@ -30,6 +30,7 @@
|
||||
/* ::::: toolbarbutton ::::: */
|
||||
|
||||
toolbarbutton {
|
||||
-moz-appearance: toolbarbutton;
|
||||
-moz-box-align: center;
|
||||
-moz-box-pack: center;
|
||||
margin: 0;
|
||||
|
@ -228,6 +228,15 @@
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
<binding id="statusbar">
|
||||
<content>
|
||||
<children/>
|
||||
<xul:statusbarpanel class="statusbar-resizerpanel">
|
||||
<xul:resizer dir="bottomright" style="-moz-appearance: resizer; cursor: se-resize"/>
|
||||
</xul:statusbarpanel>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="statusbarpanel-iconic" display="xul:button"
|
||||
extends="chrome://global/content/bindings/general.xml#statusbarpanel">
|
||||
<content>
|
||||
|
@ -4,15 +4,19 @@
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="thumb" extends="xul:button">
|
||||
<content>
|
||||
<xul:gripper/>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="scrollbar">
|
||||
<content>
|
||||
<xul:scrollbarbutton sbattr="scrollbar-up-top" type="decrement" inherits="sborient=orient"/>
|
||||
<xul:scrollbarbutton sbattr="scrollbar-down-top" type="increment" hidden="true" inherits="sborient=orient"/>
|
||||
<xul:slider flex="1" inherits="curpos,maxpos,pageincrement,increment,orient,sborient=orient">
|
||||
<xul:thumb sbattr="scrollbar-thumb" inherits="orient,sborient=orient"
|
||||
align="center" pack="center" flex="1">
|
||||
<xul:gripper/>
|
||||
</xul:thumb>
|
||||
align="center" pack="center" flex="1"/>
|
||||
</xul:slider>
|
||||
<xul:scrollbarbutton sbattr="scrollbar-up-bottom" type="decrement" hidden="true" inherits="sborient=orient"/>
|
||||
<xul:scrollbarbutton sbattr="scrollbar-down-bottom" type="increment" inherits="sborient=orient"/>
|
||||
|
@ -618,6 +618,11 @@ scrollbar {
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
thumb
|
||||
{
|
||||
-moz-binding: url(chrome://global/content/bindings/scrollbar.xml#thumb);
|
||||
}
|
||||
|
||||
scrollbar, scrollbarbutton, slider, thumb {
|
||||
-moz-user-select: none;
|
||||
}
|
||||
@ -642,6 +647,11 @@ autorepeatbutton {
|
||||
|
||||
/********** statusbar **********/
|
||||
|
||||
statusbar
|
||||
{
|
||||
-moz-binding: url("chrome://global/content/bindings/general.xml#statusbar");
|
||||
}
|
||||
|
||||
statusbarpanel {
|
||||
-moz-binding: url("chrome://global/content/bindings/general.xml#statusbarpanel");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user