mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-02-16 10:58:31 -05:00
Rework much of options UI
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
using System.Linq;
|
||||
using FeedCenter.Properties;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using FeedCenter.Properties;
|
||||
|
||||
namespace FeedCenter.Options;
|
||||
|
||||
@@ -18,43 +16,18 @@ public partial class DisplayOptionsPanel
|
||||
{
|
||||
base.LoadPanel();
|
||||
|
||||
LockWindowCheckBox.IsChecked = Settings.Default.WindowLocked;
|
||||
DisplayEmptyFeedsCheckBox.IsChecked = Settings.Default.DisplayEmptyFeeds;
|
||||
ToolbarLocationComboBox.SelectedItem = ToolbarLocationComboBox.Items.Cast<ComboBoxItem>().First(comboBoxItem => (Dock) comboBoxItem.Tag == Settings.Default.ToolbarLocation);
|
||||
MultipleLineDisplayComboBox.SelectedItem = MultipleLineDisplayComboBox.Items.Cast<ComboBoxItem>().First(comboBoxItem => (MultipleLineDisplay) comboBoxItem.Tag == Settings.Default.MultipleLineDisplay);
|
||||
|
||||
MarkLoaded();
|
||||
}
|
||||
|
||||
private void LockWindowCheckBox_Click(object sender, System.Windows.RoutedEventArgs e)
|
||||
private void OnSaveSettings(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!HasLoaded) return;
|
||||
|
||||
if (LockWindowCheckBox.IsChecked.HasValue && Settings.Default.WindowLocked != LockWindowCheckBox.IsChecked.Value)
|
||||
Settings.Default.WindowLocked = LockWindowCheckBox.IsChecked.Value;
|
||||
SaveSettings();
|
||||
}
|
||||
|
||||
private void DisplayEmptyFeedsCheckBox_Click(object sender, System.Windows.RoutedEventArgs e)
|
||||
private void SaveSettings()
|
||||
{
|
||||
if (!HasLoaded) return;
|
||||
|
||||
if (DisplayEmptyFeedsCheckBox.IsChecked.HasValue && Settings.Default.DisplayEmptyFeeds != DisplayEmptyFeedsCheckBox.IsChecked.Value)
|
||||
Settings.Default.DisplayEmptyFeeds = DisplayEmptyFeedsCheckBox.IsChecked.Value;
|
||||
}
|
||||
|
||||
private void ToolbarLocationComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!HasLoaded) return;
|
||||
|
||||
var dock = (Dock) ((ComboBoxItem) ToolbarLocationComboBox.SelectedItem).Tag;
|
||||
Settings.Default.ToolbarLocation = dock;
|
||||
}
|
||||
|
||||
private void MultipleLineDisplayComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!HasLoaded) return;
|
||||
|
||||
var multipleLineDisplay = (MultipleLineDisplay) ((ComboBoxItem) MultipleLineDisplayComboBox.SelectedItem).Tag;
|
||||
Settings.Default.MultipleLineDisplay = multipleLineDisplay;
|
||||
Settings.Default.Save();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user