28 lines
858 B
C#
28 lines
858 B
C#
using System.Windows.Input;
|
|
using Futonizer.Services;
|
|
using Wpf.Ui.Controls;
|
|
|
|
namespace Futonizer.Views;
|
|
|
|
public partial class HistoryWindow : FluentWindow
|
|
{
|
|
public HistoryWindow()
|
|
{
|
|
Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this);
|
|
InitializeComponent();
|
|
|
|
var entries = HistoryService.Load();
|
|
HistoryList.ItemsSource = entries;
|
|
EmptyHint.Visibility = entries.Count == 0
|
|
? System.Windows.Visibility.Visible
|
|
: System.Windows.Visibility.Collapsed;
|
|
|
|
SummaryText.Text = entries.Count == 0
|
|
? string.Empty
|
|
: $"{entries.Count} entr{(entries.Count == 1 ? "y" : "ies")} (newest first, capped at 1000)";
|
|
}
|
|
|
|
private void HistoryList_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
|
=> SmoothScrollHelper.HandlePreviewMouseWheel(sender, e);
|
|
}
|