mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Added ColourIds to allow alternate colouring of TreeViewItems
This commit is contained in:
parent
d892109298
commit
b24aadcc72
3 changed files with 8 additions and 1 deletions
|
|
@ -93,6 +93,8 @@ LookAndFeel_V2::LookAndFeel_V2()
|
|||
TreeView::backgroundColourId, 0x00000000,
|
||||
TreeView::dragAndDropIndicatorColourId, 0x80ff0000,
|
||||
TreeView::selectedItemBackgroundColourId, 0x00000000,
|
||||
TreeView::oddItemsColourId, 0x00000000,
|
||||
TreeView::evenItemsColourId, 0x00000000,
|
||||
|
||||
PopupMenu::backgroundColourId, 0xffffffff,
|
||||
PopupMenu::textColourId, 0xff000000,
|
||||
|
|
|
|||
|
|
@ -1559,6 +1559,9 @@ void TreeViewItem::paintRecursively (Graphics& g, int width)
|
|||
{
|
||||
if (isSelected())
|
||||
g.fillAll (ownerView->findColour (TreeView::selectedItemBackgroundColourId));
|
||||
else
|
||||
g.fillAll ((getRowNumberInTree() % 2 == 0) ? ownerView->findColour (TreeView::oddItemsColourId)
|
||||
: ownerView->findColour (TreeView::evenItemsColourId));
|
||||
|
||||
paintItem (g, itemWidth < 0 ? width - indent : itemWidth, itemHeight);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -844,7 +844,9 @@ public:
|
|||
backgroundColourId = 0x1000500, /**< A background colour to fill the component with. */
|
||||
linesColourId = 0x1000501, /**< The colour to draw the lines with.*/
|
||||
dragAndDropIndicatorColourId = 0x1000502, /**< The colour to use for the drag-and-drop target position indicator. */
|
||||
selectedItemBackgroundColourId = 0x1000503 /**< The colour to use to fill the background of any selected items. */
|
||||
selectedItemBackgroundColourId = 0x1000503, /**< The colour to use to fill the background of any selected items. */
|
||||
oddItemsColourId = 0x1000504, /**< The colour to use to fill the backround of the odd numbered items. */
|
||||
evenItemsColourId = 0x1000505 /**< The colour to use to fill the backround of the even numbered items. */
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue