Skip to content

Commit

Permalink
Merge pull request #907 from shawnlaffan/issue_902_export_tree_from_s…
Browse files Browse the repository at this point in the history
…patial_tab

GUI: Rework the Tab side menus

Something of an omnibus PR as it addresses several issues encountered while working on #902.  

Updates #902 - support exports of the displayed tree
Updates #905 - tree plot controls are now in their own submenu of the side menu
Updates #906 - support tree plotting by depth across all tabs that plot trees
Fixes #908 - export interface disables keyboard shortcuts

Also refactors (nearly) all of the ```$self->{xmlPage}->get_object``` calls to use a generic method.
  • Loading branch information
shawnlaffan authored Jan 6, 2024
2 parents 3283dc6 + ca83271 commit 461d853
Show file tree
Hide file tree
Showing 14 changed files with 584 additions and 445 deletions.
122 changes: 1 addition & 121 deletions bin/ui/hboxClusteringPage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
<object class="GtkMenuItem" id="menuitem_clustering_display">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Display</property>
<property name="label" translatable="yes">Map</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="menu_clustering_display">
Expand Down Expand Up @@ -408,126 +408,6 @@ Colours are currently taken from the outer ring.</property>
<property name="active">True</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="separatormenuitem1">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="plot_by1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Plot by</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="plot_by1_menu">
<property name="can_focus">False</property>
<child>
<object class="GtkRadioMenuItem" id="plot_length">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Length</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<signal name="activate" handler="on_plot_length_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkRadioMenuItem" id="plot_depth">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Depth</property>
<property name="use_underline">True</property>
<property name="group">plot_length</property>
<signal name="activate" handler="on_plot_depth_activate" swapped="no"/>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkMenuItem" id="group_by1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Should the grouping be done by length or depth?

This allows decoupling of node selection from the tree display so trees with many reversals can be more easily plotted by depth, but selections still use the branch lengths.

This setting has no effect on the slider bar. It always groups using the plot method, selecting whichever branches it crosses.</property>
<property name="label" translatable="yes">Group by</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="group_by1_menu">
<property name="can_focus">False</property>
<child>
<object class="GtkRadioMenuItem" id="group_length">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Length</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<signal name="activate" handler="on_group_length_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkRadioMenuItem" id="group_depth">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Depth</property>
<property name="use_underline">True</property>
<property name="group">group_length</property>
<signal name="activate" handler="on_group_depth_activate" swapped="no"/>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkCheckMenuItem" id="highlight_groups_on_map">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Highlight groups under this node when hovering over the node</property>
<property name="label" translatable="yes">Highlight groups on map?</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<signal name="activate" handler="on_highlight_groups_on_map" swapped="no"/>
</object>
</child>
<child>
<object class="GtkCheckMenuItem" id="use_highlight_path_changed">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Highlight paths on the tree associated with groups on the map when you hover the mouse over them</property>
<property name="label" translatable="yes">Highlight node paths for groups?</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<signal name="activate" handler="on_use_highlight_path_changed_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkCheckMenuItem" id="menu_use_slider_to_select_nodes">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">When deselected, the slider bar will not change the display colours.</property>
<property name="label" translatable="yes">Use the slider bar to select nodes for colouring?</property>
<property name="use_underline">True</property>
<property name="active">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menuitem_cluster_set_tree_line_widths">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Set the width of the tree branches.
Does not affect the vertical connectors.
</property>
<property name="label" translatable="yes">Set tree branch line widths</property>
<property name="use_underline">True</property>
</object>
</child>
</object>
</child>
</object>
Expand Down
84 changes: 11 additions & 73 deletions bin/ui/hboxLabelsPage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@
<property name="expand">False</property>
</packing>
</child>
<child>
<object class="GtkSeparatorToolItem" id="toolitem_label_sep1x">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
</packing>
</child>
<child>
<object class="GtkToolItem" id="toolitemLabelsOptions">
<property name="visible">True</property>
Expand All @@ -163,7 +172,7 @@
<object class="GtkMenuItem" id="menuitem9x">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Display</property>
<property name="label" translatable="yes">Map</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="menu1">
Expand All @@ -173,7 +182,7 @@
<object class="GtkMenuItem" id="menuitem_labels_grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Grid</property>
<property name="label" translatable="yes">Display options:</property>
<property name="use_underline">True</property>
</object>
</child>
Expand Down Expand Up @@ -241,77 +250,6 @@
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="separatormenuitem1">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menuitem_labels_tree">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Tree</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkRadioMenuItem" id="phylogeny_plot_length">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Plot branches using their lengths. </property>
<property name="label" translatable="yes">Length</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<property name="draw_as_radio">True</property>
</object>
</child>
<child>
<object class="GtkRadioMenuItem" id="phylogeny_plot_depth">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Plot branches as a function of depth from the root node.</property>
<property name="label" translatable="yes">Depth</property>
<property name="use_underline">True</property>
<property name="draw_as_radio">True</property>
<property name="group">phylogeny_plot_length</property>
</object>
</child>
<child>
<object class="GtkCheckMenuItem" id="highlight_groups_on_map_labels_tab">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">When hovering on a branch,
highlight the groups on the grid
in which it is found.
</property>
<property name="label" translatable="yes">Highlight groups on map?</property>
<property name="use_underline">True</property>
<property name="active">True</property>
</object>
</child>
<child>
<object class="GtkCheckMenuItem" id="use_highlight_path_changed1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">When hovering over a cell on the map,
highlight the paths from the tip to the root of the tree
for labels found in that group. </property>
<property name="label" translatable="yes">Highlight node paths for groups?</property>
<property name="use_underline">True</property>
<property name="active">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menuitem_labels_set_tree_line_widths">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Set the width of the tree branches.
Does not affect the vertical connectors.</property>
<property name="label" translatable="yes">Set tree branch line widths</property>
<property name="use_underline">True</property>
</object>
</child>
</object>
</child>
</object>
Expand Down
Loading

0 comments on commit 461d853

Please sign in to comment.