zotero / reader

PDF/EPUB/HTML reader for Zotero
Other
129 stars 30 forks source link

Add hyphenation and text appearance options for EPUBs #128

Closed AbeJellinek closed 5 months ago

mrtcode commented 5 months ago

It works well!

dstillman commented 5 months ago

Is <input type="range"/>…styleable?

Screenshot 2024-06-19 at 4 54 56 AM

At the very least, we'll want to style the popup a bit (@yexingsha).

We should probably steal a few things from Apple, including showing numbers and centering character and word spacing at 0%.

yexingsha commented 5 months ago

I think the range and step of these settings are a bit too large. Let's try these values:

I was thinking of ditching the x button, and then remembered we kept the x in the search popup because of split view, and then found that in split view, clicking the x of the popup in the inactive view can close/open the popup in the active view. But that's probably not a worthwhile problem to solve, since I can't think of any use case where people would want to have different text appearances in split view. So maybe we just keep to one single popup for split view, and let it control both? Then we can remove the x button, and enable it to be closed by clicking outside its bounds, which is in line with apple's recommendation.

Also, I think putting this button next to the reset zoom button would make more sense, since in EPUB reader the zoom buttons basically control text appearance.

Regarding styling, we can either use the native slider appearance of macOS and windows, in light and dark mode:

popup-epub-mac popup-epub-win popup-epub-mac-dark popup-epub-win-dark

Or we can come up with our own slider styling for all platforms. I guess using the interface native look would be more in line with our overall approach, but one single style would be easier to implement and maintain? (This question also concerns a few other 'unstyled' controls littered throughout the interface: the slider in the ink annotation color picker menu, as well the checkboxes in reader search box and note editor search box)

AbeJellinek commented 5 months ago

Is <input type="range"/>…styleable?

Yes, but not as easily as some other inputs. I could work on adding a global style for range inputs that would apply to the ink annotation color picker menu as well. Personally I think the macOS style looks nice and neutral and would look fine on all platforms, but we could do a separate style for Windows/Linux as well if that would be better.

Let's try these values:

On it.

So maybe we just keep to one single popup for split view, and let it control both?

Sure, we can do that.

I think putting this button next to the reset zoom button would make more sense

Sure, sounds good.

AbeJellinek commented 5 months ago

OK, implemented the new slider and dialog styles (and updated the Find popup's background, box-shadow, and border-radius to match Figma as well). Moved it out of the individual views and made a click on the background close it.

yexingsha commented 5 months ago

Looks good! Just need to set font size to 13px (this is an issue for reader UI in general), move the popup under the button, and update the labels:

Screenshot 2024-06-20 at 22 57 36
AbeJellinek commented 5 months ago

Labels will work in the client if you check out https://github.com/zotero/zotero/pull/4256!

yexingsha commented 5 months ago

Oh right, I forgot to switch back. Thanks!

AbeJellinek commented 5 months ago

OK, see how that looks!

AbeJellinek commented 5 months ago
image
yexingsha commented 5 months ago

Looks good to me!

AbeJellinek commented 5 months ago

@dstillman, good to merge?

AbeJellinek commented 5 months ago

I'll rebase into separate commits for the different changes.