feat(gui): add knob value popup, tooltips, tab cycling, and layout system
Add a floating value label near the cursor while dragging a knob, giving immediate feedback without altering slider behaviour. Inherit SettableTooltipClient on ToggleButton so setTooltip works consistently with knobs and combos. Introduce a shared layout constants namespace in PluginEditor so every panel, row and control position derives from one spacing system. Add tooltips to all knobs, combos, toggles, and buttons. Add Tab/Shift+Tab tab cycling via keyPressed, with a TooltipWindow for hover hints.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <JuceHeader.h>
|
||||
#include <memory>
|
||||
#include "../Resources.h"
|
||||
|
||||
namespace serum
|
||||
@@ -9,6 +10,10 @@ namespace serum
|
||||
// ===========================================================================
|
||||
// Rotary knob — a juce::Slider styled by SerumLookAndFeel. The value readout is
|
||||
// formatted by a user-provided function via getTextFromValue().
|
||||
//
|
||||
// While the knob is being dragged it also shows a small floating label near the
|
||||
// mouse cursor with the live (formatted) value, giving immediate feedback
|
||||
// without changing the slider's normal behaviour.
|
||||
// ===========================================================================
|
||||
class Knob : public juce::Slider
|
||||
{
|
||||
@@ -20,8 +25,17 @@ public:
|
||||
|
||||
juce::String getTextFromValue (double value) override;
|
||||
|
||||
void mouseDown (const juce::MouseEvent& e) override;
|
||||
void mouseDrag (const juce::MouseEvent& e) override;
|
||||
void mouseUp (const juce::MouseEvent& e) override;
|
||||
void mouseExit (const juce::MouseEvent& e) override;
|
||||
|
||||
private:
|
||||
void showValuePopup (const juce::MouseEvent& e);
|
||||
void hideValuePopup();
|
||||
|
||||
std::function<juce::String (float)> formatter;
|
||||
std::unique_ptr<juce::Label> valuePopup;
|
||||
};
|
||||
|
||||
} // namespace serum
|
||||
|
||||
Reference in New Issue
Block a user