Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Make icon size the same asQtViewerPushButton for UI consistency.#103

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

samcunliffe
Copy link
Collaborator

@samcunliffesamcunliffe commentedMay 10, 2023
edited
Loading

Solves#46 (with rather a lot of code).

Summary

Introduce a dependency ontinycss2. Thenuse it via some ...err... "convenience" parsing functions. Hopefully, these are clear and somewhat reusable for our eventual solution of#86.

Testing

Added a unit test for my function. Open to adding test cases if anyone can think of anything.

Reviewer notes:

The other ways to solve#46 is via a regex (~5 LoC) or viathing.setIconSize(QSize(28, 28)) (2 LoC). Compare those with this @ ~30 LoC. 🙃

Argument for doing it this way

Boils down to#86. We should be able to parse other colours from the "current" CSS file with these functions. Then do an internal update of the axes colours etc (currently most of the code inNapariMPLWidget.apply_napari_colorscheme). And Ithink our update code could be connected toviewer.events.theme (undocumented... we can probably test quite easily and fix the docs upstream either way).

Against

I'm actually increasingly open to a regex solution.It's what napari themselves seem to do. Opinions gratefully received.

Could also reuse the tdd and do the regex infrom_css_get_the_size_of.


Also if anyone knows of a better way to customise my subclass's constructor whilst keeping the type checker happy. Like maybe there's a better design decision to be made somewhere? Discussion of interest...

Introduce a dependency on tinycss2. Then _use_ it via some convenienceparsing finding functions.
@samcunliffesamcunliffe linked an issueMay 10, 2023 that may beclosed by this pull request
@samcunliffesamcunliffe added the New featureNew feature or request labelMay 10, 2023
@samcunliffe
Copy link
CollaboratorAuthor

image

Copy link
Member

@dstansbydstansby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I like this approach more than regex, left some comments. Major request for change is to add a test for the fallback values, but implementation looks 👍

samcunliffeand others added2 commitsMay 11, 2023 15:04
It's not a generic CSS parser but rather Napari-specific.Co-authored-by: David Stansby <dstansby@gmail.com>
@dstansbydstansby added this pull request to the merge queueMay 11, 2023
Merged via the queue intomatplotlib:main with commitd79873fMay 11, 2023
@samcunliffesamcunliffe deleted the 46-add-tinycss2-and-get-icon-size-from-css branchMay 11, 2023 14:47
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dstansbydstansbydstansby approved these changes

@ruaridhgruaridhgAwaiting requested review from ruaridhg

Assignees
No one assigned
Labels
New featureNew feature or request
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Make figure toolbar icons a bit smaller
2 participants
@samcunliffe@dstansby

[8]ページ先頭

©2009-2025 Movatter.jp