mirror of
https://codeberg.org/armin/chromaflock.git
synced 2026-09-01 04:10:47 +02:00
Limit rotary knob value text shown by 1 decimal
This commit is contained in:
parent
8c0f55f1e7
commit
d79af00b23
3 changed files with 47 additions and 26 deletions
|
|
@ -513,7 +513,6 @@ MainContentComponent::MainContentComponent(ChromaFlockProcessor& p)
|
|||
setupLabel(filterLabel, "FILTER");
|
||||
setupCB(filterTypeBox, filterTypeAttach, "filterType", {"LP 12dB", "LP 24dB", "Band Pass", "High Pass", "Notch"});
|
||||
setupParam(filterCutoffKnob, filterCutoffAttach, "filterCutoff", "CUTOFF");
|
||||
filterCutoffKnob.setNumDecimalPlacesToDisplay(1);
|
||||
setupParam(filterResKnob, filterResAttach, "filterRes", "RES");
|
||||
setupParam(filterEnvAmtKnob, filterEnvAmtAttach, "filterEnvAmt", "ENV AMT");
|
||||
setupParam(keyTrackKnob, keyTrackAttach, "keyTrack", "KEY TRK");
|
||||
|
|
@ -634,20 +633,20 @@ MainContentComponent::MainContentComponent(ChromaFlockProcessor& p)
|
|||
}
|
||||
|
||||
scaleLabel.setText("SCALE", juce::dontSendNotification);
|
||||
scaleLabel.setFont(juce::Font(juce::FontOptions(9.0f)));
|
||||
scaleLabel.setFont(juce::Font(juce::FontOptions(13.0f).withStyle("Bold")));
|
||||
scaleLabel.setColour(juce::Label::textColourId, juce::Colour(0xff888888));
|
||||
scaleLabel.setJustificationType(juce::Justification::centredRight);
|
||||
addAndMakeVisible(scaleLabel);
|
||||
|
||||
midiLabel.setText("MIDI IN", juce::dontSendNotification);
|
||||
midiLabel.setFont(juce::Font(juce::FontOptions(9.0f)));
|
||||
midiLabel.setFont(juce::Font(juce::FontOptions(13.0f).withStyle("Bold")));
|
||||
midiLabel.setColour(juce::Label::textColourId, juce::Colour(0xff888888));
|
||||
midiLabel.setJustificationType(juce::Justification::centredLeft);
|
||||
addAndMakeVisible(midiLabel);
|
||||
|
||||
auto setupTransposeLabel = [&](juce::Label& label, const juce::String& text) {
|
||||
label.setText(text, juce::dontSendNotification);
|
||||
label.setFont(juce::Font(juce::FontOptions(9.0f)));
|
||||
label.setFont(juce::Font(juce::FontOptions(13.0f).withStyle("Bold")));
|
||||
label.setColour(juce::Label::textColourId, juce::Colour(0xff888888));
|
||||
label.setJustificationType(juce::Justification::centredLeft);
|
||||
addAndMakeVisible(label);
|
||||
|
|
@ -944,6 +943,20 @@ void MainContentComponent::paint(juce::Graphics& g) {
|
|||
g.setOpacity(1.0f);
|
||||
}
|
||||
|
||||
// Header section background
|
||||
{
|
||||
auto rect = juce::Rectangle<float>(10.0f, 0.0f, 1640.0f, 80.0f);
|
||||
auto glow = rect.expanded(6.0f);
|
||||
g.setColour(juce::Colour(0xff222222).withAlpha(0.25f));
|
||||
g.fillRoundedRectangle(glow, 12.0f);
|
||||
juce::ColourGradient fillGrad(juce::Colour(0xBB222222), rect.getCentreX(), rect.getY(),
|
||||
juce::Colour(0xBB111111), rect.getCentreX(), rect.getBottom(), false);
|
||||
g.setGradientFill(fillGrad);
|
||||
g.fillRoundedRectangle(rect, 9.0f);
|
||||
g.setColour(juce::Colour(0xff333333));
|
||||
g.drawRoundedRectangle(rect, 9.0f, 1.0f);
|
||||
}
|
||||
|
||||
// Load logo
|
||||
if (!logoLoaded) {
|
||||
auto img = juce::ImageFileFormat::loadFrom(
|
||||
|
|
@ -1213,16 +1226,16 @@ void MainContentComponent::resized() {
|
|||
int comboH2 = 28, labelH2 = 20;
|
||||
int comboY2 = (headerH - comboH2) / 2;
|
||||
int labelY2 = (headerH - labelH2) / 2;
|
||||
octaveTransposeLabel.setBounds(1112, labelY2, 30, labelH2);
|
||||
octaveTransposeBox.setBounds(1142, comboY2, 64, comboH2);
|
||||
semitoneTransposeLabel.setBounds(1214, labelY2, 32, labelH2);
|
||||
semitoneTransposeBox.setBounds(1246, comboY2, 74, comboH2);
|
||||
octaveTransposeLabel.setBounds(1112, labelY2, 44, labelH2);
|
||||
octaveTransposeBox.setBounds(1156, comboY2, 64, comboH2);
|
||||
semitoneTransposeLabel.setBounds(1226, labelY2, 46, labelH2);
|
||||
semitoneTransposeBox.setBounds(1272, comboY2, 74, comboH2);
|
||||
|
||||
midiLabel.setBounds(1340, labelY2, 46, labelH2);
|
||||
midiLed.setBounds(1390, (headerH - 10) / 2, 10, 10);
|
||||
midiLabel.setBounds(1354, labelY2, 64, labelH2);
|
||||
midiLed.setBounds(1418, (headerH - 10) / 2, 10, 10);
|
||||
|
||||
scaleLabel.setBounds(1514, labelY2, 42, labelH2);
|
||||
uiScaleBox.setBounds(1560, comboY2, 80, comboH2);
|
||||
scaleLabel.setBounds(1514, labelY2, 58, labelH2);
|
||||
uiScaleBox.setBounds(1574, comboY2, 80, comboH2);
|
||||
|
||||
// Visualizer area
|
||||
int vizY = 746;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue