-
Notifications
You must be signed in to change notification settings - Fork 33
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
Move line plot display layers inspector section to declarative UI #1201
base: master
Are you sure you want to change the base?
Conversation
def remove_widget_from_content(self, widget: UserInterface.Widget) -> None: | ||
# need to remove widget and spacing from before the widget | ||
index = self.__section_content_column.children.index(widget) | ||
spacing = self.__section_content_column.children[index - 1] |
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.
Is this guaranteed to have a spacing before the widget?
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.
Yes based on the function add_widget_to_content
- line 286. If I didn't do that, the space there grows every time you interact with any of the controls.
When adding composite line plots, the second line plot fill colour appears as Blank. |
line_plot_display_layer_model.data_index_model.Value = 0 | ||
line_plot_display_layer_model.data_index_model.Value = "" | ||
line_plot_display_layer_model.data_index_model.Value = "A" | ||
line_plot_display_layer_model.data_index_model.Value = 0 |
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.
Any reason you are testing =0 twice?
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.
Yes, the particular test is test_setting_display_layer_to_no_display_data_channel_and_back
, the last set to 0 is the back
of that.
When pressing the "+" button to add a layer > Current behaviour is opposite to Master > A new layer is inserted in the list (as opposed to appended in master) |
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.
There are a few issues with this PR - but the main thing is that the list structure is being done manually rather than using a list model with a declarative column.
I'm attaching a new version of Inspector.py
which switches to a cleaner structure where the column is managed by the list model; and the list model is observed from the display item. This avoids having to explicitly manage the items in the list (i.e. remove_widget_from_container
and its ilk are no longer needed). This was easier to show rather than explain.
In addition, I've made a number of other minor changes to fix some, but not all, issues that came up in testing. There were things like changing the 'data index' threw a conversion error that prevented it from working. I did NOT fix the problem of the complex display type chooser not appearing in the inspector.
I'm also attaching the test procedure I was testing against.
The new version of Inspector.py
requires this PR: nion-software/nionutils#30
Switching the line plot display layers section of the inspector to use the declarative UI