commit b52956f9f0c0fff0a565a1ae6db32c6b95e2beaf
parent b085b8975d131b18e23f0df98ac9715261e97017
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Sun, 19 May 2024 22:32:37 +0200
some minor corrections to code just merged via PR
Diffstat:
2 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/source/jucePluginEditorLib/focusedParameterTooltip.cpp b/source/jucePluginEditorLib/focusedParameterTooltip.cpp
@@ -1,13 +1,11 @@
#include "focusedParameterTooltip.h"
-#include "pluginEditor.h"
-
#include "juce_gui_basics/juce_gui_basics.h"
namespace jucePluginEditorLib
{
- FocusedParameterTooltip::FocusedParameterTooltip(juce::Label *_label, const genericUI::Editor &_editor) :
- m_label(_label), m_editor(_editor), m_defaultWidth(_label ? _label->getWidth() : 0)
+ FocusedParameterTooltip::FocusedParameterTooltip(juce::Label *_label, const juce::Component& _bounds)
+ : m_label(_label), m_defaultWidth(_label ? _label->getWidth() : 0), m_bounds(_bounds)
{
setVisible(false);
@@ -55,8 +53,8 @@ namespace jucePluginEditorLib
m_label->setTopLeftPosition(x,y);
m_label->setSize(labelWidth, m_label->getHeight());
- const auto editorRect = m_editor.getBounds();
- auto labelRect = m_label->getBounds();
+ const auto editorRect = m_bounds.getBounds();
+ const auto labelRect = m_label->getBounds();
m_label->setBounds(labelRect.constrainedWithin(editorRect));
m_label->setText(_value, juce::dontSendNotification);
diff --git a/source/jucePluginEditorLib/focusedParameterTooltip.h b/source/jucePluginEditorLib/focusedParameterTooltip.h
@@ -7,17 +7,12 @@ namespace juce
class Label;
}
-namespace genericUI
-{
- class Editor;
-}
-
namespace jucePluginEditorLib
{
class FocusedParameterTooltip
{
public:
- FocusedParameterTooltip(juce::Label* _label, const genericUI::Editor& _editor);
+ FocusedParameterTooltip(juce::Label* _label, const juce::Component& _bounds);
bool isValid() const { return m_label != nullptr; }
void setVisible(bool _visible) const;
@@ -26,6 +21,6 @@ namespace jucePluginEditorLib
private:
juce::Label* m_label = nullptr;
int m_defaultWidth;
- const genericUI::Editor& m_editor;
+ const juce::Component& m_bounds;
};
}