Skip to content

Commit

Permalink
Edit dialog's "Browse" button works at 225% text scaling. (#2562)
Browse files Browse the repository at this point in the history
* Changing width to auto

* Moving URL text saving out of code-behind into view model

---------

Co-authored-by: Darren Hoehna <dahoehna@microsoft.com>
  • Loading branch information
dhoehna and dhoehna committed Apr 10, 2024
1 parent ebfbe69 commit d272c99
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,14 @@ private async Task AddAccountClicked()
}
}

[RelayCommand]
public void SaveRepoUrl(string repoUrl)
{
Url = repoUrl;

ToggleCloneButton();
}

/// <summary>
/// Filters all repos down to any that start with text.
/// A side-effect of filtering is that SelectionChanged fires for every selected repo but only on removal.
Expand Down
9 changes: 7 additions & 2 deletions tools/SetupFlow/DevHome.SetupFlow/Views/AddRepoDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,14 @@
<TextBox x:Name="RepoUrlTextBox"
x:Uid="RepoUrl"
Visibility="{x:Bind AddRepoViewModel.ShowUrlPage, Mode=OneWay}"
TextChanged="RepoUrlTextBox_TextChanged"
Text="{x:Bind AddRepoViewModel.Url, Mode=TwoWay}"
Margin="0, 20, 0, 0"/>
Margin="0, 20, 0, 0">
<i:Interaction.Behaviors>
<ic:EventTriggerBehavior EventName="TextChanged">
<ic:InvokeCommandAction Command="{x:Bind AddRepoViewModel.SaveRepoUrlCommand}" CommandParameter="{x:Bind RepoUrlTextBox.Text, Mode=OneWay}"/>
</ic:EventTriggerBehavior>
</i:Interaction.Behaviors>
</TextBox>
<TextBlock x:Name="UrlErrorTextBlock" Style="{ThemeResource BaseTextBlockStyle}" Text="{x:Bind AddRepoViewModel.UrlParsingError, Mode=OneWay}" Visibility="{x:Bind AddRepoViewModel.ShouldShowUrlError, Mode=OneWay}"/>

<!-- Log into account -->
Expand Down
11 changes: 0 additions & 11 deletions tools/SetupFlow/DevHome.SetupFlow/Views/AddRepoDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,17 +283,6 @@ private void MakeNewDevDriveCheckBox_Click(object sender, RoutedEventArgs e)
}
}

private void RepoUrlTextBox_TextChanged(object sender, RoutedEventArgs e)
{
// just in case something other than a text box calls this.
if (sender is TextBox)
{
AddRepoViewModel.Url = (sender as TextBox).Text;
}

AddRepoViewModel.ToggleCloneButton();
}

/// <summary>
/// Putting the event in the view so SelectRange can be called.
/// SelectRange needs a reference to the ListView.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<Grid Visibility="{x:Bind FolderPickerViewModel.ShouldShowFolderPicker, Mode=OneWay}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<!--Folder picker-->
<StackPanel
Expand Down Expand Up @@ -83,7 +83,7 @@
x:Uid="ms-resource:///DevHome.SetupFlow/Resources/ClonePath_Button"
Click="ChooseCloneLocationButton_Click"
Grid.Column="1"
Margin="5, 27, 0, 0"
Margin="5, 27, 10, 0"
Padding="8 5 10 5"/>
</Grid>
</Grid>
Expand Down

0 comments on commit d272c99

Please sign in to comment.