1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Made the ValueTrees demo more macOS friendly

This commit is contained in:
Tom Poole 2019-05-21 13:59:36 +01:00
parent 103bb57688
commit 84d6d21f54

View file

@ -71,6 +71,10 @@ public:
void paintItem (Graphics& g, int width, int height) override void paintItem (Graphics& g, int width, int height) override
{ {
if (isSelected())
g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::highlightedFill,
Colours::teal));
g.setColour (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::defaultText, g.setColour (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::defaultText,
Colours::black)); Colours::black));
g.setFont (15.0f); g.setFont (15.0f);
@ -233,7 +237,7 @@ public:
{ {
auto vt = createTree ("This demo displays a ValueTree as a treeview."); auto vt = createTree ("This demo displays a ValueTree as a treeview.");
vt.appendChild (createTree ("You can drag around the nodes to rearrange them"), nullptr); vt.appendChild (createTree ("You can drag around the nodes to rearrange them"), nullptr);
vt.appendChild (createTree ("..and press 'delete' to delete them"), nullptr); vt.appendChild (createTree ("..and press 'delete' or 'backspace' to delete them"), nullptr);
vt.appendChild (createTree ("Then, you can use the undo/redo buttons to undo these changes"), nullptr); vt.appendChild (createTree ("Then, you can use the undo/redo buttons to undo these changes"), nullptr);
int n = 1; int n = 1;
@ -267,7 +271,7 @@ public:
bool keyPressed (const KeyPress& key) override bool keyPressed (const KeyPress& key) override
{ {
if (key == KeyPress::deleteKey) if (key == KeyPress::deleteKey || key == KeyPress::backspaceKey)
{ {
deleteSelectedItems(); deleteSelectedItems();
return true; return true;