Professional redesign: native window, settings, calmer UI
- WindowChrome: resizable, snap layouts, native shadow, DWM rounded corners; size/position remembered; fade-in after load (no theme flash) - Menu bar replaced by a settings window (theme system/light/dark, language, sound, autostart, categories, data, shortcuts, about) - Shared styles in Themes/Controls.xaml; neutral palette with one accent applied to Application.Resources (context menus/tooltips themed) - Rows: To-Do style check left, title + details, relative date right, actions on hover, visible selection (Enter edits, Del deletes) - No glow/scale effects; subtle animations (dialogs, snackbar, chevrons) - Checking a recurring task moves it to the next date (with undo) - Themed combo box, date picker, check box; neutral dialog headers - New flat app icon (tools/make_icon.py) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -167,9 +167,77 @@ namespace ReminderOrganizer.ViewModels
|
||||
|
||||
// ---------- settings ----------
|
||||
|
||||
public bool IsGerman => _localizationService.CurrentLanguage == "de";
|
||||
public bool IsEnglish => _localizationService.CurrentLanguage == "en";
|
||||
public bool IsAutostartEnabled => _autostartService.IsAutostartEnabled;
|
||||
public bool IsGerman
|
||||
{
|
||||
get => _localizationService.CurrentLanguage == "de";
|
||||
set { if (value) _localizationService.SetLanguage("de"); }
|
||||
}
|
||||
public bool IsEnglish
|
||||
{
|
||||
get => _localizationService.CurrentLanguage == "en";
|
||||
set { if (value) _localizationService.SetLanguage("en"); }
|
||||
}
|
||||
|
||||
public bool IsAutostartEnabled
|
||||
{
|
||||
get => _autostartService.IsAutostartEnabled;
|
||||
set { if (value != _autostartService.IsAutostartEnabled) ToggleAutostart(); }
|
||||
}
|
||||
|
||||
// ---------- theme: system / light / dark ----------
|
||||
|
||||
/// <summary>"system", "light" or "dark".</summary>
|
||||
public string ThemeMode
|
||||
{
|
||||
get => string.IsNullOrEmpty(_appData.ThemeMode) ? "system" : _appData.ThemeMode;
|
||||
set
|
||||
{
|
||||
if (ThemeMode == value) return;
|
||||
_appData.ThemeMode = value;
|
||||
OnPropertyChanged();
|
||||
OnPropertyChanged(nameof(IsThemeSystem));
|
||||
OnPropertyChanged(nameof(IsThemeLight));
|
||||
OnPropertyChanged(nameof(IsThemeDark));
|
||||
ApplyThemeMode();
|
||||
}
|
||||
}
|
||||
public bool IsThemeSystem { get => ThemeMode == "system"; set { if (value) ThemeMode = "system"; } }
|
||||
public bool IsThemeLight { get => ThemeMode == "light"; set { if (value) ThemeMode = "light"; } }
|
||||
public bool IsThemeDark { get => ThemeMode == "dark"; set { if (value) ThemeMode = "dark"; } }
|
||||
|
||||
private void ApplyThemeMode()
|
||||
{
|
||||
IsDarkMode = ThemeMode switch
|
||||
{
|
||||
"light" => false,
|
||||
"dark" => true,
|
||||
_ => SystemPrefs.IsDarkMode()
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>Windows switched light/dark: follow it when the app is set to "system".</summary>
|
||||
public void OnSystemThemeChanged()
|
||||
{
|
||||
if (ThemeMode == "system") ApplyThemeMode();
|
||||
}
|
||||
|
||||
public string DataFolder => DataService.DefaultDataDirectory;
|
||||
|
||||
// ---------- window placement ----------
|
||||
|
||||
public Rect? SavedWindowBounds =>
|
||||
_appData.WindowWidth is double w && _appData.WindowHeight is double h && _appData.WindowLeft is double l && _appData.WindowTop is double t
|
||||
? new Rect(l, t, w, h) : null;
|
||||
public bool SavedWindowMaximized => _appData.WindowMaximized;
|
||||
|
||||
public void RememberWindow(Rect bounds, bool maximized)
|
||||
{
|
||||
_appData.WindowLeft = bounds.Left;
|
||||
_appData.WindowTop = bounds.Top;
|
||||
_appData.WindowWidth = bounds.Width;
|
||||
_appData.WindowHeight = bounds.Height;
|
||||
_appData.WindowMaximized = maximized;
|
||||
}
|
||||
|
||||
public bool PlaySound
|
||||
{
|
||||
@@ -384,6 +452,8 @@ namespace ReminderOrganizer.ViewModels
|
||||
public ICommand ClearSearchCommand { get; }
|
||||
public ICommand EditCategoriesCommand { get; }
|
||||
public ICommand ShowCategoryCommand { get; }
|
||||
public ICommand OpenSettingsCommand { get; }
|
||||
public ICommand OpenDataFolderCommand { get; }
|
||||
|
||||
public MainViewModel(
|
||||
IDataService dataService,
|
||||
@@ -402,6 +472,7 @@ namespace ReminderOrganizer.ViewModels
|
||||
_appData.Categories.FirstOrDefault(c => c.Id == id) ?? _appData.Categories.FirstOrDefault();
|
||||
ReminderTask.DisplayCulture = () => new System.Globalization.CultureInfo(_localizationService.CurrentLanguage == "de" ? "de-DE" : "en-US");
|
||||
ReminderTask.RelativeFormatter = RelativeText;
|
||||
ReminderTask.RecurrenceFormatter = type => L(type.ToString());
|
||||
|
||||
// Empty name = refresh every binding (all texts depend on the language).
|
||||
_localizationService.StringsChanged += (s, e) =>
|
||||
@@ -418,7 +489,7 @@ namespace ReminderOrganizer.ViewModels
|
||||
AddTaskToFolderCommand = new RelayCommand<Folder>(AddTaskToFolder);
|
||||
DeleteTaskCommand = new RelayCommand<ReminderTask>(DeleteTask);
|
||||
EditTaskCommand = new RelayCommand<ReminderTask>(EditTask);
|
||||
ToggleDoneCommand = new RelayCommand<ReminderTask>(t => { _ = SaveAsync(); });
|
||||
ToggleDoneCommand = new RelayCommand<ReminderTask>(ToggleDone);
|
||||
DeleteFolderCommand = new RelayCommand(DeleteFolder, () => SelectedFolder != null);
|
||||
RenameFolderCommand = new RelayCommand(RenameFolder, () => SelectedFolder != null);
|
||||
MoveFolderUpCommand = new RelayCommand(() => MoveFolderBy(-1), () => SelectedFolder != null && Folders.IndexOf(SelectedFolder) > 0);
|
||||
@@ -430,7 +501,7 @@ namespace ReminderOrganizer.ViewModels
|
||||
SetLanguageEnCommand = new RelayCommand(() => _localizationService.SetLanguage("en"));
|
||||
ToggleDarkModeCommand = new RelayCommand(() => IsDarkMode = !IsDarkMode);
|
||||
TogglePlaySoundCommand = new RelayCommand(() => PlaySound = !PlaySound);
|
||||
ExitCommand = new RelayCommand(() => Application.Current.Shutdown());
|
||||
ExitCommand = new RelayCommand(App.Quit);
|
||||
MoveTaskToFolderCommand = new RelayCommand<(ReminderTask, Folder)>(MoveTaskToFolder);
|
||||
TestNotificationCommand = new RelayCommand(TestNotification);
|
||||
ImportCsvCommand = new RelayCommand(ImportCsv);
|
||||
@@ -439,6 +510,13 @@ namespace ReminderOrganizer.ViewModels
|
||||
OpenDiscordCommand = new RelayCommand(OpenDiscord);
|
||||
ShowUpcomingCommand = new RelayCommand(() => ShowCategory(null));
|
||||
ShowCategoryCommand = new RelayCommand<string>(ShowCategory);
|
||||
OpenSettingsCommand = new RelayCommand(() =>
|
||||
new SettingsWindow(this) { Owner = Application.Current.MainWindow }.ShowDialog());
|
||||
OpenDataFolderCommand = new RelayCommand(() =>
|
||||
{
|
||||
try { System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo { FileName = DataFolder, UseShellExecute = true }); }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine($"[OpenDataFolder] {ex.Message}"); }
|
||||
});
|
||||
UndoCommand = new RelayCommand(Undo);
|
||||
ClearSearchCommand = new RelayCommand(() => { SearchText = ""; FilterMode = TaskFilterMode.All; CategoryFilter = null; });
|
||||
EditCategoriesCommand = new RelayCommand(EditCategories);
|
||||
@@ -465,7 +543,11 @@ namespace ReminderOrganizer.ViewModels
|
||||
bool changed = _appData.EnsureDefaultCategories(L);
|
||||
changed |= _appData.MigrateBirthdays() > 0;
|
||||
if (changed) await SaveAsync();
|
||||
_isDarkMode = _appData.IsDarkMode.Value;
|
||||
// Older files only knew IsDarkMode: keep their explicit choice; new installs follow Windows.
|
||||
if (string.IsNullOrEmpty(_appData.ThemeMode))
|
||||
_appData.ThemeMode = firstRun ? "system" : (_appData.IsDarkMode.Value ? "dark" : "light");
|
||||
_isDarkMode = ThemeMode switch { "light" => false, "dark" => true, _ => SystemPrefs.IsDarkMode() };
|
||||
_appData.IsDarkMode = _isDarkMode;
|
||||
_appData.Folders.CollectionChanged += (s, e) => { HookFolders(); ReindexTasks(); };
|
||||
HookFolders();
|
||||
ReindexTasks();
|
||||
@@ -703,6 +785,30 @@ namespace ReminderOrganizer.ViewModels
|
||||
_ = SaveAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The check box already flipped IsNotified. One-off tasks are simply done/undone.
|
||||
/// Recurring tasks (and anniversaries) are never "done for ever": checking moves them to the next date.
|
||||
/// </summary>
|
||||
private void ToggleDone(ReminderTask? task)
|
||||
{
|
||||
if (task == null) return;
|
||||
if (task.IsRecurring && task.IsNotified)
|
||||
{
|
||||
var oldDate = task.ReminderDate;
|
||||
var oldPre = task.IsPreNotified;
|
||||
var from = oldDate > DateTime.Now ? oldDate : DateTime.Now;
|
||||
task.IsNotified = false;
|
||||
task.ReminderDate = task.GetNextOccurrence(from);
|
||||
task.IsPreNotified = false;
|
||||
OfferUndo(string.Format(L("MovedToNext"), task.Name, task.DisplayDate), () =>
|
||||
{
|
||||
task.ReminderDate = oldDate;
|
||||
task.IsPreNotified = oldPre;
|
||||
});
|
||||
}
|
||||
_ = SaveAsync();
|
||||
}
|
||||
|
||||
private void EditTask(ReminderTask? task)
|
||||
{
|
||||
if (task == null) return;
|
||||
|
||||
Reference in New Issue
Block a user