Browse Source

Hide ParamResetItem if param is unbounded.

tags/v2.0.0
Andrew Belt 4 years ago
parent
commit
9086c1aeed
2 changed files with 8 additions and 7 deletions
  1. +7
    -5
      src/app/ParamWidget.cpp
  2. +1
    -2
      src/engine/ParamQuantity.cpp

+ 7
- 5
src/app/ParamWidget.cpp View File

@@ -262,11 +262,13 @@ void ParamWidget::createContextMenu() {
menu->addChild(paramField); menu->addChild(paramField);
} }


ParamResetItem* resetItem = new ParamResetItem;
resetItem->text = "Initialize";
resetItem->rightText = "Double-click";
resetItem->paramWidget = this;
menu->addChild(resetItem);
if (pq && pq->resetEnabled && pq->isBounded()) {
ParamResetItem* resetItem = new ParamResetItem;
resetItem->text = "Initialize";
resetItem->rightText = "Double-click";
resetItem->paramWidget = this;
menu->addChild(resetItem);
}


// ParamFineItem *fineItem = new ParamFineItem; // ParamFineItem *fineItem = new ParamFineItem;
// fineItem->text = "Fine adjust"; // fineItem->text = "Fine adjust";


+ 1
- 2
src/engine/ParamQuantity.cpp View File

@@ -123,8 +123,7 @@ std::string ParamQuantity::getUnit() {
} }


void ParamQuantity::reset() { void ParamQuantity::reset() {
// Same as Quantity::reset
setValue(getDefaultValue());
Quantity::reset();
} }


void ParamQuantity::randomize() { void ParamQuantity::randomize() {


Loading…
Cancel
Save