Skip to content

Commit

Permalink
Merge pull request #17 from bonsai-rx/feature-dev
Browse files Browse the repository at this point in the history
Rename property grid auto refresh for clarity
  • Loading branch information
glopesdev authored Mar 25, 2024
2 parents 86c0b7f + 95a45cd commit 5860d1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Bonsai.Gui/PropertyGridBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class PropertyGridBuilder : ControlBuilderBase
{
internal readonly BehaviorSubject<bool> _HelpVisible = new(true);
internal readonly BehaviorSubject<bool> _ToolbarVisible = new(true);
internal readonly BehaviorSubject<bool> _RefreshProperties = new(false);
internal readonly BehaviorSubject<bool> _AutoRefresh = new(false);

/// <summary>
/// Gets or sets a value specifying whether the help text box is visible.
Expand Down Expand Up @@ -43,10 +43,10 @@ public bool ToolbarVisible
/// </summary>
[Category(nameof(CategoryAttribute.Behavior))]
[Description("Specifies whether the property grid should refresh whenever the value of any property changes.")]
public bool RefreshProperties
public bool AutoRefresh
{
get => _RefreshProperties.Value;
set => _RefreshProperties.OnNext(value);
get => _AutoRefresh.Value;
set => _AutoRefresh.OnNext(value);
}
}
}
4 changes: 2 additions & 2 deletions src/Bonsai.Gui/PropertyGridVisualizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected override PropertyGrid CreateControl(IServiceProvider provider, Propert
propertyGrid.Site = new ServiceProviderContext(provider);
propertyGrid.SubscribeTo(builder._HelpVisible, value => propertyGrid.HelpVisible = value);
propertyGrid.SubscribeTo(builder._ToolbarVisible, value => propertyGrid.ToolbarVisible = value);
propertyGrid.SubscribeTo(builder._RefreshProperties, value =>
propertyGrid.SubscribeTo(builder._AutoRefresh, value =>
{
if (value)
{
Expand All @@ -45,7 +45,7 @@ static void PropertyGrid_PropertyValueChanged(object sender, PropertyValueChange
{
var propertyGrid = (PropertyGrid)sender;
var builder = (PropertyGridBuilder)propertyGrid.Tag;
if (builder._RefreshProperties.Value)
if (builder._AutoRefresh.Value)
{
propertyGrid.Refresh();
}
Expand Down

0 comments on commit 5860d1f

Please sign in to comment.