mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-20 22:30:05 +02:00
Put the scrub bar below
This commit is contained in:
parent
4b6e48a26c
commit
da4fa1d965
@ -84,6 +84,8 @@ array of Ruler::Label.
|
||||
#include "../Snap.h"
|
||||
#include "../tracks/ui/Scrubbing.h"
|
||||
|
||||
//#define SCRUB_ABOVE
|
||||
|
||||
using std::min;
|
||||
using std::max;
|
||||
|
||||
@ -2085,7 +2087,7 @@ void AdornedRulerPanel::OnPaint(wxPaintEvent & WXUNUSED(evt))
|
||||
mBack->Create(sz.x, sz.y, dc);
|
||||
mBackDC.SelectObject(*mBack);
|
||||
|
||||
DoDrawBorder(&mBackDC);
|
||||
DoDrawBackground(&mBackDC);
|
||||
|
||||
if (!mViewInfo->selectedRegion.isPoint())
|
||||
{
|
||||
@ -2110,6 +2112,8 @@ void AdornedRulerPanel::OnPaint(wxPaintEvent & WXUNUSED(evt))
|
||||
|
||||
DoDrawPushbuttons(&mBackDC);
|
||||
|
||||
DoDrawEdge(&mBackDC);
|
||||
|
||||
dc.Blit(0, 0, mBack->GetWidth(), mBack->GetHeight(), &mBackDC, 0, 0);
|
||||
|
||||
if (mQuickPlayInd)
|
||||
@ -2137,21 +2141,30 @@ void AdornedRulerPanel::UpdateRects()
|
||||
mInner.x += LeftMargin;
|
||||
mInner.width -= (LeftMargin + RightMargin);
|
||||
|
||||
wxRect *top = &mInner;
|
||||
auto top = &mInner;
|
||||
auto bottom = &mInner;
|
||||
|
||||
if (mShowScrubbing) {
|
||||
mScrubZone = mInner;
|
||||
auto scrubHeight = std::min(mScrubZone.height, int(ScrubHeight));
|
||||
mScrubZone.height = scrubHeight;
|
||||
mInner.height -= scrubHeight;
|
||||
mInner.y += scrubHeight;
|
||||
top = &mScrubZone;
|
||||
|
||||
int topHeight;
|
||||
#ifdef SCRUB_ABOVE
|
||||
top = &mScrubZone, topHeight = scrubHeight;
|
||||
#else
|
||||
auto qpHeight = mScrubZone.height - scrubHeight;
|
||||
bottom = &mScrubZone, topHeight = qpHeight;
|
||||
#endif
|
||||
|
||||
top->height = topHeight;
|
||||
bottom->height -= topHeight;
|
||||
bottom->y += topHeight;
|
||||
}
|
||||
|
||||
top->y += TopMargin;
|
||||
top->height -= TopMargin;
|
||||
|
||||
mInner.height -= BottomMargin;
|
||||
bottom->height -= BottomMargin;
|
||||
|
||||
if (!mShowScrubbing)
|
||||
mScrubZone = mInner;
|
||||
@ -3076,6 +3089,13 @@ void AdornedRulerPanel::DoDrawPushbuttons(wxDC *dc) const
|
||||
{
|
||||
// Paint the area behind the buttons
|
||||
wxRect background = GetButtonAreaRect();
|
||||
|
||||
#ifndef SCRUB_ABOVE
|
||||
// Reduce the height
|
||||
background.y = mInner.y;
|
||||
background.height = mInner.height;
|
||||
#endif
|
||||
|
||||
AColor::MediumTrackInfo(dc, false);
|
||||
dc->DrawRectangle(background);
|
||||
|
||||
@ -3088,7 +3108,7 @@ void AdornedRulerPanel::DoDrawPushbuttons(wxDC *dc) const
|
||||
}
|
||||
}
|
||||
|
||||
void AdornedRulerPanel::DoDrawBorder(wxDC * dc)
|
||||
void AdornedRulerPanel::DoDrawBackground(wxDC * dc)
|
||||
{
|
||||
// Draw AdornedRulerPanel border
|
||||
AColor::MediumTrackInfo( dc, false );
|
||||
@ -3101,6 +3121,10 @@ void AdornedRulerPanel::DoDrawBorder(wxDC * dc)
|
||||
dc->DrawRectangle(mScrubZone);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void AdornedRulerPanel::DoDrawEdge(wxDC *dc)
|
||||
{
|
||||
wxRect r = mOuter;
|
||||
r.width -= RightMargin;
|
||||
r.height -= BottomMargin;
|
||||
@ -3248,13 +3272,13 @@ void AdornedRulerPanel::DoEraseIndicator(wxDC *dc, int x)
|
||||
|
||||
// Restore the background, but make it a little oversized to make
|
||||
// it happy OSX.
|
||||
dc->Blit(x - indsize - 1,
|
||||
mScrubZone.y - 1,
|
||||
auto xx = x - indsize - 1;
|
||||
auto yy = mScrubZone.y - 1;
|
||||
dc->Blit(xx, yy,
|
||||
indsize * 2 + 1 + 2,
|
||||
mScrubZone.y + height + 2,
|
||||
&mBackDC,
|
||||
x - indsize - 1,
|
||||
0);
|
||||
xx, yy);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -359,7 +359,8 @@ private:
|
||||
|
||||
void OnCaptureLost(wxMouseCaptureLostEvent &evt);
|
||||
|
||||
void DoDrawBorder(wxDC * dc);
|
||||
void DoDrawBackground(wxDC * dc);
|
||||
void DoDrawEdge(wxDC *dc);
|
||||
void DoDrawMarks(wxDC * dc, bool /*text */ );
|
||||
void DoDrawCursor(wxDC * dc);
|
||||
void DoDrawSelection(wxDC * dc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user