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