mirror of
https://github.com/cookiengineer/audacity
synced 2025-04-30 15:49:41 +02:00
Change style of toolbar grabber
Remove bevels of toolbar grabber and change style Signed-off-by: akleja <storspov@gmail.com> Change style of toolbar grabber
This commit is contained in:
parent
9fd60e6cc6
commit
c3c5765a92
@ -122,7 +122,7 @@ void Grabber::DrawGrabber( wxDC & dc )
|
|||||||
// So use 0,0 as origin for draw, so that the grabber draws right if
|
// So use 0,0 as origin for draw, so that the grabber draws right if
|
||||||
// positioned in its parent at some non zero position.
|
// positioned in its parent at some non zero position.
|
||||||
r.SetPosition( wxPoint(0,0) );
|
r.SetPosition( wxPoint(0,0) );
|
||||||
int y, left, right, top, bottom;
|
int x, y, left, right, top, bottom;
|
||||||
|
|
||||||
AColor::Medium(&dc, mOver );
|
AColor::Medium(&dc, mOver );
|
||||||
dc.DrawRectangle(r);
|
dc.DrawRectangle(r);
|
||||||
@ -131,25 +131,21 @@ void Grabber::DrawGrabber( wxDC & dc )
|
|||||||
if( mAsSpacer )
|
if( mAsSpacer )
|
||||||
r.width -= 1;
|
r.width -= 1;
|
||||||
|
|
||||||
#ifndef __WXMAC__
|
|
||||||
|
|
||||||
// Add a box
|
//if vertical toolbar...
|
||||||
r.width -= 1;
|
//could make this check more uniform with others.
|
||||||
r.height -= 1;
|
if (r.GetSize().GetHeight() <= r.GetSize().GetWidth()) {
|
||||||
AColor::Bevel(dc, !mPressed, r);
|
SetSize(GetSize().GetWidth(),10);
|
||||||
r.width += 1;
|
r.SetHeight(10);
|
||||||
r.height += 1;
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// No bumps in a spacer grabber.
|
// No bumps in a spacer grabber.
|
||||||
if( mAsSpacer )
|
if( mAsSpacer )
|
||||||
return;
|
return;
|
||||||
// Calculate the bump rectangle
|
// Calculate the bump rectangle
|
||||||
r.Deflate(3, 3);
|
r.Deflate(3, 3);
|
||||||
if ((r.GetHeight() % 4) < 2) {
|
|
||||||
r.Offset(0, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cache
|
// Cache
|
||||||
left = r.GetLeft();
|
left = r.GetLeft();
|
||||||
@ -157,29 +153,18 @@ void Grabber::DrawGrabber( wxDC & dc )
|
|||||||
top = r.GetTop();
|
top = r.GetTop();
|
||||||
bottom = r.GetBottom();
|
bottom = r.GetBottom();
|
||||||
|
|
||||||
// Draw the raised bumps
|
|
||||||
if (mPressed) {
|
// Draw the line
|
||||||
AColor::Dark(&dc, false);
|
if (!mPressed) {
|
||||||
|
dc.SetPen(wxPen( theTheme.Colour( clrDark )));
|
||||||
|
dc.SetBrush(wxBrush( theTheme.Colour( clrDark )));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
AColor::Light(&dc, false);
|
dc.SetPen(wxPen( theTheme.Colour( clrLight )));
|
||||||
|
dc.SetBrush(wxBrush( theTheme.Colour( clrLight )));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (y = top; y < bottom; y += 4) {
|
dc.DrawRectangle(left+1,top+1,right-4,bottom-4);
|
||||||
AColor::Line(dc, left, y, right, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw the pushed bumps
|
|
||||||
if (mPressed) {
|
|
||||||
AColor::Light(&dc, false);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
AColor::Dark(&dc, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (y = top + 1; y <= bottom; y += 4) {
|
|
||||||
AColor::Line(dc, left, y, right, y);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user