-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add a "display_name" option to modify a widget's label (#45) #48
Conversation
Codecov Report
@@ Coverage Diff @@
## master #48 +/- ##
==========================================
- Coverage 96.08% 96.01% -0.08%
==========================================
Files 16 16
Lines 971 979 +8
==========================================
+ Hits 933 940 +7
- Misses 38 39 +1
Continue to review full report at Codecov.
|
thank you for implementing this @HagaiHargil! and thanks for such a thorough treatment (docs, examples, etc...)! |
I feel like:
|
i don't feel like there should be any implicit/assumed relationship between magicgui and napari... so that particular concern doesn't resonate with me that much. The word next to the widget is a literal
that I can understand. I kinda liked just saying |
I'm 100% behind @tlambert03 on this one. I thought "label" was the better option but went with "display_name" due to it being mentioned in the original issue. I'll happily replace all use cases of one with the other. My use cases for magicgui are completely independent from napari, so I don't think that there would be any confusion with napari's Label keyword, especially since we're talking about a key within a dictionary within a decorator - all of them are exclusively magicgui's. Moreover, in many common data science APIs there are keywords which behave like @tlambert03 proposed - |
I'm happy to be outvoted. Thanks for making this @HagaiHargil |
@jni, care to weigh in on this and put us back in gridlock? 😂 |
My reading is that "label" is itself kinda Qt-specific. I would find it confusing. How about just "name"? |
I agree with @GenevieveBuckley about separating the APIs, too. So, |
I don't think it is... tkinter also uses it, and Wikipedia uses it: https://en.m.wikipedia.org/wiki/Label_(control) https://anzeljg.github.io/rin2/book2/2405/docs/tkinter/label.html |
Ok fine 😂 I knew as I was writing it that I would regret it. I'll rephrase: I would be confused by the word "label", and I think other people who are not super familiar with GUI frameworks, ie exactly the target audience for magicgui, might also be confused! I don't feel suuuuper strongly about this, but "name" would easily be my preference. |
I think "name" is also kinda vague... and I don't think "label" is super jargony. When you want to put a sticker on something to say "what is this thing"... you call it a label. I think the magicgui target audience will figure it out fine. I'd like to stick with label |
Thanks @HagaiHargil, we can leave the discussion of hide/show individual labels for later, when we actually support that sort of thing (which probably should wait for #43 anyway). |
Happy to introduce "label" and thanks for the kind words :) |
Addresses #45.
This PR adds the option to modify a widget's label by including a
display_name
key in that argument's specific dictionary.It also adds a paragraph in the docs, does a small change to the examples section that shows this behavior and adds a test.