Add scale bar widget#148
Conversation
…dataWidget. Created the class ViewerMetadataWidget.
…dataWidget. Created the class ViewerMetadataWidget.
…ri. Added the _dims_and_units.py file to widgets and made basic classes to build and test the widget.
…ckage for structure
…stom model so it reads directly from the layer/viewer.
…ing labels columns for the viewer.
… and derive the table.
…. should be ashamed...
…ge back to bottom after containers and widget layout is decided.
…igger edits in the QTableView.
…r and layer axis labels.
…ecking if the setting column editable is not true.
…ctly. Also added spacing and size logic to the containers similar to the ones in _main.py
…Missing connections on color.
…ixed length widget of the scale bar.
…vent for the scale bar disconnections.
|
@TimMonko This is what I've been working on for the I still need to add tooltips, docstrings and tests but Its getting pretty big so maybe we can check now and add those in a following PR? |
one to the units combobox.
…th changing when setting to None
|
I added the auto checkboxes for the scale bar color, box and fixed length fields. I did find a bug that I haven't fixed:
I haven't fixed the tests 🦖 will update after holidays in japan. |
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (63.40%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #148 +/- ##
===========================================
- Coverage 97.06% 84.81% -12.25%
===========================================
Files 11 16 +5
Lines 1429 2246 +817
===========================================
+ Hits 1387 1905 +518
- Misses 42 341 +299 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
References and relevant issues
Build on and replaces #145. Related issues #138 and #136.
Description
This exposes some of the viewer properties by adding a new widget called
Viewer metadata. It builds on the work started at #145 addressing some feedback from the community meetings and adds containers, vertical/horizontal layouts for the dock widget and exposes the attributes of theScaleBarOverlaythat is instantiated in the viewer asviewer.scale_bar.Highlights:
ViewerMetadatawidget. This widget follows the same pattern as theLayerMetadatawidget, with collapsible containers, horizontal/vertical layouts, etc.viewer.dims.axis_labelsthrough aQTableViewand a customQAbstractTableModel. This table is editable and can function as an access to modify directly theaxis_labelsof the viewer's dims AND theLayer.axis_labels. It can also pass labels from the active layer to the viewer dims directly using a button.viewer.scale_barto control most aspects of theScaleBarOverlay. It has many entries to control the attributes of theScaleBarOverlaymodel such as the visibility, units, edge ticks, color, etc.