зеркало из https://github.com/mozilla/gecko-dev.git
Better drawing for control tracking on push buttons. Now selects/unselects correctly for mouse clicks.
This commit is contained in:
Родитель
bfa2e799a8
Коммит
f1ba38b754
|
@ -405,6 +405,9 @@ CRDFPushButton :: MouseWithin ( Point /*inPortPt*/, const EventRecord & /*inMacE
|
||||||
void
|
void
|
||||||
CRDFPushButton :: MouseLeave( )
|
CRDFPushButton :: MouseLeave( )
|
||||||
{
|
{
|
||||||
|
if ( !IsMouseInFrame() )
|
||||||
|
return;
|
||||||
|
|
||||||
mMouseInFrame = false;
|
mMouseInFrame = false;
|
||||||
if (IsActive() && IsEnabled()) {
|
if (IsActive() && IsEnabled()) {
|
||||||
// since we can't simply draw the border w/ xor, we need to get the toolbar
|
// since we can't simply draw the border w/ xor, we need to get the toolbar
|
||||||
|
@ -438,6 +441,25 @@ CRDFPushButton :: HotSpotAction(short /* inHotSpot */, Boolean inCurrInside, Boo
|
||||||
} // HotSpotAction
|
} // HotSpotAction
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// DoneTracking
|
||||||
|
//
|
||||||
|
// Reset the toolbar back to its original state.
|
||||||
|
//
|
||||||
|
void
|
||||||
|
CRDFPushButton :: DoneTracking( SInt16 inHotSpot, Boolean inGoodTrack )
|
||||||
|
{
|
||||||
|
SetTrackInside(false);
|
||||||
|
|
||||||
|
if ( inGoodTrack ) {
|
||||||
|
// draw parent, then redraw us.
|
||||||
|
GetSuperView()->Draw(NULL);
|
||||||
|
Draw(NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
MouseLeave(); // mouse has left the building. Redraw the correct state now, not later
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -123,6 +123,7 @@ protected:
|
||||||
|
|
||||||
// handle control tracking
|
// handle control tracking
|
||||||
virtual void HotSpotAction(short /* inHotSpot */, Boolean inCurrInside, Boolean inPrevInside) ;
|
virtual void HotSpotAction(short /* inHotSpot */, Boolean inCurrInside, Boolean inPrevInside) ;
|
||||||
|
virtual void DoneTracking ( SInt16 inHotSpot, Boolean /* inGoodTrack */) ;
|
||||||
|
|
||||||
bool IsMouseInFrame ( ) const { return mMouseInFrame; } ;
|
bool IsMouseInFrame ( ) const { return mMouseInFrame; } ;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче