|
| 1 | +# Changelog |
| 2 | + |
| 3 | +## V1.2.0.0 |
| 4 | + |
| 5 | +### MahApps.Metro Removal |
| 6 | + |
| 7 | +- Removed MahApps.Metro (v1.6.5) and ControlzEx (v3.0.2.4) NuGet dependencies |
| 8 | +- Removed MahApps.Metro, ControlzEx, and System.Windows.Interactivity assembly references from .csproj |
| 9 | +- Removed MahApps.Metro DLLs from InnoSetup installer (`OATControl Setup.iss`) |
| 10 | +- Deleted legacy theme resource files: `RedAccent.xaml`, `RedControls.xaml`, `RedTheme.xaml`, `GreyControls.xaml` |
| 11 | + |
| 12 | +### Custom Theme Engine |
| 13 | + |
| 14 | +- Created `ThemeManager` singleton (`Theming/ThemeManager.cs`, +377 lines) for runtime theme loading, brush generation, and theme switching |
| 15 | +- Created `ThemeColorDefinitions.cs` — centralized registry of all color keys with display names, groups, and default values |
| 16 | +- `ThemeManager.GenerateBrushes` creates `SolidColorBrush` resources at runtime from theme `Color` resources; also generates `SystemColors` override brushes (`HighlightTextBrushKey`, `ControlTextBrushKey`, `InactiveSelectionHighlightBrushKey`) |
| 17 | +- Brush key naming convention: `AppXxxColor` (Color resource) → `AppXxxBrush` (generated SolidColorBrush) |
| 18 | +- User themes stored as XAML in `%AppData%\OpenAstroTracker\Themes\`; scanned and validated on startup |
| 19 | +- Theme selection persisted in `AppSettings.ThemeName` (defaults to DarkAstronomy) |
| 20 | +- Theme picker added to `DlgAppSettings` General tab with live switching |
| 21 | +- Added `ThemeManager.ImportTheme`/`ExportTheme`/`DeleteTheme` for user theme file management |
| 22 | + |
| 23 | +### Theme Files |
| 24 | + |
| 25 | +- `Resources/Themes/Base.xaml` (+652 lines) — implicit styles for all standard WPF controls: TextBlock, TextBox, Button, CheckBox, RadioButton, ComboBox, TabControl, TabItem, ScrollBar, ProgressBar, ListViewItem, ToggleButton. All use `DynamicResource` for theme-aware binding. |
| 26 | +- `Resources/Themes/DarkAstronomy.xaml` — dark theme with red accent palette (49 color definitions) |
| 27 | +- `Resources/Themes/Daylight.xaml` — light theme with blue accent palette (49 color definitions) |
| 28 | +- Bundled user themes: Blue Planet, Dark Observatory, Deep Space, NINA (`Theming/*.xaml`) |
| 29 | +- Theme XAML files contain only `Color` resources; brushes generated at runtime |
| 30 | + |
| 31 | +### Custom Controls |
| 32 | + |
| 33 | +- **ThemedWindow** (`Controls/ThemedWindow.cs`) — `Window` subclass with `WindowChrome` (`CaptionHeight=30`, `ResizeBorderThickness=4`, `GlassFrameThickness=0`). Replaces `MetroWindow`. Provides borderless window with custom chrome. |
| 34 | + - `ShowTitleBar` property controls title bar visibility |
| 35 | + - `TitleBarButtons` collection for custom title bar buttons |
| 36 | + - `ControlTemplate` in Base.xaml with `WindowCommands` (minimize, maximize, close) |
| 37 | +- **ToggleSwitch** (`Controls/ToggleSwitch.xaml/.cs`) — replaces `MahApps.Metro.Controls.ToggleSwitchButton`. Pill-shaped toggle with sliding thumb. `IsChecked` DP with `ThumbIndicatorBrush` for theme integration. |
| 38 | +- **IconButton** (`Controls/IconButton.xaml/.cs`) — icon-only button control using `ResourceDictionary` style pattern. Replaces MahApps icon button usage. |
| 39 | +- **LabeledToggleSwitch** (`Controls/LabeledToggleSwitch.xaml/.cs`) — ToggleSwitch with label text, used in settings and theme editor. |
| 40 | +- **SlewProgressBar** (`Controls/SlewProgressBar.xaml/.cs`) — reusable progress bar for slew/drift align. Three DPs: `Progress` (double 0-1), `IsActive` (bool), `BarThickness` (double, default 6). Renders as `Border` with `LinearGradientBrush` using theme accent/disabled colors. Replaces 3 inline progress bar implementations in MainWindow. |
| 41 | + |
| 42 | +### Window/Dialog Migration |
| 43 | + |
| 44 | +All 14 windows/dialogs migrated from `MetroWindow` to `ThemedWindow`: |
| 45 | +- MainWindow, DlgAppSettings, DlgAxisCalibration, DlgChecklist, DlgChecklistEditor, DlgChooseOat, DlgCustomActionSetup, DlgEditPoint, DlgMessageBox, DlgNinaPolarAlignment, DlgRunPolarAlignment, DlgRunPolarAlignmentStep1, DlgSharpCapPolarAlignment, DlgWaitForGXState, MiniController, SettingsDialog, SlewPointsWindow, TargetChooser |
| 46 | + |
| 47 | +Each dialog: |
| 48 | +- Replaced `MetroWindow` base with `ThemedWindow` |
| 49 | +- Removed MahApps namespace declarations |
| 50 | +- Replaced `ToggleSwitchButton` instances with `ToggleSwitch` |
| 51 | + |
| 52 | +### Color Migration |
| 53 | + |
| 54 | +- Converted all `StaticResource` brush references to `DynamicResource` across 12+ XAML files for runtime theme switching |
| 55 | +- Replaced all MahApps brush key references (`AccentBaseColorBrush`, `AccentColorBrush2/3/4`, `TextBrush`, `WhiteBrush`, `WindowBackgroundBrush`, `ControlBackgroundBrush`, `HighlightBrush`) with semantic theme keys (`AppForegroundBrush`, `AppPrimaryBrush`, `AppBackgroundBrush`, etc.) |
| 56 | +- Replaced ~287 hardcoded hex color values across 22+ XAML files with `DynamicResource` semantic key bindings |
| 57 | +- Removed `AppPrimaryColor`/`AppPrimaryBrush` — all references migrated to specific semantic keys (`AppForegroundBrush`, `AppButtonBorderBrush`, `AppButtonHoverBrush`, etc.) |
| 58 | +- `ScopeCircles` and `ScopePointer` — converted `Foreground` from CLR property to `DependencyProperty` for `DynamicResource` binding support |
| 59 | +- `MotorIndicator` — refactored to use theme brushes |
| 60 | + |
| 61 | +### Theme Editor (DlgThemeEditor) |
| 62 | + |
| 63 | +- New dialog (`DlgThemeEditor.xaml` 594 lines, `DlgThemeEditor.xaml.cs` 1048 lines) with: |
| 64 | + - Live preview as mini app window with real themed controls |
| 65 | + - HSL color picker with interactive saturation/lightness square and hue bar |
| 66 | + - RGB and HSL slider inputs with bidirectional sync |
| 67 | + - Hex color textbox (RRGGBB) with bidirectional sync to RGB/HSL sliders |
| 68 | + - Color key selection grouped by category (Text, Background, Buttons, etc.) |
| 69 | + - New Theme: clones current theme into editable user theme |
| 70 | + - Save/Save As: prompts for theme name + author, saves as user theme XAML |
| 71 | + - Import/Export: file dialogs for sharing theme files |
| 72 | + - Editor chrome pinned to Daylight theme (doesn't change when editing other themes) |
| 73 | + - `_updatingPicker` guard prevents re-entrant picker updates; `HexColorBox.Text` still updated during picker-driven changes |
| 74 | + - `_suppressSelectionChanged` prevents handler during programmatic list selection |
| 75 | + |
| 76 | +### Style Consolidation |
| 77 | + |
| 78 | +- Added semantic `TextBlock` styles to Base.xaml: header, subheader, body, caption styles |
| 79 | +- Unified `ListViewItem` template with consistent selection/hover behavior |
| 80 | +- Consolidated `ToggleButton` and `Button` styles into Base.xaml |
| 81 | +- Renamed button styles to semantic names |
| 82 | +- Added `MetroListBoxItem` named style for `ListBoxItem` |
| 83 | +- Added implicit `ToggleButton` style with themed hover/pressed/checked/disabled states |
| 84 | + |
| 85 | +### Other Changes |
| 86 | + |
| 87 | +- Removed `System.Windows.Forms` dependency; replaced with WPF-native `Microsoft.Win32` file dialogs |
| 88 | +- Removed `DlgStepCalibration.xaml/.cs` (789 lines) — unused dialog |
| 89 | +- Removed unused style resources |
| 90 | +- Fixed `MiniController` layout and styling |
| 91 | +- Cleaned up dialog chrome and removed unused files |
| 92 | +- Version bumped from 1.1.24.0 to 1.2.0.0 (`AssemblyInfo.cs`, `OATControl Setup.iss`) |
| 93 | +- `MountVM.cs` — replaced MahApps `DialogManager.ShowMessageAsync()` with `MessageBox.Show()` for DEC limits dialog |
| 94 | +- `PushButton.xaml`/`StopButton.xaml` — removed MahApps converter imports, migrated all brush references to DynamicResource |
| 95 | +- `RangeSlider.xaml/.cs` — tick color properties (`MajorTickColor`, `MinorTickColor`, `TickLabelColor`) converted from CLR properties to `DependencyProperty`s for `DynamicResource` binding |
| 96 | +- `RangeSlider.xaml` — replaced ~12 hardcoded `SolidColorBrush` resources with theme-derived bindings |
| 97 | +- `MotorIndicator.cs` — added `DisabledForeground` DP; control visually dims when mount is disconnected |
| 98 | +- `ThemedWindow.cs` — automatic `Background`/`Foreground` binding via `SetResourceReference`; tinted icon support in title bar; `OnShowTitleBarChanged` dynamically toggles `WindowChrome.CaptionHeight` |
| 99 | +- `DlgChecklist.xaml` — replaced `BoolToBrushConverter` with `DataTrigger`-based Foreground bindings for correct `DynamicResource` resolution |
| 100 | +- `App.xaml` status icons (`WaitingIcon`, `CompleteIcon`, `InProgressIcon`) changed from hardcoded `Brush="Red"` to `DynamicResource AppForegroundBrush` |
| 101 | +- `TargetChooser.xaml` — fixed out-of-theme cyan hover border by inheriting implicit `ListViewItem` style |
| 102 | +- Dialogs set `TitleBarButtons="Close"` where minimize/maximize are inappropriate (DlgAppSettings, DlgAxisCalibration, DlgChooseOat, DlgChecklistEditor, DlgMessageBox) |
| 103 | +- Chromeless windows (`ShowTitleBar=False`): DlgChecklist, MiniController, SlewPointsWindow |
| 104 | +- ThemeManager hot-reload: `FileSystemWatcher` monitors theme XAML in DEBUG builds for instant preview during development |
| 105 | +- Installer: ships bundled user themes to `%AppData%\OpenAstroTracker\Themes\` with `onlyifdoesntexist` flag |
0 commit comments