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

Feature to change preview font size for plain/text files. #190

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

34x
Copy link

@34x 34x commented Oct 22, 2017

Hi!
First of all thank you for the app and server!

In short what this pr doing:

And details:

One of my way to use Seafile on iOS it's reading and editing text files. I am using iPhone SE and standard WebView font size sometimes very difficult to read so I decided to contribute a bit to the project.

This PR contains from 2 major parts:

  1. View element that display quick settings for changing font size (it's small orange box on the right bottom corner with the arrow). I decided to create this instead of putting this to common settings for two reasons: the first one - I found it's not easy to understand philosophy of settings screen at all and the second is that's much more intuitive to change font size right in context of viewing a file.

  2. The second part is about actually changing the font and storing it between app launches. For storing data I used [NSUserDefaults standardUserDefaults] but not sure if it's correct or not, because in some places app uses defaults for domain and in some - standard.

For handling changes I added observer for this property in user defaults.

And for actually setting font size I used js string document.body.style.fontSize = '%@'; in the webView. Sizes are provided in % to reflect user defined settings for the system fonts and default value is 100%.

Bugs: I found that with some sizes update did not work (for example when font size changed from 400% to 420% then to 440% e.t.c.) but after closing the view and opening it again it uses correct size. I am not sure why it happens, maybe some MobileSafari specific.

Best regards
Maks

@poetwang
Copy link
Member

thanks for contributing to the project and make the app better

@scottcc
Copy link

scottcc commented Oct 24, 2017

Agreed, this looks very nice. Incidentally, when you hit the back button you can see that the default iOS text rendering has the table view cell labels collapsed/clipped vertically. Can you confirm you're using Xcode 9?

I'd posted the clipping as #187, and we do have a branch that has those fixed too, but I'm not yet sure if there's appetite for a larger MR yet. Just looking to confirm what you see.

@34x
Copy link
Author

34x commented Oct 24, 2017

@scottcc Yes, I am using Xcode 9 and table cells look weird (like half collapsing).

@scottcc
Copy link

scottcc commented Oct 24, 2017

Thanks, yeah. From what we've seen, it has to do with the top-to-bottom constraints within that cell. Appreciate the confirmation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants