зеркало из https://github.com/mozilla/pjs.git
Bug #263255 --> UI improvements for grouping messages by date. Make the date title rows localizeable, style the title rows.
sr=bienvenu
This commit is contained in:
Родитель
4e31a043d1
Коммит
7fb0e81f40
|
@ -186,6 +186,24 @@ treechildren::-moz-tree-cell-text(folderNameCol, noSelect-true) {
|
|||
|
||||
/* ::::: thread decoration ::::: */
|
||||
|
||||
treechildren::-moz-tree-row(dummy) {
|
||||
background-color: #F0F0F0;
|
||||
margin-bottom: 1px;
|
||||
padding-left: 2px;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-row(dummy, selected) {
|
||||
background-color: -moz-Dialog;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-row(dummy, selected, focus) {
|
||||
background-color: Highlight;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-cell-text(dummy) {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-cell-text(read) {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
|
|
@ -420,10 +420,16 @@ function UpdateSortIndicators(sortType, sortOrder)
|
|||
if (currCol && subjectCol)
|
||||
threadTree._reorderColumn(currCol, subjectCol, true);
|
||||
gGroupColumn = currCol;
|
||||
|
||||
// hide the threaded column when in grouped view since you can't do
|
||||
// threads inside of a group.
|
||||
document.getElementById("threadCol").collapsed = true;
|
||||
}
|
||||
// clear primary attribute from group column if going to a non-grouped view.
|
||||
if (gGroupColumn && !(gDBView.viewFlags & nsMsgViewFlagsType.kGroupBySort))
|
||||
{
|
||||
document.getElementById("threadCol").collapsed = false;
|
||||
|
||||
if (gGroupColumn != currCol)
|
||||
gGroupColumn.removeAttribute("primary");
|
||||
if (gOldPrevColumn)
|
||||
|
|
|
@ -43,12 +43,36 @@
|
|||
#define MSGHDR_CACHE_MAX_SIZE 8192 // Max msghdr cache entries.
|
||||
#define MSGHDR_CACHE_DEFAULT_SIZE 100
|
||||
|
||||
PRUnichar * nsMsgGroupView::kTodayString = nsnull;
|
||||
PRUnichar * nsMsgGroupView::kYesterdayString = nsnull;
|
||||
PRUnichar * nsMsgGroupView::kLastWeekString = nsnull;
|
||||
PRUnichar * nsMsgGroupView::kTwoWeeksAgoString = nsnull;
|
||||
PRUnichar * nsMsgGroupView::kOldMailString = nsnull;
|
||||
|
||||
nsMsgGroupView::nsMsgGroupView()
|
||||
{
|
||||
if (!kTodayString)
|
||||
{
|
||||
// priority strings
|
||||
kTodayString = GetString(NS_LITERAL_STRING("today").get());
|
||||
kYesterdayString = GetString(NS_LITERAL_STRING("yesterday").get());
|
||||
kLastWeekString = GetString(NS_LITERAL_STRING("lastWeek").get());
|
||||
kTwoWeeksAgoString = GetString(NS_LITERAL_STRING("twoWeeksAgo").get());
|
||||
kOldMailString = GetString(NS_LITERAL_STRING("older").get());
|
||||
}
|
||||
}
|
||||
|
||||
nsMsgGroupView::~nsMsgGroupView()
|
||||
{
|
||||
// release our global strings
|
||||
if (gInstanceCount <= 1)
|
||||
{
|
||||
nsCRT::free(kTodayString);
|
||||
nsCRT::free(kYesterdayString);
|
||||
nsCRT::free(kLastWeekString);
|
||||
nsCRT::free(kTwoWeeksAgoString);
|
||||
nsCRT::free(kOldMailString);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgGroupView::Open(nsIMsgFolder *aFolder, nsMsgViewSortTypeValue aSortType, nsMsgViewSortOrderValue aSortOrder, nsMsgViewFlagsTypeValue aViewFlags, PRInt32 *aCount)
|
||||
|
@ -386,6 +410,16 @@ NS_IMETHODIMP nsMsgGroupView::OnHdrDeleted(nsIMsgDBHdr *aHdrDeleted, nsMsgKey aP
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgGroupView::GetRowProperties(PRInt32 aRow, nsISupportsArray *aProperties)
|
||||
{
|
||||
if (!IsValidIndex(aRow))
|
||||
return NS_MSG_INVALID_DBVIEW_INDEX;
|
||||
|
||||
if (m_flags[aRow] & MSG_VIEW_FLAG_DUMMY)
|
||||
return aProperties->AppendElement(kDummyMsgAtom);
|
||||
return nsMsgDBView::GetRowProperties(aRow, aProperties);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgGroupView::GetCellProperties(PRInt32 aRow, nsITreeColumn *aCol, nsISupportsArray *aProperties)
|
||||
{
|
||||
if (m_flags[aRow] & MSG_VIEW_FLAG_DUMMY)
|
||||
|
@ -414,19 +448,19 @@ NS_IMETHODIMP nsMsgGroupView::GetCellText(PRInt32 aRow, nsITreeColumn* aCol, nsA
|
|||
switch (((nsPRUint32Key *)hashKey)->GetValue())
|
||||
{
|
||||
case 1:
|
||||
aValue.Assign(NS_LITERAL_STRING("today"));
|
||||
aValue.Assign(kTodayString);
|
||||
break;
|
||||
case 2:
|
||||
aValue.Assign(NS_LITERAL_STRING("yesterday"));
|
||||
aValue.Assign(kYesterdayString);
|
||||
break;
|
||||
case 3:
|
||||
aValue.Assign(NS_LITERAL_STRING("last week"));
|
||||
aValue.Assign(kLastWeekString);
|
||||
break;
|
||||
case 4:
|
||||
aValue.Assign(NS_LITERAL_STRING("two weeks ago"));
|
||||
aValue.Assign(kTwoWeeksAgoString);
|
||||
break;
|
||||
case 5:
|
||||
aValue.Assign(NS_LITERAL_STRING("older..."));
|
||||
aValue.Assign(kOldMailString);
|
||||
break;
|
||||
default:
|
||||
NS_ASSERTION(PR_FALSE, "bad age thread");
|
||||
|
|
|
@ -54,6 +54,7 @@ public:
|
|||
|
||||
NS_IMETHOD LoadMessageByViewIndex(nsMsgViewIndex aViewIndex);
|
||||
NS_IMETHOD GetCellProperties(PRInt32 aRow, nsITreeColumn *aCol, nsISupportsArray *aProperties);
|
||||
NS_IMETHOD GetRowProperties(PRInt32 aRow, nsISupportsArray *aProperties);
|
||||
NS_IMETHOD GetCellText(PRInt32 aRow, nsITreeColumn* aCol, nsAString& aValue);
|
||||
|
||||
protected:
|
||||
|
@ -68,4 +69,11 @@ protected:
|
|||
PRUint32 *pFlags = NULL);
|
||||
|
||||
nsHashtable m_groupsTable;
|
||||
|
||||
static PRUnichar* kTodayString;
|
||||
static PRUnichar* kYesterdayString;
|
||||
static PRUnichar* kLastWeekString;
|
||||
static PRUnichar* kTwoWeeksAgoString;
|
||||
static PRUnichar* kOldMailString;
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче