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

Implement fundamentals of clever dark mode #50

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

rugk
Copy link
Owner

@rugk rugk commented Jan 7, 2022

Fixes #45

TODO

  • currently still runs into a recursive loop, due to the fact that the design change the add-on triggers here is of course also catched by the listener we need for changing the option, which is a little ugly – I already tried preventing that with unregistering and reregistering the listener before respectively after changing it, but that did not fix the issue. Also an additional timeout does not work.
  • Generally, it needs to be thought about whether this works in general, because of course, as soon as the add-on overrides the Firefox setting, it cannot listen to system events for design changes anymore at all – for obvious reasons.
    When we know to read that setting, we can temporarily disable the override (which is a little ugly hack as it can cause design distortions? Or is the new design always correct?) – that is what I have implemented currently –, but of course obvious reasons an interactive listener/trigger/reaction upon such a change cannot be implemented.
    Unless (and this may need investigation), such a listener uses the setting when it has been registered. If that would work, we'd only need to register the listener for browser or system mode (maybe user-selectable) once, and can still trigger the change. Still complex though…
    An alternative would be a simple polling algorithm, but that is also ugly, especially as it would need to temporarily remove the override (see above), so that would likely definitively lead to visual gliches.

So maybe this is not possible at all, and it's not useful to pursue this idea anymore…

resources

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.

Implement "clever"/context-based/"simple" button mode
1 participant