Browse Source

Fix ParamTooltip. Add ParamLabel to context menu.

tags/v1.0.0
Andrew Belt 6 years ago
parent
commit
576e346fdc
1 changed files with 14 additions and 1 deletions
  1. +14
    -1
      src/app/ParamWidget.cpp

+ 14
- 1
src/app/ParamWidget.cpp View File

@@ -76,7 +76,16 @@ struct ParamTooltip : Tooltip {
text += "\n" + description; text += "\n" + description;
} }
// Position at bottom-right of parameter // Position at bottom-right of parameter
box.pos = paramWidget->getAbsoluteOffset(box.size).round();
box.pos = paramWidget->getAbsoluteOffset(paramWidget->box.size).round();
Tooltip::step();
}
};


struct ParamLabel : MenuLabel {
ParamWidget *paramWidget;
void step() override {
text = paramWidget->paramQuantity->getString();
} }
}; };


@@ -203,6 +212,10 @@ void ParamWidget::createParamField() {
void ParamWidget::createContextMenu() { void ParamWidget::createContextMenu() {
Menu *menu = createMenu(); Menu *menu = createMenu();


ParamLabel *paramLabel = new ParamLabel;
paramLabel->paramWidget = this;
menu->addChild(paramLabel);

ParamResetItem *resetItem = new ParamResetItem; ParamResetItem *resetItem = new ParamResetItem;
resetItem->paramWidget = this; resetItem->paramWidget = this;
menu->addChild(resetItem); menu->addChild(resetItem);


Loading…
Cancel
Save