mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-01-13 17:22:48 -05:00
Fix toolbar button handling
This commit is contained in:
@@ -93,6 +93,7 @@ public partial class MainWindow
|
||||
// Update the display
|
||||
DisplayCategory();
|
||||
DisplayFeed();
|
||||
UpdateToolbarButtonState();
|
||||
|
||||
Settings.Default.LastCategoryID = _currentCategory?.Id.ToString() ?? string.Empty;
|
||||
}
|
||||
|
||||
@@ -16,12 +16,16 @@ public partial class MainWindow
|
||||
{
|
||||
case MouseButton.XButton1:
|
||||
|
||||
PreviousFeed();
|
||||
if (PreviousToolbarButton.IsEnabled)
|
||||
PreviousFeed();
|
||||
|
||||
break;
|
||||
|
||||
case MouseButton.XButton2:
|
||||
|
||||
NextFeed();
|
||||
if (NextToolbarButton.IsEnabled)
|
||||
NextFeed();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ public partial class MainWindow : IDisposable
|
||||
private void UpdateToolbarButtonState()
|
||||
{
|
||||
// Cache the feed count to save (a little) time
|
||||
var feedCount = _feedList?.Count() ?? 0;
|
||||
var feedCount = Settings.Default.DisplayEmptyFeeds ? _feedList.Count() : _feedList.Count(x => x.Items.Any(y => !y.BeenRead));
|
||||
|
||||
// Set button states
|
||||
PreviousToolbarButton.IsEnabled = feedCount > 1;
|
||||
@@ -198,7 +198,7 @@ public partial class MainWindow : IDisposable
|
||||
OpenAllToolbarButton.IsEnabled = feedCount > 0;
|
||||
MarkReadToolbarButton.IsEnabled = feedCount > 0;
|
||||
FeedLabel.Visibility = feedCount == 0 ? Visibility.Hidden : Visibility.Visible;
|
||||
FeedButton.Visibility = feedCount > 1 ? Visibility.Hidden : Visibility.Visible;
|
||||
FeedButton.Visibility = feedCount == 0 ? Visibility.Hidden : Visibility.Visible;
|
||||
CategoryGrid.Visibility = _database.Categories.Count > 1 ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user