Skip to content

Commit

Permalink
Added the possibility to clear DownDetector sites (#596)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed Aug 4, 2024
1 parent d2f64e2 commit c8d0529
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
18 changes: 17 additions & 1 deletion InternetTest/InternetTest/Pages/DownDetectorPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,23 @@
Style="{DynamicResource PrimaryButton}" />

</StackPanel>

<Button
x:Name="ClearItemsBtn"
Grid.Row="1"
Grid.Column="1"
Margin="10 5"
Padding="5"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Background="{DynamicResource LightAccent}"
BorderThickness="0"
Click="ClearItemsBtn_Click"
Content="&#xF34D;"
Cursor="Hand"
FontFamily="..\Fonts\#FluentSystemIcons-Regular"
FontWeight="ExtraBold"
Foreground="{DynamicResource Accent}"
Style="{DynamicResource PrimaryButton}" />
<StackPanel
x:Name="WebsiteDisplayer"
Grid.Row="2"
Expand Down
10 changes: 9 additions & 1 deletion InternetTest/InternetTest/Pages/DownDetectorPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,13 @@ private void WebsiteTxt_TextChanged(object sender, TextChangedEventArgs e)
{
ClearBtn.Visibility = WebsiteTxt.Text.Length > 0 ? Visibility.Visible : Visibility.Collapsed;
}
}

private void ClearItemsBtn_Click(object sender, RoutedEventArgs e)
{
WebsiteDisplayer.Children.Clear();
Websites.Clear();
Global.Settings.DownDetectorWebsites = Websites;
SettingsManager.Save();
}
}
}

0 comments on commit c8d0529

Please sign in to comment.