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
fix theme id not being used correctly #5412
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok. Also tested locally (need to update gruvbox plugin) and it works well.
Codecov Report
@@ Coverage Diff @@
## main #5412 +/- ##
==========================================
+ Coverage 89.01% 89.05% +0.03%
==========================================
Files 595 595
Lines 50564 50584 +20
==========================================
+ Hits 45012 45048 +36
+ Misses 5552 5536 -16
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
As this is relatively small and hits a not-yet used plugin interface, I'll start the 24h merge countdown :) |
Nice to see this work! Thinking out loud, not this PR, just for the record: I wonder if we can use that Edit: BTW this makes me thing that Also, should make a PR to have settings use |
Yes. We need to add an option to setting to add a selection of custom dark, and custom light themes. |
I think we should also do that, but this change at least fixes the current behaviour. In fact, I think we should just remove the double id/name and just use
That makes sense, but we should consider the possibility of a contribution of a single type of theme.
Yup; I tried to include it here but it was getting complicated so I just left it for later. |
@andy-sweet we got what looks like a random failure here, you might be interested: https://github.com/napari/napari/actions/runs/3714126707/jobs/6297620663#step:8:306 |
Will merge now that spurious tests passed :) |
Thanks, I suspect the first task there hasn't actually been started. Will fix that and any others shortly. |
The `test_slice_layers_async_multiple_calls_cancels_pending` test [failed](https://github.com/napari/napari/actions/runs/3714126707/jobs/6297620663#step:8:306) in [an unrelated PR](#5412). That test uses a lock to block a layer from finishing slicing, then submits two slicing tasks to the same layer to check that the middle one is actually cancelled. But it does not actually check to see if that task is running, which is a required precondition for the cancellation behavior under test. That's the only explanation of the failure above I could come up with. Therefore, I fixed that test by using the local `_wait_until_running` function to wait for the task to start running before submitting the second one. I also added the default timeout to all waits in these tests to ensure we don't have an accidental/unexpected deadlock somewhere. I've seen some recent test runs hang indefinitely and want to rule out these tests as explanations.
The `test_slice_layers_async_multiple_calls_cancels_pending` test [failed](https://github.com/napari/napari/actions/runs/3714126707/jobs/6297620663#step:8:306) in [an unrelated PR](napari#5412). That test uses a lock to block a layer from finishing slicing, then submits two slicing tasks to the same layer to check that the middle one is actually cancelled. But it does not actually check to see if that task is running, which is a required precondition for the cancellation behavior under test. That's the only explanation of the failure above I could come up with. Therefore, I fixed that test by using the local `_wait_until_running` function to wait for the task to start running before submitting the second one. I also added the default timeout to all waits in these tests to ensure we don't have an accidental/unexpected deadlock somewhere. I've seen some recent test runs hang indefinitely and want to rule out these tests as explanations.
As discussed in this zulip conversation, napari is currently not respecting icons when it comes to theme contributions.
Turns out, the
theme_dict
was constructed by updating the base theme of the same type (dark
orlight
) with the new values, but only the colors were being updated, leaving any non-color contribution the same (such as the themename
[which I renamedid
for consistency with the schema; this made it harder to debug]). Sincename
was left todark
, and this was the field used to pick the correct generated icons, we ended up with a half theme.The only "real" changes here (among the many variable renames) are inside
utils/theme.py
:label
is now read from the contribution instead of ignored (though it's not used anywhere in napari yet)Description
Type of change
References
How has this been tested?
as there are small differences between the two Qt bindings.
Final checklist:
trans.
to make them localizable.For more information see our translations guide.