mirror of https://github.com/axmolengine/axmol.git
refactor Layout and Widget
This commit is contained in:
parent
02e2957bf6
commit
df13d4033c
|
@ -932,7 +932,7 @@ void Layout::requestDoLayout()
|
||||||
_doLayoutDirty = true;
|
_doLayoutDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Size Layout::getLayoutContentSize()const
|
Size Layout::getLayoutContentSize()const
|
||||||
{
|
{
|
||||||
return this->getSize();
|
return this->getSize();
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ public:
|
||||||
virtual ~LayoutProtocol(){}
|
virtual ~LayoutProtocol(){}
|
||||||
|
|
||||||
virtual LayoutExecutant* createLayoutExecutant() = 0;
|
virtual LayoutExecutant* createLayoutExecutant() = 0;
|
||||||
virtual const Size getLayoutContentSize()const = 0;
|
virtual Size getLayoutContentSize()const = 0;
|
||||||
virtual const Vector<Node*>& getLayoutElements()const = 0;
|
virtual const Vector<Node*>& getLayoutElements()const = 0;
|
||||||
virtual void doLayout() = 0;
|
virtual void doLayout() = 0;
|
||||||
};
|
};
|
||||||
|
@ -329,7 +329,7 @@ protected:
|
||||||
|
|
||||||
virtual void doLayout()override;
|
virtual void doLayout()override;
|
||||||
virtual LayoutExecutant* createLayoutExecutant()override;
|
virtual LayoutExecutant* createLayoutExecutant()override;
|
||||||
virtual const Size getLayoutContentSize()const override;
|
virtual Size getLayoutContentSize()const override;
|
||||||
virtual const Vector<Node*>& getLayoutElements()const override;
|
virtual const Vector<Node*>& getLayoutElements()const override;
|
||||||
|
|
||||||
//clipping
|
//clipping
|
||||||
|
|
|
@ -596,6 +596,10 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget* getCurrentFocusedWidget()const;
|
Widget* getCurrentFocusedWidget()const;
|
||||||
|
/*
|
||||||
|
* call this method with parameter true to enable the Android Dpad focus navigation feature
|
||||||
|
*@param enable set true to enable dpad focus navigation, otherwise disenable dpad focus navigation
|
||||||
|
*/
|
||||||
static void enableDpadNavigation(bool enable);
|
static void enableDpadNavigation(bool enable);
|
||||||
|
|
||||||
std::function<void(Widget*,Widget*)> onFocusChanged;
|
std::function<void(Widget*,Widget*)> onFocusChanged;
|
||||||
|
|
Loading…
Reference in New Issue