Bug 176244 - Fix column resize and reorder issues when direction is rtl; r=roc,enndeakin sr=roc

This commit is contained in:
Ehsan Akhgari 2009-07-15 11:52:42 +04:30
Родитель 0ea9820eec
Коммит 856c5fb848
5 изменённых файлов: 40 добавлений и 17 удалений

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

@ -116,6 +116,13 @@ nsDisplayXULTreeColSplitterTarget::HitTest(nsDisplayListBuilder* aBuilder,
else if (nsPresContext::CSSPixelsToAppUnits(4) > pt.x)
left = PR_TRUE;
// Swap left and right for RTL trees in order to find the correct splitter
if (mFrame->GetStyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL) {
PRBool tmp = left;
left = right;
right = tmp;
}
if (left || right) {
// We are a header. Look for the correct splitter.
nsFrameList frames(mFrame->GetParent()->GetFirstChild(nsnull));

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

@ -209,25 +209,35 @@
<parameter name="aThresh"/>
<parameter name="aPos"/>
<body><![CDATA[
if (aPos) aPos.value = "before";
var isRTL = document.defaultView.getComputedStyle(this, "")
.direction == "rtl";
if (aPos)
aPos.value = isRTL ? "after" : "before";
var columns = [];
var col = this.columns.getFirstColumn();
var lastCol = null;
while (col) {
columns.push(col);
col = col.getNext();
}
if (isRTL)
columns.reverse();
var currentX = this.boxObject.x;
var adjustedX = aX + this.treeBoxObject.horizontalPosition;
while (col) {
for (var i = 0; i < columns.length; ++i) {
col = columns[i];
var cw = col.element.boxObject.width;
if (cw > 0) {
currentX += cw;
if (currentX - (cw * aThresh) > adjustedX)
return col.element;
}
lastCol = col;
col = col.getNext();
}
if (aPos) aPos.value = "after";
return lastCol.element;
if (aPos)
aPos.value = isRTL ? "before" : "after";
return columns.pop().element;
]]></body>
</method>

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

@ -302,20 +302,22 @@ treecol[dragging="true"] {
color: ThreeDHighlight !important;
}
treecol[insertafter="true"] {
tree[chromedir="ltr"] treecol[insertafter="true"],
tree[chromedir="rtl"] treecol[insertbefore="true"] {
-moz-border-right-colors: ThreeDDarkShadow ThreeDShadow;
}
treecol[insertbefore="true"] {
tree[chromedir="rtl"] treecol[insertafter="true"],
tree[chromedir="ltr"] treecol[insertbefore="true"] {
-moz-border-left-colors: ThreeDDarkShadow ThreeDShadow;
}
treechildren::-moz-tree-column(insertbefore) {
border-left: 1px solid ThreeDShadow;
-moz-border-start: 1px solid ThreeDShadow;
}
treechildren::-moz-tree-column(insertafter) {
border-right: 1px solid ThreeDShadow;
-moz-border-end: 1px solid ThreeDShadow;
}
/* ::::: sort direction indicator ::::: */

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

@ -269,11 +269,13 @@ treecol[dragging="true"] {
color: ThreeDHighlight !important;
}
treecol[insertafter="true"] {
tree[chromedir="ltr"] treecol[insertafter="true"],
tree[chromedir="rtl"] treecol[insertbefore="true"] {
-moz-border-right-colors: ThreeDDarkShadow ThreeDShadow;
}
treecol[insertbefore="true"] {
tree[chromedir="rtl"] treecol[insertafter="true"],
tree[chromedir="ltr"] treecol[insertbefore="true"] {
-moz-border-left-colors: ThreeDDarkShadow ThreeDShadow;
}

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

@ -296,20 +296,22 @@ treecol[dragging="true"] {
color: ThreeDHighlight !important;
}
treecol[insertafter="true"] {
tree[chromedir="ltr"] treecol[insertafter="true"],
tree[chromedir="rtl"] treecol[insertbefore="true"] {
-moz-border-right-colors: ThreeDDarkShadow ThreeDShadow;
}
treecol[insertbefore="true"] {
tree[chromedir="rtl"] treecol[insertafter="true"],
tree[chromedir="ltr"] treecol[insertbefore="true"] {
-moz-border-left-colors: ThreeDDarkShadow ThreeDShadow;
}
treechildren::-moz-tree-column(insertbefore) {
border-left: 1px solid ThreeDShadow;
-moz-border-start: 1px solid ThreeDShadow;
}
treechildren::-moz-tree-column(insertafter) {
border-right: 1px solid ThreeDShadow;
-moz-border-end: 1px solid ThreeDShadow;
}
/* ::::: sort direction indicator ::::: */