Category editor redesign, English as default language
- Category editor: icon tile per category opens an icon + color picker (no clipped mini combo boxes), placeholders explained, live preview - Header glyph removed; dialog follows the shared styles - Dialogs opened from Settings are owned by the active window (category editor could open behind the settings window) - Default language is English; German via Settings > Language Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -112,6 +112,33 @@ namespace ReminderOrganizer
|
||||
|
||||
private void Cancel_Click(object sender, RoutedEventArgs e) => DialogResult = false;
|
||||
|
||||
private void Window_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Escape) DialogResult = false;
|
||||
}
|
||||
|
||||
/// <summary>The picker buttons live in a popup; walk up (visual, then logical) to the category row.</summary>
|
||||
private static Category? CategoryOf(object sender)
|
||||
{
|
||||
DependencyObject? d = sender as DependencyObject;
|
||||
while (d != null)
|
||||
{
|
||||
if (d is FrameworkElement { DataContext: Category c }) return c;
|
||||
d = System.Windows.Media.VisualTreeHelper.GetParent(d) ?? LogicalTreeHelper.GetParent(d);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void PickGlyph_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is FrameworkElement { Tag: string glyph } && CategoryOf(sender) is { } c) c.Glyph = glyph;
|
||||
}
|
||||
|
||||
private void PickColor_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is FrameworkElement { Tag: string color } && CategoryOf(sender) is { } c) c.Color = color;
|
||||
}
|
||||
|
||||
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.LeftButton == MouseButtonState.Pressed && e.OriginalSource is not TextBox) DragMove();
|
||||
|
||||
Reference in New Issue
Block a user