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

Add ability to colorize completed tasks when using StrikeoutTasksCommand #1528

Closed
PodyNoo opened this issue Aug 11, 2024 · 7 comments · Fixed by #1529
Closed

Add ability to colorize completed tasks when using StrikeoutTasksCommand #1528

PodyNoo opened this issue Aug 11, 2024 · 7 comments · Fixed by #1529
Assignees
Labels
feature-request New feature or request released Available in a released installer

Comments

@PodyNoo
Copy link

PodyNoo commented Aug 11, 2024

Problem to Solve

When i'm using StrikeoutTasksCommand on long list of tasks, at first glance, completed tasks can be difficult to differentiate from tasks still to be done.

New Feature/Solution

If we could also colorize text of completed tasks while using StrikeoutTasksCommand, remaining tasks would be more visibles.

Additional Context

image
image

@PodyNoo
Copy link
Author

PodyNoo commented Aug 11, 2024

I have something working here, if you are interested (translations are missing) : PodyNoo@2a8bc49

EDIT: updated commit link, corrected bad EOL / files indentation

@stevencohn stevencohn added the feature-request New feature or request label Aug 11, 2024
@stevencohn stevencohn linked a pull request Aug 12, 2024 that will close this issue
@stevencohn stevencohn self-assigned this Aug 12, 2024
@stevencohn
Copy link
Owner

stevencohn commented Aug 12, 2024

Decided to combine into the Horizontal Lines sheet, renaming it to ColorsSheet

image

Also found that there were a few logic errors in the original StrikeoutTasksCommand code so had to refactor it rather than adopting your commit directly.

So, thank you for the request. It will be available in the next release.

@stevencohn stevencohn added the next-release Addressed but not yet released label Aug 12, 2024
@PodyNoo
Copy link
Author

PodyNoo commented Aug 12, 2024

Oh, thanks a lot for this !

@PodyNoo
Copy link
Author

PodyNoo commented Aug 12, 2024

If it can be useful, i did push my code that i modified yesterday to use Stylizer / StyleAnalyzer / Theme-based colors as you advised : main...PodyNoo:OneMore:1528-colorize-strikeout-tasks-command

The only thing not working is, in dark mode, when i'm using ThemeManager.Instance.GetColor("ControlText").ToRGBHtml() instead of #000000 i does not reset the color on task that goes from completed to to-do tasks.

Apart from that bug in dark mode, to make it work with Stylizer/StyleAnalyzer, i needed to modify Merge() method from Style that was missing a property. (PodyNoo@a37500f)

I also needed to modify CollectStyleProperties() from XElementExtensions to reverse the order of css properties parsing, because my OE/T nodes always had 2 colors properties (style="color:#000000;margin:0in;font-family:Calibri;font-size:12.0pt;
color:#969696"), and the wrong one was added in my StyleProperties. (PodyNoo@67bc932)

Maybe I didn't quite fully understand how it works, so i might be wrong, but if not this might cause trouble elsewhere in the future.

@stevencohn
Copy link
Owner

In my excitement, I led you astray on using the ThemManager, which is intended only for UI controls, not on-page content. Content is handled entirely with the Style family of classes. Compare your code to mine. I'm only use the Style class and its default values to make decisions.

The OET relationship with the CDATA style is a transient projection when the text insert cursor/caret is position in the OE paragraph, so a small adjustment is needed there only when adding stirkethrough.

@stevencohn
Copy link
Owner

stevencohn commented Aug 12, 2024

Regarding your last two commits. I'm afraid you may have broken a few other commands across OneMore . The Style and XElementExtensions are used extensively throughout and need to be tested for all use cases.

Yes, there can be two color values in a style attribute., most often when the text cursor interrupts the CDATA. The first is color I believe is the default text color for the page. The second color is tagged with the special sequence 
 which indicates the actual color to apply to the run.

In these cases, we don't really care. If adding strikeout, we want to apply the chosen color to the entire line, overwriting any manual changes along the way. If removing strikeout, we can only revert back to the default page color. Attempting to preserve any manual color changes within the run is impractical and can result in no visual changes to color for the whole paragraph if the whole paragraph was customized.

@PodyNoo
Copy link
Author

PodyNoo commented Aug 12, 2024

Thanks for the explanations, have a nice day 🙂 !

@stevencohn stevencohn added released Available in a released installer and removed next-release Addressed but not yet released labels Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request released Available in a released installer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants