[DEBUG] pb on focus for the fileChooser pop-up
This commit is contained in:
parent
7a1293c541
commit
9ae39eda36
2
external/etk
vendored
2
external/etk
vendored
@ -1 +1 @@
|
||||
Subproject commit 6bb7f2e911a42e62839a8c2795d0196490c0e088
|
||||
Subproject commit cfc4d435b433fba9414330815b29e26cfe82927d
|
@ -77,43 +77,45 @@ ewol::widget::Manager::~Manager() {
|
||||
* *************************************************************************/
|
||||
|
||||
void ewol::widget::Manager::focusKeep(const ewol::object::Shared<ewol::Widget>& _newWidget) {
|
||||
if (nullptr == _newWidget) {
|
||||
if (_newWidget == nullptr) {
|
||||
// nothing to do ...
|
||||
return;
|
||||
}
|
||||
EWOL_VERBOSE("focusKeep=" << _newWidget->getId() );
|
||||
//etk::log::displayBacktrace();
|
||||
if (_newWidget == m_focusWidgetCurrent) {
|
||||
// nothing to do ...
|
||||
return;
|
||||
}
|
||||
if (nullptr != m_focusWidgetCurrent) {
|
||||
if (m_focusWidgetCurrent != nullptr) {
|
||||
EWOL_DEBUG("Rm focus on WidgetID=" << m_focusWidgetCurrent->getId() );
|
||||
m_focusWidgetCurrent->rmFocus();
|
||||
m_focusWidgetCurrent = nullptr;
|
||||
}
|
||||
if (false == _newWidget->canHaveFocus()) {
|
||||
EWOL_VERBOSE("Widget can not have focus, id=" << _newWidget->getId() );
|
||||
if (_newWidget->canHaveFocus() == false) {
|
||||
EWOL_DEBUG("Widget can not have focus, id=" << _newWidget->getId() );
|
||||
return;
|
||||
}
|
||||
m_focusWidgetCurrent = _newWidget;
|
||||
if (nullptr != m_focusWidgetCurrent) {
|
||||
if (m_focusWidgetCurrent != nullptr) {
|
||||
EWOL_DEBUG("Set focus on WidgetID=" << m_focusWidgetCurrent->getId() );
|
||||
m_focusWidgetCurrent->setFocus();
|
||||
}
|
||||
}
|
||||
|
||||
void ewol::widget::Manager::focusSetDefault(const ewol::object::Shared<ewol::Widget>& _newWidget) {
|
||||
if( nullptr != _newWidget
|
||||
&& false == _newWidget->canHaveFocus() ) {
|
||||
if( _newWidget != nullptr
|
||||
&& _newWidget->canHaveFocus() == false) {
|
||||
EWOL_VERBOSE("Widget can not have focus, id=" << _newWidget->getId() );
|
||||
return;
|
||||
}
|
||||
if (m_focusWidgetDefault == m_focusWidgetCurrent) {
|
||||
if (nullptr != m_focusWidgetCurrent) {
|
||||
if (m_focusWidgetCurrent != nullptr) {
|
||||
EWOL_DEBUG("Rm focus on WidgetID=" << m_focusWidgetCurrent->getId() );
|
||||
m_focusWidgetCurrent->rmFocus();
|
||||
}
|
||||
m_focusWidgetCurrent = _newWidget;
|
||||
if (nullptr != m_focusWidgetCurrent) {
|
||||
if (m_focusWidgetCurrent != nullptr) {
|
||||
EWOL_DEBUG("Set focus on WidgetID=" << m_focusWidgetCurrent->getId() );
|
||||
m_focusWidgetCurrent->setFocus();
|
||||
}
|
||||
@ -126,7 +128,7 @@ void ewol::widget::Manager::focusRelease() {
|
||||
// nothink to do ...
|
||||
return;
|
||||
}
|
||||
if (nullptr != m_focusWidgetCurrent) {
|
||||
if (m_focusWidgetCurrent != nullptr) {
|
||||
EWOL_DEBUG("Rm focus on WidgetID=" << m_focusWidgetCurrent->getId() );
|
||||
m_focusWidgetCurrent->rmFocus();
|
||||
}
|
||||
|
@ -116,8 +116,13 @@ ewol::widget::FileChooser::FileChooser() {
|
||||
registerOnEventNameWidget("[" + std::to_string(getId()) + "]file-shooser:img-home", "pressed", ewolEventFileChooserHome);
|
||||
// set the default Folder properties:
|
||||
updateCurrentFolder();
|
||||
setCanHaveFocus(true);
|
||||
}
|
||||
|
||||
void ewol::widget::FileChooser::onGetFocus() {
|
||||
// transfert focus on a specific widget...
|
||||
setConfigNamed("[" + std::to_string(getId()) + "]file-shooser:entry-file", "focus", "true");
|
||||
}
|
||||
|
||||
ewol::widget::FileChooser::~FileChooser() {
|
||||
|
||||
|
@ -93,6 +93,7 @@ namespace ewol {
|
||||
void updateCurrentFolder();
|
||||
public: // Derived function
|
||||
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
||||
virtual void onGetFocus();
|
||||
};
|
||||
};
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user