mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-09-30 18:20:19 +03:00
Fix Event::OnFocusWithin and Event::OnFocusWithinLoss not being correctly emited.
This commit is contained in:
@@ -1346,7 +1346,7 @@ void UINode::pushState( const Uint32& State, bool emitEvent ) {
|
||||
if ( emitEvent ) {
|
||||
onStateChange();
|
||||
|
||||
if ( State & UIState::StateFocusWithin )
|
||||
if ( mState & UIState::StateFlagFocusWithin )
|
||||
sendCommonEvent( Event::OnFocusWithin );
|
||||
} else {
|
||||
invalidateDraw();
|
||||
@@ -1364,7 +1364,7 @@ void UINode::popState( const Uint32& State, bool emitEvent ) {
|
||||
if ( emitEvent ) {
|
||||
onStateChange();
|
||||
|
||||
if ( State & UIState::StateFocusWithin )
|
||||
if ( mState & UIState::StateFlagFocusWithin )
|
||||
sendCommonEvent( Event::OnFocusWithinLoss );
|
||||
} else {
|
||||
invalidateDraw();
|
||||
|
||||
@@ -1314,9 +1314,6 @@ void UIWidget::pushState( const Uint32& State, bool emitEvent ) {
|
||||
|
||||
if ( emitEvent ) {
|
||||
onStateChange();
|
||||
|
||||
if ( State & UIState::StateFocusWithin )
|
||||
sendCommonEvent( Event::OnFocusWithin );
|
||||
} else {
|
||||
invalidateDraw();
|
||||
}
|
||||
@@ -1339,9 +1336,6 @@ void UIWidget::popState( const Uint32& State, bool emitEvent ) {
|
||||
|
||||
if ( emitEvent ) {
|
||||
onStateChange();
|
||||
|
||||
if ( State & UIState::StateFocusWithin )
|
||||
sendCommonEvent( Event::OnFocusWithinLoss );
|
||||
} else {
|
||||
invalidateDraw();
|
||||
}
|
||||
@@ -1350,11 +1344,14 @@ void UIWidget::popState( const Uint32& State, bool emitEvent ) {
|
||||
|
||||
Uint32 UIWidget::onFocus( NodeFocusReason reason ) {
|
||||
pushState( UIState::StateFocusWithin );
|
||||
sendCommonEvent( Event::OnFocusWithin );
|
||||
|
||||
Node* parent = mParentNode;
|
||||
while ( parent ) {
|
||||
if ( parent->isUINode() )
|
||||
if ( parent->isUINode() ) {
|
||||
parent->asType<UINode>()->pushState( UIState::StateFocusWithin );
|
||||
parent->asType<UINode>()->sendCommonEvent( Event::OnFocusWithin );
|
||||
}
|
||||
parent = parent->getParent();
|
||||
}
|
||||
|
||||
@@ -1363,11 +1360,14 @@ Uint32 UIWidget::onFocus( NodeFocusReason reason ) {
|
||||
|
||||
Uint32 UIWidget::onFocusLoss() {
|
||||
popState( UIState::StateFocusWithin );
|
||||
sendCommonEvent( Event::OnFocusWithinLoss );
|
||||
|
||||
Node* parent = mParentNode;
|
||||
while ( parent ) {
|
||||
if ( parent->isUINode() )
|
||||
if ( parent->isUINode() ) {
|
||||
parent->asType<UINode>()->popState( UIState::StateFocusWithin );
|
||||
parent->asType<UINode>()->sendCommonEvent( Event::OnFocusWithinLoss );
|
||||
}
|
||||
parent = parent->getParent();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user