-
Notifications
You must be signed in to change notification settings - Fork 202
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
EMSUSD-1519 refactor collection UI #4053
Conversation
Separate data from UI: - Add data and usdData modules. - Add collectionData and stringData to the data module as abstract interface to read and modify collection data. - Add usdCollectionData and usdCollectionStringListData to usdData, for USD implementation. - This also avoids business logic referring to UI labels and such. - This also automatically updates the data source for teh Ui since the model is the data source. - Allow setting the collection on the usdCollectionData. - Fix the default value for the include-all flag. - Still need to derive a Maya implementation to host picking and undo/redo. - Make all UI use the collectionData and stringListData classes to hold and modify data instead of having business logic in UI. Refactor UI code: - Rename list.py to stringListPanel.py to avoid clashing with Python's list type. - Removed all update and updateUI functions and flags and listen to dataChanged signals instead. - Moved drag-and-drop event filter to string list view. - Don't stop adding dropped item just because one is invalid. - Move dropped item conversion and validation to the data class. Small UI fixes: - Fix selection mode of list views. - Fixed issues with the check box callback getting the wrong state. - Add include-all checkbox tooltip. - Made the color and font size for the filtered list view come from the Theme. - Removed place holder label and use paint event instead to both paint "no object found" and "drop stuff here".
...s/ae/usd-shared-components/src/python/usdSharedComponents/collection/includeExcludeWidget.py
Outdated
Show resolved
Hide resolved
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.
Adding some comments.
...urces/ae/usd-shared-components/src/python/usdSharedComponents/collection/expressionWidget.py
Show resolved
Hide resolved
...s/ae/usd-shared-components/src/python/usdSharedComponents/collection/includeExcludeWidget.py
Outdated
Show resolved
Hide resolved
...ces/ae/usd-shared-components/src/python/usdSharedComponents/common/filteredStringListView.py
Outdated
Show resolved
Hide resolved
...ces/ae/usd-shared-components/src/python/usdSharedComponents/common/filteredStringListView.py
Outdated
Show resolved
Hide resolved
.../resources/ae/usd-shared-components/src/python/usdSharedComponents/common/stringListPanel.py
Show resolved
Hide resolved
lib/mayaUsd/resources/ae/usd-shared-components/src/python/usdSharedComponents/data/__init__.py
Outdated
Show resolved
Hide resolved
...Usd/resources/ae/usd-shared-components/src/python/usdSharedComponents/data/collectionData.py
Outdated
Show resolved
Hide resolved
- Add check for colelction and prim in data class to help integration in USdView. - Remove picking from data, leaving it in the Host class. - Change constants to be all-uppercase. - Don't increase the place-holder text size. - Add comments in __init__.py files. - Make USD stage accessible in teh data classes, to allow picking by Host.
- Make more labels into constants. (Needed to find the QAction.)
def _paintPlaceHolder(self, placeHolderText): | ||
painter = QPainter(self.viewport()) | ||
theme = Theme.instance() | ||
painter.setPen(theme.palette.colorPlaceHolderText) | ||
painter.drawText(self.rect(), Qt.AlignCenter, placeHolderText) |
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.
could be moved inside the paintEvent() override - to avoid being accidentally called outside the paintEvent - what must not be done in Qt.
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.
True even if unlikely. I will move it in a subsequent PR that is based on this one. (Not another refactor one :) )
Separate data from UI:
Refactor UI code:
Small UI fixes: