ecere/gui/ListBox: Multi-coloring of multiple levels of rows with 'isHeader' = true
authorJerome St-Louis <jerome@ecere.com>
Thu, 2 Aug 2012 14:47:23 +0000 (10:47 -0400)
committerJerome St-Louis <jerome@ecere.com>
Thu, 2 Aug 2012 14:47:23 +0000 (10:47 -0400)
ecere/src/gui/controls/ListBox.ec

index 7a2777b..7e6eaac 100644 (file)
@@ -2348,8 +2348,12 @@ private:
          // Draw the current row background
          if(row.header)
          {
-            background = formColor;
-            surface.SetBackground(formColor);
+            Color colors[] = { formColor, azure, mistyRose, linen, floralWhite, lavender, lavenderBlush, lemonChiffon };
+            int level = 0;
+            DataRow p = row;
+            while(p = p.parent) level++;
+            background = colors[(level % (sizeof(colors)/sizeof(colors[0]))];
+            surface.SetBackground(background);
             surface.Area(rowStart, y, clientSize.w, (y + rowHeight) - 1);
             foreground = branchesColor;
          }