diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:53:07 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:53:07 +0200 |
commit | 583d6a1fd6701e3d42c87285265b0b4f7657ab7c (patch) | |
tree | 78461dd1a74685252eef77b8e7d3b622d1be67ea /library/CustomGrid.cpp | |
parent | 1.9 (diff) | |
download | FreeFileSync-583d6a1fd6701e3d42c87285265b0b4f7657ab7c.tar.gz FreeFileSync-583d6a1fd6701e3d42c87285265b0b4f7657ab7c.tar.bz2 FreeFileSync-583d6a1fd6701e3d42c87285265b0b4f7657ab7c.zip |
1.10
Diffstat (limited to 'library/CustomGrid.cpp')
-rw-r--r-- | library/CustomGrid.cpp | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/library/CustomGrid.cpp b/library/CustomGrid.cpp index 93f2107a..86a121d3 100644 --- a/library/CustomGrid.cpp +++ b/library/CustomGrid.cpp @@ -12,6 +12,7 @@ public: CustomGridTableBase(int numRows, int numCols) : wxGridStringTable(numRows, numCols), lightBlue(80, 110, 255), + lightGrey(212, 208, 200), gridIdentifier(0), gridRefUI(0), gridData(0), @@ -233,18 +234,30 @@ public: } //########################################################################### + enum RowColor {BLUE, GREY, NONE}; - bool markThisRow(int row) //rows that are filtered out are shown in different color + inline //redundant command + RowColor getRowColor(int row) //rows that are filtered out are shown in different color { if (gridRefUI) { if (unsigned(row) < gridRefUI->size()) { - if (!(*gridData)[(*gridRefUI)[row]].selectedForSynchronization) - return true; + const FileCompareLine cmpLine = (*gridData)[(*gridRefUI)[row]]; + + //mark filtered rows + if (!cmpLine.selectedForSynchronization) + return BLUE; + //mark directories + else if (gridIdentifier == 1 && cmpLine.fileDescrLeft.objType == TYPE_DIRECTORY) + return GREY; + else if (gridIdentifier == 2 && cmpLine.fileDescrRight.objType == TYPE_DIRECTORY) + return GREY; + else + return NONE; } } - return false; + return NONE; } @@ -262,16 +275,23 @@ public: result = attr; } - if (markThisRow(row)) + RowColor color = getRowColor(row); + if (color == BLUE) result->SetBackgroundColour(lightBlue); + else if (color == GREY) + result->SetBackgroundColour(lightGrey); else result->SetBackgroundColour(*wxWHITE); } else { result = new wxGridCellAttr; - if (markThisRow(row)) + + RowColor color = getRowColor(row); + if (color == BLUE) result->SetBackgroundColour(lightBlue); + else if (color == GREY) + result->SetBackgroundColour(lightGrey); } return result; @@ -279,6 +299,7 @@ public: private: wxColour lightBlue; + wxColour lightGrey; int gridIdentifier; GridView* gridRefUI; //(very fast) access to underlying grid data :) FileCompareResult* gridData; |