Browse Source

Rearrange text in PortTooltip

tags/v2.0.0
Andrew Belt 5 years ago
parent
commit
adc3f681c3
2 changed files with 11 additions and 7 deletions
  1. +5
    -1
      include/engine/PortInfo.hpp
  2. +6
    -6
      src/app/PortWidget.cpp

+ 5
- 1
include/engine/PortInfo.hpp View File

@@ -13,9 +13,13 @@ struct PortInfo {
int portId;

/** The name of the port, using sentence capitalization.
e.g. "Sine", "Pitch input", "Mode CV"
e.g. "Sine", "Pitch input", "Mode CV".

Don't use the words "input" or "output" in the name.
Since this text is often prepended or appended to the name, the name will appear as e.g. "Sine input input", "Input: Sine input".
*/
std::string name;

/** An optional one-sentence description of the parameter. */
std::string description;



+ 6
- 6
src/app/PortWidget.cpp View File

@@ -23,6 +23,12 @@ struct PortTooltip : ui::Tooltip {
text = (portWidget->type == engine::Port::INPUT) ? "Input" : "Output";
text += ": ";
text += portInfo->getName();
// Description
std::string description = portInfo->getDescription();
if (description != "") {
text += "\n";
text += description;
}
// Voltage, number of channels
int channels = port->getChannels();
for (int i = 0; i < channels; i++) {
@@ -32,12 +38,6 @@ struct PortTooltip : ui::Tooltip {
text += string::f("%d: ", i + 1);
text += string::f("% .3fV", port->getVoltage(i));
}
// Description
std::string description = portInfo->getDescription();
if (description != "") {
text += "\n";
text += description;
}
// Connected to
std::list<CableWidget*> cables = APP->scene->rack->getCablesOnPort(portWidget);
for (CableWidget* cable : cables) {


Loading…
Cancel
Save