Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsaved indicator for DocumentControl #2626

Conversation

ievgen-baida
Copy link
Contributor

This PR adds possibility to mark individual document page as one having unsaved changes (HasUnsavedChanges). Such page would then be rendered with a little round indicator after the name of the document. The color can be configured using UnsavedBackgroundColor property.

Also, the calculations and drawing for each tab in ThemedDocumentControlHandler have been refactored:

  • Introduce ImageRect and UsavedRect;
  • Calculate rectangles once in CalculateTab (except for
    closeForegroundRect which is calculated while drawing it);
  • Restructure calculations element by element;
  • Each of the element has valid location and size (even though it can be
    empty);
  • (Hopefully) simplify calculations by using PointF and RectangleF
    methods;
  • Simplify drawing of the close button.

- Introduce `ImageRect` and `UsavedRect`;
- Calculate rectangles once in `CalculateTab` (except for
`closeForegroundRect` which is calculated while drawing it);
- Restructure calculations element by element;
- Each of the element has valid location and size (even though it can be
 empty);
- (Hopefully) simplify calculations by using `PointF` and `RectangleF`
methods;
- Simplify drawing of the close button.
@cwensley
Copy link
Member

cwensley commented Mar 1, 2024

Looks great, @ievgen-baida! Thanks for the contribution.

@cwensley cwensley merged commit da62e2c into picoe:develop Mar 1, 2024
3 checks passed
@cwensley cwensley added this to the 2.8.3 milestone Mar 1, 2024
@ievgen-baida ievgen-baida changed the title Unsaved indictator for DocumentControl Unsaved indicator for DocumentControl Mar 1, 2024
@ievgen-baida ievgen-baida deleted the feature/unsaved-indictator-for-document-control branch March 12, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants