diff --git a/Source/Components/PropertiesPanel.h b/Source/Components/PropertiesPanel.h index bf8db579f..ab91c1563 100644 --- a/Source/Components/PropertiesPanel.h +++ b/Source/Components/PropertiesPanel.h @@ -1124,7 +1124,7 @@ class PropertiesPanel : public Component { } }; - struct DirectoryPathComponent final : public PropertiesPanelProperty { + struct DirectoryPathComponent final : public PropertiesPanelProperty, public Value::Listener { String label; SmallIconButton browseButton = SmallIconButton(Icons::Folder); Value property; @@ -1135,6 +1135,7 @@ class PropertiesPanel : public Component { { setPath(value.toString()); addAndMakeVisible(browseButton); + property.addListener(this); browseButton.onClick = [this] { Dialogs::showOpenDialog([this](URL const& url) { @@ -1147,6 +1148,12 @@ class PropertiesPanel : public Component { }; } + void valueChanged(Value& v) override + { + label = v.toString(); + repaint(); + } + void setPath(String path) { property = path;