-
Notifications
You must be signed in to change notification settings - Fork 34
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
Publisher: show visual difference default vs overridden attributes #146
base: develop
Are you sure you want to change the base?
Publisher: show visual difference default vs overridden attributes #146
Conversation
There is boolean fields, which just show a slider. If we apply bold to the widget (instead of label). Bolding the label seems like the most consistent easy way to go. |
we are using different color coding for overrides throughout the system. https://ayon.ynput.io/docs/admin_settings/#categories |
In this case I am assuming it would be blue color. Since that is signalizing unsaved changes - which is closest you can get. Other is Studio override - green, Project override - orange. |
…default_attributes_in_publisher
@m-u-r-p-h-y had any color in mind? |
Gave this a quick test run. First off, really great seeing work being done on this. Here are my findings:
The bugs:
With the bugs fixed I think this is already going to be really really nice! - Especially if combined with the "revert to default" context option PR. |
Think that might get tricky when dealing with non-inputs like checkboxes and booleans. There is usually always a label to an attribute which is all the text based. |
Checked Houdini quickly - but they are sneaky! Checkboxes have their labels on the right hand side. |
…utes_in_publisher' of https://github.com/ynput/ayon-core into enhancement/AY-2614_display_overriden_vs_default_attributes_in_publisher
I think I've fixed all these bugs now and pushed the latest code. |
…default_attributes_in_publisher
if is_default: | ||
label_widget.setStyleSheet("") | ||
else: | ||
label_widget.setStyleSheet("color: #4287f5") |
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.
Looking at the code duplication of this stylesheet value I wonder if we should instead implement this:
def set_styled_property(widget, property, value):
"""Set widget property and refresh dynamic style"""
if widget.property(property) == value:
return
widget.setProperty(property, value)
# force stylesheet refresh
style = widget.style()
style.unpolish(widget)
style.polish(widget)
According to what I read online that should work with e.g. styling as:
from PySide2 import QtWidgets, QtCore
app = QtWidgets.QApplication.instance()
app.setStyleSheet("*[nondefault=true] { font: bold }")
button = QtWidgets.QPushButton("hello")
button.show()
timer = QtCore.QTimer()
timer.setInterval(1000)
def set_styled_property(widget, property, value):
"""Set widget property and refresh dynamic style"""
if widget.property(property) == value:
return
widget.setProperty(property, value)
# force stylesheet refresh
style = widget.style()
style.unpolish(widget)
style.polish(widget)
def toggle_property():
new_state = not bool(button.property("nondefault"))
print(f"Setting state: {new_state}")
set_styled_property(button, "nondefault", new_state)
timer.timeout.connect(toggle_property)
timer.start()
This shows that it does work, even if the stylesheet itself exists globally and not on the object itself. (Note that you usually don't want to apply it on the application, but this is just example code).
By doing it this way we can adjust the more global AYON stylesheet to have e.g.
#PublishWindow *[nondefault=true] { font: bold }
…default_attributes_in_publisher
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.
It works nicely, highlighting any non default values via orange color typing...
But for some reason it wont revert back to white typing on Review
and Resolution
attributes. For the rest occasions seems working normally so whenever user puts the value back to its defaults aka DB entry, it reverts to normal white typo.
I'm afraid this is something that either must be resolved by the create plugin in different PR, or something we have to live with. EDITED: |
@m-u-r-p-h-y @antirotor any opinions on that ( review shown as overriden if not set to |
This actually uncovered possible issues in PR #153 . Both PRs should probably wait until we have attribute definitions per instance. |
I'd still love this feature (and #153!) and think "living with it" for now until we have a better idea on how to avoid the odd behavior in edge cases may be worth it. It may also highlight that we may need better defaults somewhere, etc. and maybe forces us down the rabbit hole. @dee-ynput @antirotor (or maybe @mkolar) any inputs regarding this from a product or pipeline perspective?
Or do we indeed feel that maybe pushing this on the priority list may be worth it more beforehand? |
@iLLiCiTiT worrying sounds legit, and it definitely deserves a dive into it. |
Changelog Description
With publisher attributes, there is no way to know if artist changed value on them from default.
This could be easily shown just by changing font-face or color.
Please see this ticket for more details: https://app.clickup.com/t/6658547/AY-2614
Additional info
Paragraphs of text giving context of additional technical information or code examples.
Testing notes: