Browse Source

Made the ValueTrees demo more macOS friendly

tags/2021-05-28
Tom Poole 6 years ago
parent
commit
84d6d21f54
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      examples/Utilities/ValueTreesDemo.h

+ 6
- 2
examples/Utilities/ValueTreesDemo.h View File

@@ -71,6 +71,10 @@ public:
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,
Colours::black));
g.setFont (15.0f);
@@ -233,7 +237,7 @@ public:
{
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 ("..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);
int n = 1;
@@ -267,7 +271,7 @@ public:
bool keyPressed (const KeyPress& key) override
{
if (key == KeyPress::deleteKey)
if (key == KeyPress::deleteKey || key == KeyPress::backspaceKey)
{
deleteSelectedItems();
return true;


Loading…
Cancel
Save