Minor fixes.

--HG--
branch : dev-scene
This commit is contained in:
Martín Lucas Golini
2018-02-02 00:00:11 -03:00
parent 8646a79472
commit d08be0ef41
6 changed files with 8 additions and 6 deletions

View File

@@ -30,7 +30,8 @@ enum NODE_FLAGS_VALUES {
NODE_FLAG_WIDGET = (1<<22),
NODE_FLAG_WINDOW = (1<<23),
NODE_FLAG_REPORT_SIZE_CHANGE_TO_CHILDS = (1<<24),
NODE_FLAG_FREE_USE = (1<<25)
NODE_FLAG_OVER_FIND_ALLOWED = (1<<25),
NODE_FLAG_FREE_USE = (1<<26)
};
#define UI_HALIGN_LEFT TEXT_ALIGN_LEFT

View File

@@ -182,6 +182,7 @@ class EE_API UIManager {
Color mHighlightInvalidationColor;
Vector2f mMousePos;
Vector2i mMousePosi;
Vector2f mLastMousePos;
Vector2i mMouseDownPos;
bool mInit;

View File

@@ -729,7 +729,7 @@ Node * Node::getLastChild() const {
Node * Node::overFind( const Vector2f& Point ) {
Node * pOver = NULL;
if ( mEnabled && mVisible ) {
if ( ( mNodeFlags & NODE_FLAG_OVER_FIND_ALLOWED ) && mEnabled && mVisible ) {
updateWorldPolygon();
if ( mWorldBounds.contains( Point ) && mPoly.pointInside( Point ) ) {

View File

@@ -255,7 +255,7 @@ void UIManager::update( const Time& elapsed ) {
if ( mInput->getReleaseTrigger() ) {
if ( NULL != mFocusControl ) {
if ( !wasDraggingControl ) {
if ( !wasDraggingControl || mMousePos == mLastMousePos ) {
if ( mOverControl != mFocusControl )
setFocusControl( mOverControl );
@@ -281,6 +281,8 @@ void UIManager::update( const Time& elapsed ) {
mFirstPress = false;
}
mLastMousePos = mMousePos;
checkClose();
}

View File

@@ -30,7 +30,7 @@ UINode::UINode() :
mBorder( NULL ),
mDragButton( EE_BUTTON_LMASK )
{
mNodeFlags |= NODE_FLAG_UINODE;
mNodeFlags |= NODE_FLAG_UINODE | NODE_FLAG_OVER_FIND_ALLOWED;
}
UINode::~UINode() {

View File

@@ -70,7 +70,6 @@ void UITooltip::show() {
toFront();
setVisible( true );
setEnabled( true );
if ( UIThemeManager::instance()->getDefaultEffectsEnabled() ) {
startAlphaAnim( 255.f == mAlpha ? 0.f : mAlpha, 255.f, UIThemeManager::instance()->getControlsFadeInTime() );
@@ -84,7 +83,6 @@ void UITooltip::hide() {
disableFadeOut( UIThemeManager::instance()->getControlsFadeOutTime() );
} else {
setVisible( false );
setEnabled( false );
}
}
}