Bug 265282 - Unsorted tree columns are drawn as sorted columns. r=jhpedemonte sr=neil
This commit is contained in:
Родитель
a4664b13b6
Коммит
4598e943f2
|
@ -454,11 +454,14 @@ nsNativeThemeMac::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame*
|
|||
kThemeDisclosureDown, kThemeAdornmentNone, eventState );
|
||||
break;
|
||||
case NS_THEME_TREEVIEW_HEADER_CELL:
|
||||
{
|
||||
TreeSortDirection sortDirection = GetTreeSortDirection(aFrame);
|
||||
DrawButton ( kThemeListHeaderButton, macRect, PR_FALSE, IsDisabled(aFrame),
|
||||
IsSortedColumn(aFrame) ? kThemeButtonOn : kThemeButtonOff,
|
||||
IsSortReversed(aFrame) ? kThemeAdornmentHeaderButtonSortUp : kThemeAdornmentNone,
|
||||
eventState );
|
||||
sortDirection == eTreeSortDirection_Natural ? kThemeButtonOff : kThemeButtonOn,
|
||||
sortDirection == eTreeSortDirection_Descending ?
|
||||
kThemeAdornmentHeaderButtonSortUp : kThemeAdornmentNone, eventState );
|
||||
break;
|
||||
}
|
||||
case NS_THEME_TREEVIEW_TREEITEM:
|
||||
case NS_THEME_TREEVIEW:
|
||||
::SetThemeBackground(kThemeBrushWhite, 24, true);
|
||||
|
|
|
@ -53,6 +53,13 @@ class nsPresContext;
|
|||
class nsNativeTheme
|
||||
{
|
||||
protected:
|
||||
|
||||
enum TreeSortDirection {
|
||||
eTreeSortDirection_Descending,
|
||||
eTreeSortDirection_Natural,
|
||||
eTreeSortDirection_Ascending
|
||||
};
|
||||
|
||||
nsNativeTheme();
|
||||
|
||||
// Returns the content state (hover, focus, etc), see nsIEventStateManager.h
|
||||
|
@ -96,18 +103,16 @@ class nsNativeTheme
|
|||
}
|
||||
|
||||
// treeheadercell:
|
||||
PRBool IsSortedColumn(nsIFrame* aFrame) {
|
||||
TreeSortDirection GetTreeSortDirection(nsIFrame* aFrame) {
|
||||
nsAutoString sortdir;
|
||||
if (GetAttr(aFrame, mSortDirectionAtom, sortdir))
|
||||
return !sortdir.IsEmpty();
|
||||
return PR_FALSE;
|
||||
}
|
||||
if (GetAttr(aFrame, mSortDirectionAtom, sortdir)) {
|
||||
if (sortdir.EqualsLiteral("descending"))
|
||||
return eTreeSortDirection_Descending;
|
||||
else if (sortdir.EqualsLiteral("ascending"))
|
||||
return eTreeSortDirection_Ascending;
|
||||
}
|
||||
|
||||
PRBool IsSortReversed(nsIFrame* aFrame) {
|
||||
nsAutoString sortdir;
|
||||
if (GetAttr(aFrame, mSortDirectionAtom, sortdir))
|
||||
return sortdir.EqualsLiteral("descending");
|
||||
return PR_FALSE;
|
||||
return eTreeSortDirection_Natural;
|
||||
}
|
||||
|
||||
// tab:
|
||||
|
|
Загрузка…
Ссылка в новой задаче