visualdynamics.gui.toolbars¶
toolbars
¶
Dividers on a plot's control bar, which show how its controls group.
A control bar holds two kinds of control, and they behave differently:
- Choices. Curves or Map; Averaging, Filter, Kurtosis or Shocks. Exactly one of each set is in force, and picking one turns off the last, so the reader needs to know which controls form a set.
- Settings. The 2-D/3-D toggle, which quantity is on the stage, which page of channels, Drive points, CMIF. Each is independent of the others and of whichever choice is in force. 3-D is how any of the choices is drawn, and is not a choice of its own.
Without dividers, a person has to click an icon to find out whether it turns another one off. A divider shows the grouping before they click.
The bars are built once with every control and then hidden down to
what the current selection can use, so there are two functions:
fence puts the dividers in at build time, and tidy decides at show
time which of them still divide anything. Every bar uses the same
rule, so the bars all read the same way.
Functions:
| Name | Description |
|---|---|
fence |
Put a divider on each side of every run of actions. |
tidy |
Show only the dividers that still divide something. |
shows_anything |
Whether the bar has a visible control on it, not counting |
Functions:¶
fence
¶
Put a divider on each side of every run of actions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
toolbar
|
QToolBar
|
The bar to add dividers to. Separators are inserted between its actions, and no action changes place. |
required |
runs
|
iterable of sequence of QAction
|
Each run is a group that belongs together: the actions of a
|
required |
Notes
tidy hides the dividers that turn out to divide nothing, so a
fence around a group that the current selection hides does not leave
a stray line. That is why every group can be fenced, and not only
the ones that seem to need it.
Source code in src/visualdynamics/gui/toolbars.py
tidy
¶
Show only the dividers that still divide something.
The bar is built with every control on it and then hidden down to what the current selection can use, so which groups are left differs each time. A divider with nothing on one side reads as a group that is missing, when the group does not apply.
A separator is kept when a visible control is somewhere before it and somewhere after it, and no separator has been kept since the last visible control. That drops leading and trailing dividers and reduces a run of adjacent dividers to one. Two groups fenced side by side put two separators together, and dropping both would run the groups into each other.
Source code in src/visualdynamics/gui/toolbars.py
shows_anything
¶
Whether the bar has a visible control on it, not counting dividers.
A separator is visible whether or not anything is around it, so a
bar of nothing but dividers would pass a plain any(isVisible) and
stay up. Run tidy first, then this.