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; int portId;


/** The name of the port, using sentence capitalization. /** 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; std::string name;

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


Loading…
Cancel
Save