Fix bug 433892 - Specialize calendar list tree style. r=berend
git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@251728 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -226,7 +226,7 @@ function calendarListUpdateColor(aCalendar) {
|
||||
}
|
||||
}
|
||||
|
||||
var ruleString = selectorPrefix + "(color-" + color.substr(1) + ") { }";
|
||||
var ruleString = selectorPrefix + "(calendar-list-tree-color, color-" + color.substr(1) + ") { }";
|
||||
|
||||
var rule = gCachedStyleSheet
|
||||
.insertRule(ruleString, gCachedStyleSheet.cssRules.length);
|
||||
@@ -335,43 +335,49 @@ var calendarListTreeView = {
|
||||
return this.mCalendarList.length;
|
||||
},
|
||||
|
||||
getRowProperties: function cLTV_getRowProperties(aRow, aProps) {},
|
||||
|
||||
getCellProperties: function cLTV_getCellProperties(aRow, aCol, aProps) {
|
||||
this.getRowProperties(aRow, aProps);
|
||||
this.getColumnProperties(aCol, aProps);
|
||||
},
|
||||
|
||||
getRowProperties: function cLTV_getRowProperties(aRow, aProps) {
|
||||
var calendar = this.mCalendarList[aRow];
|
||||
var composite = getCompositeCalendar();
|
||||
|
||||
switch (aCol.id) {
|
||||
case "calendar-list-tree-checkbox":
|
||||
if (composite.getCalendar(calendar.uri)) {
|
||||
aProps.AppendElement(getAtomFromService("checked"));
|
||||
} else {
|
||||
aProps.AppendElement(getAtomFromService("unchecked"));
|
||||
}
|
||||
break;
|
||||
case "calendar-list-tree-color":
|
||||
// Get the calendar color
|
||||
var color = calendar.getProperty("color");
|
||||
color = color && color.substr(1);
|
||||
// Set up the composite calendar status
|
||||
if (composite.getCalendar(calendar.uri)) {
|
||||
aProps.AppendElement(getAtomFromService("checked"));
|
||||
} else {
|
||||
aProps.AppendElement(getAtomFromService("unchecked"));
|
||||
}
|
||||
|
||||
// Set up the calendar color (background)
|
||||
var bgColorProp = "color-" + (color || "default");
|
||||
aProps.AppendElement(getAtomFromService(bgColorProp));
|
||||
// Get the calendar color
|
||||
var color = calendar.getProperty("color");
|
||||
color = color && color.substr(1);
|
||||
|
||||
// Set a property to get the contrasting text color (foreground)
|
||||
var fgColorProp = getContrastingTextColor(color || "a8c2e1");
|
||||
aProps.AppendElement(getAtomFromService(fgColorProp));
|
||||
// Set up the calendar color (background)
|
||||
var bgColorProp = "color-" + (color || "default");
|
||||
aProps.AppendElement(getAtomFromService(bgColorProp));
|
||||
|
||||
// Set up the readonly symbol
|
||||
if (calendar.readOnly) {
|
||||
aProps.AppendElement(getAtomFromService("readOnly"));
|
||||
}
|
||||
// Set a property to get the contrasting text color (foreground)
|
||||
var fgColorProp = getContrastingTextColor(color || "a8c2e1");
|
||||
aProps.AppendElement(getAtomFromService(fgColorProp));
|
||||
|
||||
break;
|
||||
// Set up the readonly symbol
|
||||
if (calendar.readOnly) {
|
||||
aProps.AppendElement(getAtomFromService("readOnly"));
|
||||
}
|
||||
|
||||
// Set up the disabled state
|
||||
if (calendar.getProperty("disabled")) {
|
||||
aProps.AppendElement(getAtomFromService("disabled"));
|
||||
} else {
|
||||
aProps.AppendElement(getAtomFromService("enabled"));
|
||||
}
|
||||
},
|
||||
|
||||
getColumnProperties: function cLTV_getColumnProperties(a, aProps) {},
|
||||
getColumnProperties: function cLTV_getColumnProperties(aCol, aProps) {},
|
||||
|
||||
isContainer: function cLTV_isContainer(aRow) {
|
||||
return false;
|
||||
|
||||
@@ -34,42 +34,46 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
treechildren::-moz-tree-image(calendar-list-tree-checkbox) {
|
||||
#calendar-list-tree-widget > treechildren::-moz-tree-image(calendar-list-tree-checkbox) {
|
||||
list-style-image: url(chrome://calendar/skin/unifinder/checkbox_unchecked.png);
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-image(calendar-list-tree-checkbox, checked) {
|
||||
#calendar-list-tree-widget > treechildren::-moz-tree-image(calendar-list-tree-checkbox, checked) {
|
||||
list-style-image: url(chrome://calendar/skin/unifinder/checkbox_checked.png);
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-cell(color-default) {
|
||||
#calendar-list-tree-widget > treechildren::-moz-tree-image(calendar-list-tree-checkbox, disabled) {
|
||||
list-style-image: url(chrome://calendar/skin/unifinder/checkbox_unchecked.png);
|
||||
}
|
||||
|
||||
#calendar-list-tree-widget > treechildren::-moz-tree-cell(calendar-list-tree-color, color-default) {
|
||||
background-color: #a8c2e1;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-cell(calendar-list-tree-checkbox) {
|
||||
#calendar-list-tree-widget > treechildren::-moz-tree-cell(calendar-list-tree-checkbox) {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-cell(calendar-list-tree-color) {
|
||||
#calendar-list-tree-widget > treechildren::-moz-tree-cell(calendar-list-tree-color) {
|
||||
margin: 1px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-cell(calendar-list-tree-calendar) {
|
||||
#calendar-list-tree-widget > treechildren::-moz-tree-cell(calendar-list-tree-calendar) {
|
||||
-moz-margin-start: 1px;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-image(calendar-list-tree-color, readOnly, black) {
|
||||
#calendar-list-tree-widget > treechildren::-moz-tree-image(calendar-list-tree-color, readOnly, black) {
|
||||
list-style-image: url(chrome://calendar/skin/calendar-readOnly.png);
|
||||
-moz-image-region: rect(0, 10px, 10px, 0);
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-image(calendar-list-tree-color, readOnly, white) {
|
||||
#calendar-list-tree-widget > treechildren::-moz-tree-image(calendar-list-tree-color, readOnly, white) {
|
||||
list-style-image: url(chrome://calendar/skin/calendar-readOnly.png);
|
||||
-moz-image-region: rect(0, 20px, 10px, 10px);
|
||||
}
|
||||
|
||||
tree {
|
||||
#calendar-list-tree-widget {
|
||||
border: none;
|
||||
padding: 0;
|
||||
margin: 4px;
|
||||
|
||||
@@ -34,37 +34,47 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
treechildren::-moz-tree-image(calendar-list-tree-checkbox) {
|
||||
|
||||
#calendar-list-tree-widget > treechildren::-moz-tree-image(calendar-list-tree-checkbox) {
|
||||
list-style-image: url(chrome://calendar/skin/unifinder/checkbox_unchecked.png);
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-image(calendar-list-tree-checkbox, checked) {
|
||||
#calendar-list-tree-widget > treechildren::-moz-tree-image(calendar-list-tree-checkbox, checked) {
|
||||
list-style-image: url(chrome://calendar/skin/unifinder/checkbox_checked.png);
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-cell(color-default) {
|
||||
#calendar-list-tree-widget > treechildren::-moz-tree-image(calendar-list-tree-checkbox, disabled) {
|
||||
list-style-image: url(chrome://calendar/skin/unifinder/checkbox_unchecked.png);
|
||||
}
|
||||
|
||||
#calendar-list-tree-widget > treechildren::-moz-tree-cell(calendar-list-tree-color, color-default) {
|
||||
background-color: #a8c2e1;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-cell(calendar-list-tree-color) {
|
||||
#calendar-list-tree-widget > treechildren::-moz-tree-cell(calendar-list-tree-color) {
|
||||
margin: 1px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-cell(calendar-list-tree-calendar) {
|
||||
#calendar-list-tree-widget > treechildren::-moz-tree-cell(calendar-list-tree-calendar) {
|
||||
-moz-margin-start: 1px;
|
||||
}
|
||||
treechildren::-moz-tree-image(calendar-list-tree-color, readOnly, black) {
|
||||
|
||||
#calendar-list-tree-widget > treechildren::-moz-tree-image(calendar-list-tree-color, readOnly, black) {
|
||||
list-style-image: url(chrome://calendar/skin/calendar-readOnly.png);
|
||||
-moz-image-region: rect(0, 10px, 10px, 0);
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-image(calendar-list-tree-color, readOnly, white) {
|
||||
#calendar-list-tree-widget > treechildren::-moz-tree-image(calendar-list-tree-color, readOnly, white) {
|
||||
list-style-image: url(chrome://calendar/skin/calendar-readOnly.png);
|
||||
-moz-image-region: rect(0, 20px, 10px, 10px);
|
||||
}
|
||||
|
||||
tree {
|
||||
#calendar-list-tree-widget > treechildren::-moz-tree-cell-text(disabled) {
|
||||
color: GrayText;
|
||||
}
|
||||
|
||||
#calendar-list-tree-widget {
|
||||
border: none;
|
||||
padding: 0;
|
||||
margin: 4px;
|
||||
|
||||
Reference in New Issue
Block a user