Skip to content

Commit

Permalink
Merge pull request #75134 from aoyangyou/dev/aoyang/fixRenameButton
Browse files Browse the repository at this point in the history
Fix the SmartRename button regressions
  • Loading branch information
Cosifne authored Sep 20, 2024
2 parents 3380c3b + 99c359f commit d799b05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static vsui:CommonControlsColors.ButtonBorderFocusedBrushKey}}"/>
<Setter Property="Background" Value="{DynamicResource {x:Static vsui:CommonControlsColors.ButtonFocusedBrushKey}}"/>
</Trigger>
</Style.Triggers>
</Style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,13 @@ public string? SelectedSuggestedName
}
}

public bool IsSuggestionsPanelExpanded => HasSuggestions;
/// <summary>
/// IsSuggestionsPanelExpanded is used to control the visibility of the suggestions panel.
/// SupportsAutomaticSuggestions the flag to determine whether the SmartRename will generate suggestion automatically.
/// When SupportsAutomaticSuggestions disenabled, the suggestions panel is supposed to always expanded once it's shown, thus users can see the suggestions.
/// When SupportsAutomaticSuggestions enabled, the suggestions panel is supposed to react to the smart rename button click. If the button is clicked, IsAutomaticSuggestionsEnabled will be true, the panel will be expanded, Otherwise, it will be collapsed.
/// </summary>
public bool IsSuggestionsPanelExpanded => HasSuggestions && (!SupportsAutomaticSuggestions || IsAutomaticSuggestionsEnabled);

public string GetSuggestionsTooltip
=> SupportsAutomaticSuggestions
Expand Down Expand Up @@ -286,7 +292,7 @@ public void ToggleOrTriggerSuggestions()
{
this.FetchSuggestions(isAutomaticOnInitialization: false);
}

NotifyPropertyChanged(nameof(IsSuggestionsPanelExpanded));
NotifyPropertyChanged(nameof(IsAutomaticSuggestionsEnabled));
// Use existing "CollapseSuggestionsPanel" option (true if user does not wish to get suggestions automatically) to honor user's choice.
_globalOptionService.SetGlobalOption(InlineRenameUIOptionsStorage.CollapseSuggestionsPanel, !IsAutomaticSuggestionsEnabled);
Expand Down

0 comments on commit d799b05

Please sign in to comment.