-
-
Notifications
You must be signed in to change notification settings - Fork 434
refactor: field widgets #1186
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
Open
TrigamDev
wants to merge
14
commits into
TagStudioDev:main
Choose a base branch
from
TrigamDev:refactor/field-widgets
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
refactor: field widgets #1186
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ttributes refactor
…tor/field-widgets # Conflicts: # src/tagstudio/qt/views/preview_panel/fields/text_field_widget.py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Status: Review Needed
A review of this is needed
Type: Refactor
Code that needs to be restructured or cleaned up
Type: UI/UX
User interface and/or user experience
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Various refactors of the different entry field widgets (
field_widget.py,text_field.py,color_box.py, andtag_box_view.py/tag_box_controller.py).fieldsdirectory under their respective directories (soviews/fieldsandcontrollers/fields) to make locating them easier.mixedinto eitherviews/fieldsorcontrollers/fields.mixed/field_widget.pyfield_widget.pyhas had it's classesFieldWidgetandFieldContainersplit into their own files,views/preview_panel/fields/field_widget.pyandviews/preview_panel/fields/field_container.py.root_layouthas been renamed to__root_layoutfor consistency.FieldContainer.set_inner_widget()and variables referencinginner_widgethave been renamed toset_field_widget()andfield_widgetrespectively.FieldContainer'sfield_widgetis more intuitive than aninner_widget, which can easily be confused for something internal and not the intended method.root_layouthas been renamed tobase_layoutfor consistency.inner_layouthas been renamed tocontainer_layout.enterEvent, the copy, edit, and remove buttons now have their visibility set to whether their respective callbackis None, as opposed to conditionally setting it to false.leaveEvent, the checks for callbacks have been removed, now setting all the buttons to hidden regardless of if they have a callback or not.Things to look into:
"fieldContainer", but contains a child widget also named"fieldContainer".mixed/text_field.pyviews/preview_panel/fields/text_field_widget.py.TextWidgethas been renamed toTextFieldWidget.base_layouthas been renamed to__root_layoutfor consistency.mixed/color_box.pyviews/preview_panel/fields/color_box_widget_view.pyandcontrollers/preview_panel/fields/color_box_widget_controller.py.base_layouthas been renamed to__root_layoutfor consistency.updatesignal has been renamed toon_updateto be more consistent with the tag box widget.edit_color()anddelete_color()have been renamed to_on_edit_color()and_on_delete_color().views/tag_box_view.pyviews/tag_box_widget_view.py.controllers/tag_box_controller.pycontrollers/tag_box_widget_controller.py.Tasks Completed