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