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 general popup menu for model browser #1995
Conversation
When no element is selected, you can add toplevel diagrams and packages.
Reuse it, otherwise we're creating a lot of inactive popups along the way.
Clean it when we need to create a new one. This way the signal handling still works (we're not detaching the popup, and break action propagation), and we're not creating a lot of inactive popups.
For GTK4 we have the TreeComponent. Only need to support GTK3 for Namespace component atm.
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 1.01%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Help us improve this quality report! |
45f4a2e
to
aca69c2
Compare
This is more in line with the documentation.
Breaks cycle where model browser components needed to import functions from the main window module.
d71d93c
to
ac65143
Compare
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.
I like being able to right-click and add a new Package. The refactoring you did also is really nice, I like how the GTK4 and GTK3 code is split apart more for this component.
I noticed when I right-click and go to New Diagram, only the Class Diagram is displayed. Was this on purpose? Do we need diagrams that don't exist within any namespace / package?
Somehow the menu is not resizing to contain all diagram types. |
Somehow the menu does not resize when the submenu is shown.
For GTK4 we have a different component.
Thanks @amolenaar, nice improvement! |
PR Type
What kind of change does this PR introduce?
What is the current behavior?
When you cleaned the whole model, there's no way to easily create new top-level packages without putting them in a diagram as well.
Issue Number: #1954
What is the new behavior?
When no element is selected, you can add top level diagrams and packages.
This allows to add top-level packages and diagrams from anywhere within the model browser (tree view).
You can now deselect the selected element in the model browser with Ctrl+mouse click.
Does this PR introduce a breaking change?
Other information
I considered adding it to the "create diagram" button in the header bar as well.
model_browser
, as it's called in the docs.