mirror of
https://codeberg.org/armin/chromaflock.git
synced 2026-09-01 04:10:47 +02:00
ui polish: center header elements, highlight active preset section, longer piano decay, remove unused PNGs
This commit is contained in:
parent
dc9e973340
commit
ce37b9a2a5
7 changed files with 32 additions and 18 deletions
|
|
@ -130,7 +130,7 @@ void ComboBoxLookAndFeel::drawPopupMenuItem(juce::Graphics& g, const juce::Recta
|
|||
return;
|
||||
}
|
||||
|
||||
// Persistent highlight for the currently selected (ticked) entry
|
||||
// Persistent highlight for the currently selected (ticked) entry or section
|
||||
if (isTicked && !isHighlighted) {
|
||||
g.setColour(juce::Colour(0xffccaa44).withAlpha(0.3f));
|
||||
g.fillRoundedRectangle(area.reduced(2).toFloat(), 3.0f);
|
||||
|
|
@ -660,9 +660,12 @@ void MainContentComponent::showPresetMenu() {
|
|||
auto categories = processorRef.presetManager.getCategories();
|
||||
|
||||
juce::String currentName;
|
||||
juce::String currentCategory;
|
||||
auto& allPresets = processorRef.presetManager.getPresets();
|
||||
if (currentPresetIndex >= 0 && currentPresetIndex < static_cast<int>(allPresets.size()))
|
||||
if (currentPresetIndex >= 0 && currentPresetIndex < static_cast<int>(allPresets.size())) {
|
||||
currentName = allPresets[currentPresetIndex].name;
|
||||
currentCategory = allPresets[currentPresetIndex].category;
|
||||
}
|
||||
|
||||
for (auto& cat : categories) {
|
||||
juce::PopupMenu subMenu;
|
||||
|
|
@ -672,7 +675,8 @@ void MainContentComponent::showPresetMenu() {
|
|||
bool isCurrent = (preset.name == currentName);
|
||||
subMenu.addItem(static_cast<int>(menuOrder.size()), preset.name, true, isCurrent);
|
||||
}
|
||||
menu.addSubMenu(cat, subMenu);
|
||||
// Tick the section that contains the active patch (cleared when randomize -> index -1)
|
||||
menu.addSubMenu(cat, subMenu, true, juce::Image(), cat == currentCategory);
|
||||
}
|
||||
|
||||
menu.showMenuAsync(juce::PopupMenu::Options().withTargetComponent(&presetButton),
|
||||
|
|
@ -959,19 +963,30 @@ void MainContentComponent::resized() {
|
|||
reverbDampKnob.setBounds(1468, fx2KnobY, lfoKnobSize, lfoKnobSize);
|
||||
reverbMixKnob.setBounds(1553, fx2KnobY, lfoKnobSize, lfoKnobSize);
|
||||
|
||||
// --- PRESET + SCALE ---
|
||||
presetButton.setBounds(20, 8, 90, 28);
|
||||
randomizeButton.setBounds(20, 42, 90, 28);
|
||||
patchLCD.setBounds(118, 8, 360, 28);
|
||||
prevPresetButton.setBounds(486, 8, 28, 28);
|
||||
nextPresetButton.setBounds(518, 8, 28, 28);
|
||||
octaveTransposeLabel.setBounds(1112, 10, 30, 20);
|
||||
octaveTransposeBox.setBounds(1142, 8, 64, 24);
|
||||
semitoneTransposeLabel.setBounds(1214, 10, 32, 20);
|
||||
semitoneTransposeBox.setBounds(1246, 8, 74, 24);
|
||||
// --- PRESET + SCALE (vertically centered within top section, y: 0..128) ---
|
||||
int headerH = 128;
|
||||
int btnH = 28, btnGap = 8;
|
||||
int presetGroupH = btnH * 2 + btnGap;
|
||||
int presetStartY = (headerH - presetGroupH) / 2;
|
||||
presetButton.setBounds(20, presetStartY, 90, btnH);
|
||||
randomizeButton.setBounds(20, presetStartY + btnH + btnGap, 90, btnH);
|
||||
|
||||
scaleLabel.setBounds(1520, 10, 42, 20);
|
||||
uiScaleBox.setBounds(1566, 8, 80, 24);
|
||||
int rowH = 28;
|
||||
int rowY = (headerH - rowH) / 2;
|
||||
patchLCD.setBounds(118, rowY, 360, rowH);
|
||||
prevPresetButton.setBounds(486, rowY, 28, rowH);
|
||||
nextPresetButton.setBounds(518, rowY, 28, rowH);
|
||||
|
||||
int comboH2 = 24, 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);
|
||||
|
||||
scaleLabel.setBounds(1520, labelY2, 42, labelH2);
|
||||
uiScaleBox.setBounds(1566, comboY2, 80, comboH2);
|
||||
|
||||
// Visualizer area
|
||||
int vizY = 818;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue