mirror of
https://codeberg.org/armin/monoslicer.git
synced 2026-09-01 12:10:46 +02:00
Move scroll buttons to title bar, add build info status bar
- Replace broken bottom waveform scroll buttons with title bar < > buttons - Add scrollLeft()/scrollRight() methods to WaveformDisplay - Add status bar showing git branch, commit, dirty state, and build timestamp - Inject git version info via CMake at configure time - Enable COPY_PLUGIN_AFTER_BUILD - Increase baseHeight by 20px for status bar
This commit is contained in:
parent
9b7c973622
commit
93c8c73399
5 changed files with 93 additions and 24 deletions
|
|
@ -7,13 +7,6 @@ WaveformDisplay::WaveformDisplay(SliceManager& sm) : sliceManager(sm)
|
|||
hScrollBar.setRangeLimits(0.0, 1.0);
|
||||
hScrollBar.setCurrentRange(0.0, 1.0);
|
||||
|
||||
auto setupScrollBtn = [this](juce::TextButton& btn) {
|
||||
addAndMakeVisible(btn);
|
||||
btn.setColour(juce::TextButton::buttonColourId, juce::Colour(0xff2a2a4a));
|
||||
};
|
||||
setupScrollBtn(scrollLeftBtn);
|
||||
setupScrollBtn(scrollRightBtn);
|
||||
|
||||
startTimerHz(30);
|
||||
}
|
||||
|
||||
|
|
@ -67,6 +60,22 @@ void WaveformDisplay::zoomReset()
|
|||
repaint();
|
||||
}
|
||||
|
||||
void WaveformDisplay::scrollLeft()
|
||||
{
|
||||
scrollOffset -= 1.0f / zoomFactor;
|
||||
scrollOffset = juce::jlimit(0.0f, 1.0f, scrollOffset);
|
||||
syncScrollBar();
|
||||
repaint();
|
||||
}
|
||||
|
||||
void WaveformDisplay::scrollRight()
|
||||
{
|
||||
scrollOffset += 1.0f / zoomFactor;
|
||||
scrollOffset = juce::jlimit(0.0f, 1.0f, scrollOffset);
|
||||
syncScrollBar();
|
||||
repaint();
|
||||
}
|
||||
|
||||
void WaveformDisplay::syncScrollBar()
|
||||
{
|
||||
if (updatingScroll) return;
|
||||
|
|
@ -209,7 +218,6 @@ void WaveformDisplay::paint(juce::Graphics& g)
|
|||
g.setColour(juce::Colours::grey);
|
||||
g.setFont(14.0f);
|
||||
g.drawText("No audio file loaded.", textArea, juce::Justification::centred);
|
||||
hScrollBar.setBounds(bounds.removeFromBottom(scrollbarHeight).toNearestInt());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -225,13 +233,6 @@ void WaveformDisplay::paint(juce::Graphics& g)
|
|||
auto waveArea = waveBounds.withTrimmedLeft(keyWidth);
|
||||
drawWaveform(g, waveArea);
|
||||
drawSliceMarkers(g, waveArea);
|
||||
|
||||
// Scrollbar at bottom
|
||||
hScrollBar.setBounds(juce::Rectangle<int>(
|
||||
static_cast<int>(bounds.getBottomLeft().getX()),
|
||||
static_cast<int>(bounds.getBottom() - scrollbarHeight),
|
||||
static_cast<int>(bounds.getWidth()),
|
||||
static_cast<int>(scrollbarHeight)));
|
||||
}
|
||||
|
||||
void WaveformDisplay::drawKeys(juce::Graphics& g, juce::Rectangle<float> bounds)
|
||||
|
|
@ -531,10 +532,7 @@ void WaveformDisplay::resized()
|
|||
{
|
||||
auto bounds = getLocalBounds();
|
||||
auto scrollBarRow = bounds.removeFromBottom(static_cast<int>(scrollbarHeight));
|
||||
scrollLeftBtn.setBounds(scrollBarRow.getX(), scrollBarRow.getY(), scrollBtnWidth, scrollBarRow.getHeight());
|
||||
scrollRightBtn.setBounds(scrollBarRow.getRight() - scrollBtnWidth, scrollBarRow.getY(), scrollBtnWidth, scrollBarRow.getHeight());
|
||||
hScrollBar.setBounds(scrollBarRow.getX() + scrollBtnWidth, scrollBarRow.getY(),
|
||||
scrollBarRow.getWidth() - scrollBtnWidth * 2, scrollBarRow.getHeight());
|
||||
hScrollBar.setBounds(scrollBarRow);
|
||||
}
|
||||
|
||||
void WaveformDisplay::mouseDown(const juce::MouseEvent& e)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue