Skip to content
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

Css always have a stylesheet #361

Merged
merged 3 commits into from Jul 14, 2020
Merged

Conversation

amolenaar
Copy link
Member

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Documentation content changes

What is the current behavior?

One needs to enable a toggle to enable the style sheet. This is very confusing. For me even, and I wrote the feature!

Issue Number: #284

What is the new behavior?

Diagram is in charge of ensuring there's always a style sheet to use.

Also the last remaining preference option (reset tool) has been moved to the settings pane. Now all settings are in one place.

The settings pane contains a link to documentation on Style sheets, so people can learn about them. Just a text field is not much use.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

I have a solid background in CSS. It would be nice if the new workflow and CSS documentation is reviewed by someone less familiar with CSS.

Diagram "owns" the stylesheet, so it will create one whenever it's
missing.
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jul 13, 2020

Sourcery Code Quality Report (beta)

❌ Merging this PR will decrease code quality in the affected files by 0.02 out of 10.

Before After Change
Quality 8.76 8.74 -0.02
Complexity 1.34 1.35 0.02
Method Length 49.17 50.15 0.98
Lines 2938 2840 -98
Changed files Quality Before Quality After Quality Change
gaphor/UML/classes/tests/test_classconnect.py 7.97 7.97 0.0
gaphor/core/modeling/diagram.py 9.3 9.29 -0.01 ⬇️
gaphor/core/modeling/tests/test_diagram.py 9.52 9.52 0.0
gaphor/diagram/shapes.py 8.77 8.77 -0.0
gaphor/diagram/tests/test_copypaste.py 8.39 8.39 0.0
gaphor/plugins/diagramexport/init.py 8.85 8.85 -0.01 ⬇️
gaphor/storage/storage.py 7.71 7.71 0.0
gaphor/storage/tests/test_storage.py 8.26 8.26 0.0
gaphor/ui/elementeditor.py 9.04 9.11 0.07 ⬆️
gaphor/ui/mainwindow.py 8.84 8.84 0.0
gaphor/ui/tests/test_diagrampage.py 9.29 9.22 -0.07 ⬇️
tests/test_undo.py 9.06 9.06 0.0

Here are some functions in these files that still need a tune-up:

File Function Quality Recommendation
gaphor/storage/storage.py save_generator 2.3 Split out functionality
gaphor/storage/storage.py _load_elements_and_canvasitems 4.6 Split out functionality
gaphor/storage/tests/test_storage.py StorageTestCase.test_save_and_load_model_with_relationships 5.24 Split out functionality
gaphor/storage/storage.py load_generator 5.53 Split out functionality
gaphor/ui/mainwindow.py MainWindow.open 5.61 Split out functionality

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!

Let us know what you think of it via email or our Gitter!

@amolenaar
Copy link
Member Author

image

@amolenaar amolenaar requested a review from danyeaw July 13, 2020 20:52
@amolenaar amolenaar merged commit aded61d into master Jul 14, 2020
@amolenaar amolenaar deleted the css-always-have-a-stylesheet branch July 14, 2020 13:39
@actionless
Copy link
Contributor

looks great, thanks a lot!
i'll try to give it a test during this week (a bit busy last days)

@amolenaar
Copy link
Member Author

@actionless Thanks a lot. Please let me know what you think.

@danyeaw danyeaw added the feature A new feature label Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants