Create launcher widget for todo/textediting, closes #1997
Introduces a Todo widget.
Todo:
- [x] widget color scheme
- [x] place cursor on the clicked line
- [x] add widget preview image
Thanks, let me know when you want a check
as you mentioned "widget color scheme settings": please don't make separate colors for that. You can use the same foreground (text) and background color like at the normal editor ("" basic color scheme""). There are getters for that in AppSettings.java
Suggestion: reuse our existing widget but replace the provider with one which supplies lines from a todo.txt file.
You'll get 70% of the widget for free with good code reuse.
In these commits:
- used the editor color scheme
- used Document and TodoTxtTask classes
- parse the task text (removed patterns such as creation dates (allows the widgets to be smaller))
- made a temporary workaround for placing the cursor on the clicked line
Suggestion: reuse our existing widget but replace the provider with one which supplies lines from a todo.txt file.
Which parts can be reused?
Which parts can be reused?
Our current widget displays a list of files. Clicking on a file opens it.
What you want is a list of todo text lines where clicking on a line opens the todo file at the appropriate line.
We can achieve this by:
- Changing the provider to provide lines
- Changing the intent to open the file at the correct line
For 2 we just need to add an EXTRA_FILE with the file and EXTRA_FILE_LINE_NUMBER with the correct line number to each intent.
Both can be done by creating a new factory and reusing the rest of the widget. You will need to modify the other parts of the widget to use the correct factory though.
I may be missing something here, but I don't think so
@wshoy
What do you think about that, possibly also in a later PR?:
To show a file selection dialog when making the widget, to select the file to create the widget for.
In AppSettings we can store what files are currently widget-used (to trigger the widget update)
At the end the most important part is that users don't lose data..so the file management part. Years of changes of Markor told..it's very difficult to get that somewhat 99% reliable working for most users.
I fear that another compound of the big calculations is then widgets and their currently loaded content. Hope it not makes too much issues.
To show a file selection dialog when making the widget
It is a good idea. If that happens, I think, that the ToDo functionality should be prioritized in some way (maybe making it the default file or making a separate ToDo widget). I assume, that the widget would be mostly used for the ToDo file, so it should be made easy for the user to do that.
I assume that there is a split interest of todo vs notes/normal text editing. (so basically resembling why ToDo + QuickNote have their prominent separated existance)
Just to note again - feel free to make in the PR what you have time and interest on. I can only tell what I personally think is a good way. At the end most important need is that the file handling does not spread havoc and users lose recent modifications 😄
Is the WIP marking still the case?
I want to track down the issues you mentioned about virtual folders not being updated and see if there are any related issues with this approach.
Aside from that this is done
Is the WIP marking still the case?
It's finished.
has conflicts now unfortunatley
Thanks you, I merged the widget! 😄
Also tried it: Seems currently limited to just displaying ToDo, and that readonly.
I think editing is not a all too good idea, but selecting the file for each widget would make sense.
Awesome to see this merged! Just curious, when will this be added to a release?
Whenever the next release will be.
If I may be permitted an off-topic message, thank you so much for working on this feature! It'll be really helpful. I really appreciate the work everyone does!