зеркало из https://github.com/mozilla/pjs.git
Bug 429188. Support CSS colors for 'odd tree row' and 'even tree row' on all platforms. patch by stefanh@inbox.com, r+sr=roc,r=gavin,a=beltzner
This commit is contained in:
Родитель
04a7b90038
Коммит
b9b8a4a294
|
@ -96,6 +96,7 @@ CSS_KEY(-moz-dialog, _moz_dialog)
|
|||
CSS_KEY(-moz-dialogtext, _moz_dialogtext)
|
||||
CSS_KEY(-moz-document, _moz_document)
|
||||
CSS_KEY(-moz-dragtargetzone, _moz_dragtargetzone)
|
||||
CSS_KEY(-moz-eventreerow, _moz_eventreerow)
|
||||
CSS_KEY(-moz-ethiopic-halehame, _moz_ethiopic_halehame)
|
||||
CSS_KEY(-moz-ethiopic-numeric, _moz_ethiopic_numeric)
|
||||
CSS_KEY(-moz-ethiopic-halehame-am, _moz_ethiopic_halehame_am)
|
||||
|
@ -154,7 +155,7 @@ CSS_KEY(-moz-middle-with-baseline, _moz_middle_with_baseline)
|
|||
CSS_KEY(-moz-min-content, _moz_min_content)
|
||||
CSS_KEY(-moz-myanmar, _moz_myanmar)
|
||||
CSS_KEY(-moz-none, _moz_none)
|
||||
CSS_KEY(-moz-oddrowbackground, _moz_oddrowbackground)
|
||||
CSS_KEY(-moz-oddtreerow, _moz_oddtreerow)
|
||||
CSS_KEY(-moz-oriya, _moz_oriya)
|
||||
CSS_KEY(-moz-persian, _moz_persian)
|
||||
CSS_KEY(-moz-popup, _moz_popup)
|
||||
|
|
|
@ -437,6 +437,7 @@ const PRInt32 nsCSSProps::kColorKTable[] = {
|
|||
eCSSKeyword__moz_buttonhovertext, nsILookAndFeel::eColor__moz_buttonhovertext,
|
||||
eCSSKeyword__moz_cellhighlight, nsILookAndFeel::eColor__moz_cellhighlight,
|
||||
eCSSKeyword__moz_cellhighlighttext, nsILookAndFeel::eColor__moz_cellhighlighttext,
|
||||
eCSSKeyword__moz_eventreerow, nsILookAndFeel::eColor__moz_eventreerow,
|
||||
eCSSKeyword__moz_field, nsILookAndFeel::eColor__moz_field,
|
||||
eCSSKeyword__moz_fieldtext, nsILookAndFeel::eColor__moz_fieldtext,
|
||||
eCSSKeyword__moz_dialog, nsILookAndFeel::eColor__moz_dialog,
|
||||
|
@ -462,7 +463,7 @@ const PRInt32 nsCSSProps::kColorKTable[] = {
|
|||
eCSSKeyword__moz_menuhover, nsILookAndFeel::eColor__moz_menuhover,
|
||||
eCSSKeyword__moz_menuhovertext, nsILookAndFeel::eColor__moz_menuhovertext,
|
||||
eCSSKeyword__moz_menubarhovertext, nsILookAndFeel::eColor__moz_menubarhovertext,
|
||||
eCSSKeyword__moz_oddrowbackground, nsILookAndFeel::eColor__moz_oddrowbackground,
|
||||
eCSSKeyword__moz_oddtreerow, nsILookAndFeel::eColor__moz_oddtreerow,
|
||||
eCSSKeyword__moz_visitedhyperlinktext, NS_COLOR_MOZ_VISITEDHYPERLINKTEXT,
|
||||
eCSSKeyword_currentcolor, NS_COLOR_CURRENTCOLOR,
|
||||
eCSSKeyword_UNKNOWN,-1
|
||||
|
|
|
@ -21,7 +21,7 @@ richlistitem[type="download"][selected="true"] {
|
|||
}
|
||||
|
||||
richlistitem[type="download"][alternate="true"]:not([selected="true"]) {
|
||||
background-color: -moz-oddrowbackground;
|
||||
background-color: -moz-oddtreerow;
|
||||
}
|
||||
|
||||
richlistitem[type="download"] .name {
|
||||
|
|
|
@ -75,7 +75,7 @@ treechildren::-moz-tree-row {
|
|||
}
|
||||
|
||||
tree:not([hidecolumnpicker="true"]) treechildren::-moz-tree-row(odd) {
|
||||
background-color: -moz-oddrowbackground;
|
||||
background-color: -moz-oddtreerow;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-row(selected),
|
||||
|
@ -368,7 +368,7 @@ treechildren::-moz-tree-cell-text(Name, separator, selected, focus) {
|
|||
/* ::::: alternating background ::::: */
|
||||
|
||||
treechildren[alternatingbackground="true"]::-moz-tree-row(odd) {
|
||||
background-color: -moz-oddrowbackground;
|
||||
background-color: -moz-oddtreerow;
|
||||
}
|
||||
|
||||
treechildren[alternatingbackground="true"]::-moz-tree-row(odd, selected) {
|
||||
|
|
|
@ -13,7 +13,7 @@ richlistitem[type="download"] {
|
|||
}
|
||||
|
||||
richlistitem[type="download"][alternate="true"]:not([selected="true"]) {
|
||||
background-color: -moz-oddrowbackground;
|
||||
background-color: -moz-oddtreerow;
|
||||
}
|
||||
|
||||
richlistitem[type="download"] .name {
|
||||
|
|
|
@ -136,7 +136,10 @@ public:
|
|||
eColor__moz_menuhover, //used to menu item background, when mouse is over
|
||||
eColor__moz_menuhovertext, //used to menu item text, when mouse is over
|
||||
eColor__moz_menubarhovertext, //used to menu bar item text, when mouse is over
|
||||
eColor__moz_oddrowbackground, //background color of odd list rows
|
||||
// On platforms where these colors are the same as
|
||||
// -moz-field, use -moz-fieldtext as foreground color
|
||||
eColor__moz_eventreerow,
|
||||
eColor__moz_oddtreerow,
|
||||
|
||||
//colours needed by Mac Classic skin
|
||||
eColor__moz_mac_focusring, //ring around text fields and lists
|
||||
|
|
|
@ -252,7 +252,8 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor)
|
|||
case eColor_windowtext:
|
||||
aColor = NS_RGB(0x00, 0x00, 0x00);
|
||||
break;
|
||||
// CSS3 candidates
|
||||
case eColor__moz_eventreerow:
|
||||
case eColor__moz_oddtreerow:
|
||||
case eColor__moz_field:
|
||||
// normal widget background
|
||||
aColor = NS_RGB(0xff, 0xff, 0xff);
|
||||
|
|
|
@ -342,8 +342,12 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor)
|
|||
// For inactive list selection
|
||||
res = GetMacBrushColor(kThemeBrushSecondaryHighlightColor, aColor, NS_RGB(0x00,0x00,0x00));
|
||||
break;
|
||||
case eColor__moz_oddrowbackground:
|
||||
// Background color of odd list rows. Note that Apple's row index is different from ours.
|
||||
case eColor__moz_eventreerow:
|
||||
// Background color of even list rows. Note that Apple's row index is different from ours.
|
||||
res = GetMacBrushColor(kThemeBrushListViewOddRowBackground, aColor, NS_RGB(0xFF,0xFF,0xFF));
|
||||
break;
|
||||
case eColor__moz_oddtreerow:
|
||||
// Background color of odd list rows.
|
||||
res = GetMacBrushColor(kThemeBrushListViewEvenRowBackground, aColor, NS_RGB(0xF0,0xF0,0xF0));
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -261,9 +261,7 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor& aColor)
|
|||
aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_NORMAL]);
|
||||
break;
|
||||
|
||||
// from the CSS3 working draft (not yet finalized)
|
||||
// http://www.w3.org/tr/2000/wd-css3-userint-20000216.html#color
|
||||
|
||||
case eColor__moz_eventreerow:
|
||||
case eColor__moz_field:
|
||||
aColor = GDK_COLOR_TO_NS_RGB(mStyle->base[GTK_STATE_NORMAL]);
|
||||
break;
|
||||
|
@ -303,7 +301,7 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor& aColor)
|
|||
case eColor__moz_menuhovertext:
|
||||
aColor = sMenuHoverText;
|
||||
break;
|
||||
case eColor__moz_oddrowbackground:
|
||||
case eColor__moz_oddtreerow:
|
||||
aColor = sOddCellBackground;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -204,6 +204,8 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor)
|
|||
case eColor_windowtext:
|
||||
idx = SYSCLR_WINDOWTEXT;
|
||||
break;
|
||||
case eColor__moz_eventreerow:
|
||||
case eColor__moz_oddtreerow:
|
||||
case eColor__moz_field:
|
||||
idx = SYSCLR_ENTRYFIELD;
|
||||
break;
|
||||
|
|
|
@ -214,9 +214,8 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor)
|
|||
aColor = PH_TO_NS_RGB(Pg_BLACK);
|
||||
break;
|
||||
|
||||
// from the CSS3 working draft (not yet finalized)
|
||||
// http://www.w3.org/tr/2000/wd-css3-userint-20000216.html#color
|
||||
|
||||
case eColor__moz_eventreerow:
|
||||
case eColor__moz_oddtreerow:
|
||||
case eColor__moz_field:
|
||||
aColor = PH_TO_NS_RGB(Pg_WHITE);
|
||||
break;
|
||||
|
|
|
@ -334,6 +334,8 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor)
|
|||
case eColor_windowtext:
|
||||
idx = COLOR_WINDOWTEXT;
|
||||
break;
|
||||
case eColor__moz_eventreerow:
|
||||
case eColor__moz_oddtreerow:
|
||||
case eColor__moz_field:
|
||||
idx = COLOR_WINDOW;
|
||||
break;
|
||||
|
|
|
@ -214,8 +214,17 @@ const char nsXPLookAndFeel::sColorPrefs[][38] =
|
|||
"ui.-moz-dialog",
|
||||
"ui.-moz-dialogtext",
|
||||
"ui.-moz-dragtargetzone",
|
||||
"ui.-moz-cellhighlight",
|
||||
"ui.-moz_cellhighlighttext",
|
||||
"ui.-moz-html-cellhighlight",
|
||||
"ui.-moz-html-cellhighlighttext",
|
||||
"ui.-moz-buttonhoverface",
|
||||
"ui.-moz_buttonhovertext",
|
||||
"ui.-moz_menuhover",
|
||||
"ui.-moz_menuhovertext",
|
||||
"ui.-moz_menubarhovertext",
|
||||
"ui.-moz_eventreerow",
|
||||
"ui.-moz_oddtreerow",
|
||||
"ui.-moz-mac-focusring",
|
||||
"ui.-moz-mac-menuselect",
|
||||
"ui.-moz-mac-menushadow",
|
||||
|
@ -227,7 +236,9 @@ const char nsXPLookAndFeel::sColorPrefs[][38] =
|
|||
"ui.-moz-mac-accentlightshadow",
|
||||
"ui.-moz-mac-accentregularshadow",
|
||||
"ui.-moz-mac-accentdarkshadow",
|
||||
"ui.-moz-mac-accentdarkestshadow"
|
||||
"ui.-moz-mac-accentdarkestshadow",
|
||||
"ui.-moz-mac-alternateprimaryhighlight",
|
||||
"ui.-moz-mac-secondaryhighlight"
|
||||
};
|
||||
|
||||
PRInt32 nsXPLookAndFeel::sCachedColors[nsILookAndFeel::eColor_LAST_COLOR] = {0};
|
||||
|
|
Загрузка…
Ссылка в новой задаче