Skip to content

Commit

Permalink
re-arranged show/hide options dealing with helices into their own sub…
Browse files Browse the repository at this point in the history
…menu of the View menu
  • Loading branch information
dave-doty committed Feb 4, 2022
1 parent 6aa0db1 commit 1e2d52a
Showing 1 changed file with 42 additions and 32 deletions.
74 changes: 42 additions & 32 deletions lib/src/view/menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ It uses cadnano code that crashes on many designs, so it is not guaranteed to wo
view_menu_show_dna(),
view_menu_show_labels(),
view_menu_mods(),
view_menu_helices(),
view_menu_display_major_ticks_options(),
DropdownDivider({'key': 'divider-major-tick-widths'}),
...view_menu_zoom_speed(),
Expand Down Expand Up @@ -618,6 +619,47 @@ the surface of a DNA origami."""
]);
}

ReactElement view_menu_helices() {
return (MenuDropdownRight()
..title = 'Helices'
..id = 'view_menu_helices-dropdown'
..key = 'view_menu_helices-dropdown'
..className = 'submenu_item')([
(MenuBoolean()
..value = props.only_display_selected_helices
..display = 'Display only selected helices'
..tooltip = 'Only helices selected in the side view are displayed in the main view.'
..name = 'display-only-selected-helices'
..onChange = ((_) =>
props.dispatch(actions.SetOnlyDisplaySelectedHelices(!props.only_display_selected_helices)))
..key = 'display-only-selected-helices')(),
(MenuBoolean()
..value = props.show_helix_components_main_view
..display = 'Show main view helices'
..tooltip = '''\
Shows helix representation in main view. Hiding them hides all view elements
associated with a helix: grid lines depicting offsets, circles with helix index,
major tick offsets.'''
..name = 'show-helix-components-main-view'
..onChange = ((_) => props.dispatch(actions.ShowHelixComponentsMainViewSet(
show_helix_components: !props.show_helix_components_main_view)))
..key = 'show-helix-components-main-view')(),
(MenuBoolean()
..value = props.show_helix_circles_main_view
..display = 'Show main view helix circles/idx'
..tooltip = '''\
Shows helix circles and idx's in main view. You may want to hide them for
designs that have overlapping non-parallel helices.
To hide all view elements associated with helices (e.g., major ticks),
toggle "Show main view helices".'''
..name = 'show-helix-circles-main-view'
..onChange = ((_) => props.dispatch(actions.ShowHelixCirclesMainViewSet(
show_helix_circles_main_view: !props.show_helix_circles_main_view)))
..key = 'show-helix-circles-main-view')(),
]);
}

ReactElement view_menu_display_major_ticks_options() {
return (MenuDropdownRight()
..title = 'Major ticks'
Expand Down Expand Up @@ -704,14 +746,6 @@ of the design you were looking at before changing the script.'''
..name = 'center-on-load'
..onChange = ((_) => props.dispatch(actions.AutofitSet(autofit: !props.autofit)))
..key = 'autofit-on-loading-new-design')(),
(MenuBoolean()
..value = props.only_display_selected_helices
..display = 'Display only selected helices'
..tooltip = 'Only helices selected in the side view are displayed in the main view.'
..name = 'display-only-selected-helices'
..onChange = ((_) =>
props.dispatch(actions.SetOnlyDisplaySelectedHelices(!props.only_display_selected_helices)))
..key = 'display-only-selected-helices')(),
(MenuBoolean()
..value = props.invert_y
..display = 'Invert y-axis'
Expand All @@ -726,30 +760,6 @@ To inspect how all axes change, check View --> Show axis arrows.'''
..name = 'invert-y-axis'
..onChange = ((_) => props.dispatch(actions.InvertYSet(invert_y: !props.invert_y)))
..key = 'invert-y-axis')(),
(MenuBoolean()
..value = props.show_helix_components_main_view
..display = 'Show main view helices'
..tooltip = '''\
Shows helix representation in main view. Hiding them hides all view elements
associated with a helix: grid lines depicting offsets, circles with helix index,
major tick offsets.'''
..name = 'show-helix-components-main-view'
..onChange = ((_) => props.dispatch(actions.ShowHelixComponentsMainViewSet(
show_helix_components: !props.show_helix_components_main_view)))
..key = 'show-helix-components-main-view')(),
(MenuBoolean()
..value = props.show_helix_circles_main_view
..display = 'Show main view helix circles/idx'
..tooltip = '''\
Shows helix circles and idx's in main view. You may want to hide them for
designs that have overlapping non-parallel helices.
To hide all view elements associated with helices (e.g., major ticks),
toggle "Show main view helices".'''
..name = 'show-helix-circles-main-view'
..onChange = ((_) => props.dispatch(actions.ShowHelixCirclesMainViewSet(
show_helix_circles_main_view: !props.show_helix_circles_main_view)))
..key = 'show-helix-circles-main-view')(),
(MenuBoolean()
..value = props.show_grid_coordinates_side_view
..display = 'Show grid coordinates in side view'
Expand Down

0 comments on commit 1e2d52a

Please sign in to comment.