| 33 | } |
| 34 | |
| 35 | void Knob::paint(Graphics& g) |
| 36 | { |
| 37 | float alpha = isEnabled() ? 1.0f : 0.5f; |
| 38 | |
| 39 | mSlider.setAlpha(alpha); |
| 40 | g.setColour(juce::Colours::black.withAlpha(alpha)); |
| 41 | g.setFont(UIDefines::LABEL_FONT()); |
| 42 | |
| 43 | if (!mIsMouseOver || !isEnabled()) { |
| 44 | g.drawMultiLineText(mLabel, 0, 73, 66, juce::Justification::centred, 0.0f); |
| 45 | } else { |
| 46 | String value = mSlider.getTextFromValue(mSlider.getValue()); |
| 47 | g.drawText(value + mPostValueStr, |
| 48 | juce::Rectangle<int>(0, 73, getWidth(), getHeight() - 67), |
| 49 | juce::Justification::centredTop); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | void Knob::mouseEnter(const MouseEvent& event) |
| 54 | { |
nothing calls this directly
no test coverage detected