1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-18 09:00:07 +02:00

Removing remaining code for focusable time ruler

This commit is contained in:
Paul Licameli 2016-06-29 12:33:21 -04:00
parent bbd369df1b
commit a0bb210dbe
4 changed files with 7 additions and 43 deletions

View File

@ -200,9 +200,4 @@
// interpolating in frequency domain. // interpolating in frequency domain.
#define EXPERIMENTAL_ZERO_PADDED_SPECTROGRAMS #define EXPERIMENTAL_ZERO_PADDED_SPECTROGRAMS
// Paul Licameli (PRL) 10 May 2016
// Time ruler accepts focus, buttons can be reached with TAB
//#define EXPERIMENTAL_TIME_RULER_NAVIGATION
#endif #endif

View File

@ -2795,17 +2795,10 @@ void AudacityProject::NextOrPrevFrame(bool forward)
// Define the set of windows we rotate among. // Define the set of windows we rotate among.
static const unsigned rotationSize = 3u static const unsigned rotationSize = 3u;
#ifdef EXPERIMENTAL_TIME_RULER_NAVIGATION
+ 1
#endif
;
wxWindow *const begin [rotationSize] = { wxWindow *const begin [rotationSize] = {
GetTopPanel(), GetTopPanel(),
#ifdef EXPERIMENTAL_TIME_RULER_NAVIGATION
GetRulerPanel(),
#endif
GetTrackPanel(), GetTrackPanel(),
mToolManager->GetBotDock(), mToolManager->GetBotDock(),
}; };

View File

@ -1670,11 +1670,6 @@ enum : int {
BottomMargin = 2, // for bottom bevel and bottom line BottomMargin = 2, // for bottom bevel and bottom line
LeftMargin = 1, LeftMargin = 1,
FocusBorder = 2,
FocusBorderLeft = FocusBorder,
FocusBorderTop = FocusBorder,
FocusBorderBottom = FocusBorder + 1, // count 1 for the black stroke
RightMargin = 1, RightMargin = 1,
}; };
@ -2080,7 +2075,7 @@ void AdornedRulerPanel::ReCreateButtons()
// Make the short row of time ruler pushbottons. // Make the short row of time ruler pushbottons.
// Don't bother with sizers. Their sizes and positions are fixed. // Don't bother with sizers. Their sizes and positions are fixed.
wxPoint position{ FocusBorderLeft, 0 }; wxPoint position{ 1 + LeftMargin, 0 };
size_t iButton = 0; size_t iButton = 0;
auto size = theTheme.ImageSize( bmpRecoloredUpSmall ); auto size = theTheme.ImageSize( bmpRecoloredUpSmall );
size.y = std::min(size.y, GetRulerHeight(false)); size.y = std::min(size.y, GetRulerHeight(false));
@ -3072,26 +3067,10 @@ void AdornedRulerPanel::DoDrawBackground(wxDC * dc)
void AdornedRulerPanel::DoDrawEdge(wxDC *dc) void AdornedRulerPanel::DoDrawEdge(wxDC *dc)
{ {
if (HasFocus()) {
dc->SetBrush(*wxTRANSPARENT_BRUSH);
wxRect rect{ mOuter };
--rect.height; // Leave room for the black stroke
AColor::TrackFocusPen(dc, 1);
dc->DrawRectangle(rect);
AColor::TrackFocusPen(dc, 0);
rect.Deflate(1, 1);
dc->DrawRectangle(rect);
static_assert(FocusBorder == 2, "Draws the wrong number of rectangles");
}
else {
wxRect r = mOuter; wxRect r = mOuter;
r.width -= RightMargin; r.width -= RightMargin;
r.height -= BottomMargin; r.height -= BottomMargin;
AColor::BevelTrackInfo( *dc, true, r ); AColor::BevelTrackInfo( *dc, true, r );
}
// Black stroke at bottom // Black stroke at bottom
dc->SetPen( *wxBLACK_PEN ); dc->SetPen( *wxBLACK_PEN );
@ -3099,8 +3078,6 @@ void AdornedRulerPanel::DoDrawEdge(wxDC *dc)
mOuter.y + mOuter.height - 1, mOuter.y + mOuter.height - 1,
mOuter.x + mOuter.width, mOuter.x + mOuter.width,
mOuter.y + mOuter.height - 1 ); mOuter.y + mOuter.height - 1 );
static_assert(FocusBorderBottom == 1 + FocusBorder, "Button area might be wrong");
} }
void AdornedRulerPanel::DoDrawMarks(wxDC * dc, bool /*text */ ) void AdornedRulerPanel::DoDrawMarks(wxDC * dc, bool /*text */ )

View File

@ -294,9 +294,8 @@ public:
~AdornedRulerPanel(); ~AdornedRulerPanel();
#ifndef EXPERIMENTAL_TIME_RULER_NAVIGATION
bool AcceptsFocus() const override { return false; } bool AcceptsFocus() const override { return false; }
#endif bool AcceptsFocusFromKeyboard() const override { return false; }
public: public:
int GetRulerHeight() { return GetRulerHeight(mShowScrubbing); } int GetRulerHeight() { return GetRulerHeight(mShowScrubbing); }