Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add QuantumMixerSlider::getValueFieldAbsoluteArea() method
  • Loading branch information
falkTX committed Aug 29, 2022
1 parent a8bf541 commit 7815359
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions opengl/Quantum.cpp
Expand Up @@ -584,6 +584,17 @@ QuantumMixerSlider::QuantumMixerSlider(NanoSubWidget* const parent, const Quantu
setSize(QuantumMetrics(t).mixerSlider);
}

Rectangle<int> QuantumMixerSlider::getValueFieldAbsoluteArea() const noexcept
{
const uint width = getWidth();
const uint height = getHeight();

const float sliderHandleHeight = theme.textHeight * 2;
const float valueBoxStartY = height - sliderHandleHeight + theme.borderSize + theme.padding;

return Rectangle<int>(getAbsoluteX(), getAbsoluteY() + valueBoxStartY, width, height - valueBoxStartY);
}

void QuantumMixerSlider::onNanoDisplay()
{
const uint width = getWidth();
Expand Down
2 changes: 2 additions & 0 deletions opengl/Quantum.hpp
Expand Up @@ -329,6 +329,8 @@ class QuantumMixerSlider : public NanoSubWidget,
explicit QuantumMixerSlider(TopLevelWidget* parent, const QuantumTheme& theme);
explicit QuantumMixerSlider(NanoSubWidget* parent, const QuantumTheme& theme);

Rectangle<int> getValueFieldAbsoluteArea() const noexcept;

protected:
void onNanoDisplay() override;
bool onMouse(const MouseEvent& ev) override;
Expand Down

0 comments on commit 7815359

Please sign in to comment.