fix crash and focus bug
This commit is contained in:
parent
20e32ad2a0
commit
c13a5b5dab
|
@ -1,5 +1,4 @@
|
|||
-- this file is loaded after all modules are loaded and initialized
|
||||
-- you can place any custom user code here
|
||||
-- you
|
||||
|
||||
Keyboard.bindKeyDown('Ctrl+R', Client.reloadScripts)
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "texturemanager.h"
|
||||
#include "animatedtexture.h"
|
||||
#include "graphics.h"
|
||||
|
||||
#include <framework/core/resourcemanager.h>
|
||||
#include <framework/thirdparty/apngloader.h>
|
||||
|
@ -54,6 +55,7 @@ TexturePtr TextureManager::getTexture(const std::string& textureFile)
|
|||
texture = loadPNG(fin);
|
||||
} catch(Exception& e) {
|
||||
logError("unable to load texture '", textureFile, "': ", e.what());
|
||||
texture = g_graphics.getEmptyTexture();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -245,7 +245,7 @@ void UIWidget::focusChild(const UIWidgetPtr& child, Fw::FocusReason reason)
|
|||
child->updateState(Fw::FocusState);
|
||||
child->updateState(Fw::ActiveState);
|
||||
|
||||
g_eventDispatcher.addEvent(std::bind(&UIWidget::onFocusChange, child, true, reason));
|
||||
child->onFocusChange(true, reason);
|
||||
}
|
||||
|
||||
if(oldFocused) {
|
||||
|
@ -253,7 +253,7 @@ void UIWidget::focusChild(const UIWidgetPtr& child, Fw::FocusReason reason)
|
|||
oldFocused->updateState(Fw::FocusState);
|
||||
oldFocused->updateState(Fw::ActiveState);
|
||||
|
||||
g_eventDispatcher.addEvent(std::bind(&UIWidget::onFocusChange, oldFocused, false, reason));
|
||||
oldFocused->onFocusChange(false, reason);
|
||||
}
|
||||
|
||||
onChildFocusChange(child, oldFocused, reason);
|
||||
|
|
Loading…
Reference in New Issue