Bug 1135536 - Restore previous state of folder pane columns when they are again enabled by the user. ui-r=Josiah, r=mkmelin

This commit is contained in:
aceman 2015-03-02 11:26:00 +01:00
Родитель 301c29f289
Коммит 69bf127259
2 изменённых файлов: 24 добавлений и 4 удалений

Просмотреть файл

@ -323,11 +323,31 @@ let gFolderTreeView = {
if (hide) {
column.setAttribute("hideheader", "true");
column.removeAttribute("label");
if (columnName != "folderNameCol")
if (columnName != "folderNameCol") {
if (!aSetup) {
// If user hides the columns store their visible state in a special attribute
// that is persisted by XUL.
let state = column.getAttribute("hidden");
column.setAttribute("hiddeninactive", state);
}
column.setAttribute("hidden", "true");
}
} else {
column.setAttribute("label", column.getAttribute("label2"));
column.setAttribute("hideheader", "false");
if (!aSetup) {
// If user unhides the columns restore their visible state
// from our special attribute.
if (column.hasAttribute("hiddeninactive")) {
let state = column.getAttribute("hiddeninactive");
column.setAttribute("hidden", state);
} else if (columnName == "folderTotalCol") {
// If there was no hiddeninactive attribute set, that means this is
// our first showing of the folder pane columns. Show the TotalCol
// as a sample so the user notices what is happening.
column.setAttribute("hidden", "false");
}
}
}
}

Просмотреть файл

@ -398,7 +398,7 @@
tooltiptext="&folderUnreadColumn.label;"
hideheader="true"
hidden="true"
persist="width hidden"
persist="width hidden hiddeninactive"
width="50"
selectable="false"/>
<splitter class="tree-splitter"/>
@ -407,7 +407,7 @@
tooltiptext="&folderTotalColumn.label;"
hideheader="true"
hidden="true"
persist="width hidden"
persist="width hidden hiddeninactive"
width="50"
selectable="false"/>
<splitter class="tree-splitter"/>
@ -416,7 +416,7 @@
tooltiptext="&folderSizeColumn.label;"
hideheader="true"
hidden="true"
persist="width hidden"
persist="width hidden hiddeninactive"
width="50"
selectable="false"/>
</treecols>