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

Natural light configuration #3744

Merged
merged 6 commits into from Mar 13, 2018

Conversation

Projects
None yet
2 participants
@dengste

dengste commented Mar 12, 2018

New widget to configure natural light on Kobo Aura One and H2O2.

David Engster added some commits Mar 11, 2018

David Engster
device/kobo/sysfs_light: Explicitly handle warmth/brightness = 0
For warmth and/or brightness = 0, we need to make sure that the
red/green/white LEDs are actually turned off, regardless of the values
for gain/offset.
@dengste

This comment has been minimized.

Show comment
Hide comment
@dengste

dengste Mar 12, 2018

Further improvements for issue #2285. While fiddling with these values is not for the faint of heart, I'm hoping that people will post some values they find useful and maybe we can digest some nice presets from those.

Screenshot:

nl_widget

dengste commented Mar 12, 2018

Further improvements for issue #2285. While fiddling with these values is not for the faint of heart, I'm hoping that people will post some values they find useful and maybe we can digest some nice presets from those.

Screenshot:

nl_widget

@dengste

This comment has been minimized.

Show comment
Hide comment
@dengste

dengste Mar 12, 2018

Not sure what to do about that failing check. IMHO the Size.span.vertical_large was still a bit too small, but I can remove the multiplication with 2, of course.

dengste commented Mar 12, 2018

Not sure what to do about that failing check. IMHO the Size.span.vertical_large was still a bit too small, but I can remove the multiplication with 2, of course.

@Frenzie

This comment has been minimized.

Show comment
Hide comment
@Frenzie

Frenzie Mar 12, 2018

Member

I didn't make the check intelligent enough to deal with this scenario. It's just a stupid width/height/a few other things = [0-9]. It'd probably stop complaining if you stuck the *2 on the other side but I haven't checked.

Member

Frenzie commented Mar 12, 2018

I didn't make the check intelligent enough to deal with this scenario. It's just a stupid width/height/a few other things = [0-9]. It'd probably stop complaining if you stuck the *2 on the other side but I haven't checked.

@Frenzie

This comment has been minimized.

Show comment
Hide comment
@Frenzie

Frenzie Mar 12, 2018

Member

But there's no objection to adding a larger size either. That whole Size thing is basically my attempt to standardize the semi-randomness we had going on previously. The naming convention I used in font would result in something like Size.span.vertical_x_large.

Looks very nice btw!

Member

Frenzie commented Mar 12, 2018

But there's no objection to adding a larger size either. That whole Size thing is basically my attempt to standardize the semi-randomness we had going on previously. The naming convention I used in font would result in something like Size.span.vertical_x_large.

Looks very nice btw!

@dengste

This comment has been minimized.

Show comment
Hide comment
@dengste

dengste Mar 13, 2018

Thanks for the review. I've added two fixups, please squash them if they're OK.

dengste commented Mar 13, 2018

Thanks for the review. I've added two fixups, please squash them if they're OK.

David Engster added some commits Mar 8, 2018

ui/widget/naturallightwidget: New widget to configure gain/offset
This widget is used to configure the natural light on KA1/H2O2. It
allows the user to set the gain/offset values for white/red/green, as
well as the exponent used in the formula.

Numbers can be changed via screen keyboard or through the plus/minus
buttons next to the numbers (holding the buttons will in/decrase with
smaller steps). Changes are applied immediately, but will only be set
permanently if 'OK' is pressed. If 'Cancel' is pressed, the new values
are discarded and the old ones restored. Also, pressing 'OK' will save
these values in the koreader settings file (there's no support for
changing these values in Nickel, so there's nothing to sync to its
config file). The 'Restore Default' button will install the original
defaults that were derived from Nickel's behavior.

This widget is meant to be called from the frontlight widget and is
placed at the top, so that the frontlight widget can still be used to
test the current values (see next commit).
ui/widget/frontlightwidget: Add 'Configure' button
For devices with natural light (KA1, H2O2), add new button 'Configure'
at the bottom which will open the naturallightwidget, which will be
placed at the top. The frontlightwidget will be moved to the bottom,
and both have permanent focus. This way, you can change the parameters
and immediately test them by changing the frontlight level and
warmth. On the KA1, both widgets will easily fit, but on smaller
devices it may be that they overlap.

Since the frontlightwidget will keep focus, we disable the 'Configure'
button when the naturallightwidget opens. We also remove its 'Close'
button and disable 'onTapCloseFL', so that the frontlightwidget cannot
be closed while the naturallightwidget is displayed.
device/kobo/powerd: Read natural light configuration
Define 'frontlight_settings' table for all Kobo devices, and read
configuration from settings file.
@Frenzie

This comment has been minimized.

Show comment
Hide comment
@Frenzie

Frenzie Mar 13, 2018

Member

Thanks! How come you don't want to squash 'em into the relevant commits yourself? :-)

Member

Frenzie commented Mar 13, 2018

Thanks! How come you don't want to squash 'em into the relevant commits yourself? :-)

@Frenzie Frenzie merged commit bfd55c7 into koreader:master Mar 13, 2018

1 check passed

ci/circleci Your tests passed on CircleCI!
Details
@dengste

This comment has been minimized.

Show comment
Hide comment
@dengste

dengste Mar 13, 2018

If I squash them and force-push, I thought it would be harder for you to see what I've actually changed? But of course I can do that in the future if you prefer that.

dengste commented Mar 13, 2018

If I squash them and force-push, I thought it would be harder for you to see what I've actually changed? But of course I can do that in the future if you prefer that.

@Frenzie

This comment has been minimized.

Show comment
Hide comment
@Frenzie

Frenzie Mar 13, 2018

Member

No, you're quite right about that. I meant after it's all done. I do prefer a "perfect" PR that I can just rebase or merge[1] but mostly I'm just curious about the rationale.

[1] That's half a minute I could've spent singing your praises in the release notes for the next GH release instead. /grins

Member

Frenzie commented Mar 13, 2018

No, you're quite right about that. I meant after it's all done. I do prefer a "perfect" PR that I can just rebase or merge[1] but mostly I'm just curious about the rationale.

[1] That's half a minute I could've spent singing your praises in the release notes for the next GH release instead. /grins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment