annotation-style-presets - #98
Merged
Merged
Conversation
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Adds configurable annotation style presets (color + stroke thickness) that can be edited in Settings and applied from a new dropdown in the overlay annotation toolbar, persisting selected presets back into user settings.
Changes:
- Introduces
AnnotationStylePresetand stores presets inUserSettings.StylePresets(with defaults). - Adds Settings UI + view models to add/remove/edit presets and save them to settings.json.
- Adds overlay toolbar dropdown UI +
AnnotationViewModellogic/tests to apply presets and update defaults.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| Pointframe/ViewModels/SettingsViewModel.cs | Adds preset collection state + commands; saves presets to UserSettings. |
| Pointframe/ViewModels/OverlayViewModel.cs | Ensures preset selection is cleared and menu closes when picking a custom color. |
| Pointframe/ViewModels/AnnotationViewModel.cs | Loads presets for the overlay UI; adds menu state + command to apply presets and persist defaults. |
| Pointframe/ViewModels/AnnotationStylePresetViewModel.cs | New editable preset row VM for Settings. |
| Pointframe/ViewModels/AnnotationPresetItemViewModel.cs | New read-only overlay item VM for preset dots/menu rows. |
| Pointframe/SettingsWindow.xaml | Adds “Style Presets” section UI for editing presets. |
| Pointframe/Services/UserSettingsService.cs | Updates settings cloning to include StylePresets. |
| Pointframe/OverlayWindow.xaml | Replaces color button with dropdown that shows preset dots + popup menu. |
| Pointframe/Models/UserSettings.cs | Adds StylePresets with default preset values. |
| Pointframe/Models/AnnotationStylePreset.cs | New model defining preset structure and max constraints. |
| Pointframe.Tests/ViewModels/AnnotationViewModelTests.cs | Adds unit tests covering preset application behavior and menu state. |
| Pointframe.Tests/SettingsWindowTests.cs | Removes an unused using. |
| Pointframe.Tests/Services/AnnotationCanvasRendererTests.cs | Formatting-only changes to improve readability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <Button Width="34" Height="42" Cursor="Hand" | ||
| Style="{StaticResource ActionBtn}" | ||
| Command="{Binding ToggleColorMenuCommand}" | ||
| ToolTip="Colour / Style presets"> |
| <TextBox Grid.Column="1" | ||
| Margin="0,0,10,0" | ||
| Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}" | ||
| MaxLength="24" |
Comment on lines
+140
to
+145
| StylePresets = [.. settings.StylePresets.Select(p => new Pointframe.Models.AnnotationStylePreset | ||
| { | ||
| Name = p.Name, | ||
| Color = p.Color, | ||
| StrokeThickness = p.StrokeThickness, | ||
| })], |
| _defaultAnnotationColor = ParseAnnotationColorOrFallback(s.DefaultAnnotationColor); | ||
| _stylePresets = new ObservableCollection<AnnotationStylePresetViewModel>( | ||
| s.StylePresets.Select(p => new AnnotationStylePresetViewModel(p))); | ||
| _stylePresets.CollectionChanged += (_, _) => OnPropertyChanged(nameof(CanAddPreset)); |
Comment on lines
+164
to
+170
| var presets = _settingsService.Current.StylePresets; | ||
| if (index < 0 || index >= presets.Count) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| var preset = presets[index]; |
Comment on lines
+764
to
+766
| <TextBlock Text="Style Presets" Style="{StaticResource GroupTitle}"/> | ||
| <TextBlock Text="Up to 5 colour and thickness shortcuts in the annotation toolbar." | ||
| Style="{StaticResource GroupDescription}"/> |
Replaced dynamic binding for style preset max count with static text in the Settings window, clarifying the toolbar shortcut limit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.