tedit development and design discussion
-
@domubpkm I finally found my mistake and managed to implement a read-only mode using a webview. Can you (and anyone else of course) please test this new build:
link(use link below)It might not be the most fancy way of doing it, but it seems to work. Since the text is shown in html, if you do use common html tags like <b>bold text</b> they should be displayed. Yes, that means if you do bother copying links with the full html link tag, they should be clickable as well.
-
@danfro Hello and thank you for your new attempt.
I have just tested and at this point, the reading mode only make the app crashes at the opening of a file on the Volla 22 last RC Focal. Reading/writing mode works normally : the app doesn't crash at the opening of a file. -
@domubpkm Please try this build. https://gitlab.com/Danfro/tedit/-/jobs/10912582472/artifacts/raw/build/aarch64-linux-gnu/app/tedit.danfro_3.5.1.1_arm64.click
I did increase the version number. This might be needed for the device to pick up the apparmor change. I had to add "webview" permission there.
-
@danfro I have to test better but the read only mode works now ! Thanks
Not very easy to select and copy a piece of text, so as to paste, but it seems to work too ! Thanks.
Edit :
I noticed too in this version :- Seems to put the extension .txt even if we don't want to when we record a file ;
- The links https:// isn't clickable in read only mode. Should be clickable ?
-
@domubpkm tedit uses .txt for all files stored. That should have been there all the time. Is there some different behaviour now than before?
No, the link would only be clickable if you would wrap it in proper html tags. See here: https://www.w3schools.com/html/html_links.asp
I will try to see if I can improve the copy option, but that is our morph/webview implementation. Should be the same in your browser.
-
@danfro Why are you using a WebView instead of the normal Text type? If the user uses html shouldn't they open it in the browser instead?
It's much simpler (and faster) to use a Text type. -
@ikoz Because text doesn't allow scrolling and pan, webview does. The whole handling of long documents is not easy and would need to be added manually. So a webview is an easy out-of-the-box solution. Not perfect, sure.
-
@danfro What about the readOnly property of the existing TextArea? I tried it and it doesn't seem to have any limitation.
-
@ikoz Have you tried it with a large text in a TextArea? Its too long ago to remember details, but I tried that and decided this won't be a good solution. I think scrolling or so was not possible or some other restriction. Some users do have multi page text, so that would need to be handled.
Its not that I am against it. If we can make that usable I won't mind. Maybe I did something wrong when trying.
-
@danfro said in tedit development and design discussion:
tedit uses .txt for all files stored. That should have been there all the time. Is there some different behaviour now than before?
No it is indeed the same behaviour than for the OpenStore click.
In this case, is the first option of the screenshot always apropriate ? (add .txt) -
@danfro I think I found the problem you faced. I put a checkbox in the button row to toggle read-only mode, and when read-only mode is enabled, the TextArea isn't transparent so it is always white regardless of the selected theme (dark/ambiance). This may be a Lomiri Toolkit bug, inherited from the QuickControls' TextArea as that never changes the background color.
As an alternative, Text inside a Flickable can also work, but it doesn't allow selecting text, so you can leave it as-is.
-
@domubpkm This is more for the "human eye". The file will be simple text regardless of the extension. But I think this is safer also when sharing to other apps since they can use the extension.
But I agree, I should simply add the extension without bothering the user with this checkbox.
-
@ikoz ah, background color. That could be too. With flickable I think, I couldn't get flicking flickable and scrolling in the TextArea get working since both use the touch events. Yeah, not that easy. Its not that I didn't try.
-
@danfro said in tedit development and design discussion:
No, the link would only be clickable if you would wrap it in proper html tags. See here: https://www.w3schools.com/html/html_links.asp
Ok, i tested and it works as you say.