mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
Added support to move Tabs from one UITabWidget to another using the onDrop API.
This commit is contained in:
@@ -52,6 +52,7 @@ class EE_API Event {
|
||||
MsgBoxConfirmClick,
|
||||
MsgBoxCancelClick,
|
||||
OnTabSelected,
|
||||
OnTabAdded,
|
||||
OnTabClosed,
|
||||
OnTabNavigate,
|
||||
OnClose, // Warning: Only some nodes will report this event.
|
||||
|
||||
@@ -371,7 +371,7 @@ class EE_API Node : public Transformable {
|
||||
|
||||
bool isChild( Node* child ) const;
|
||||
|
||||
bool inParentTreeOf( Node* Child ) const;
|
||||
bool inParentTreeOf( Node* child ) const;
|
||||
|
||||
void setLoadingState( bool loading );
|
||||
|
||||
|
||||
@@ -190,6 +190,7 @@ enum class PropertyId : Uint32 {
|
||||
BorderBottomRightRadius = String::hash( "border-bottom-right-radius" ),
|
||||
TabBarHideOnSingleTab = String::hash( "tabbar-hide-on-single-tab" ),
|
||||
TabBarAllowRearrange = String::hash( "tabbar-allow-rearrange" ),
|
||||
TabBarAllowDragAndDrop = String::hash( "tabbar-allow-drag-and-drop-tabs" ),
|
||||
};
|
||||
|
||||
enum class PropertyType : Uint32 {
|
||||
|
||||
@@ -43,6 +43,8 @@ class EE_API UITab : public UISelectButton {
|
||||
String mText;
|
||||
std::string mOwnedName;
|
||||
UIWidget* mCloseButton;
|
||||
Float mDragTotalDiff;
|
||||
UITabWidget* mTabWidget;
|
||||
|
||||
Uint32 onDrag( const Vector2f& position, const Uint32& flags, const Sizef& dragDiff );
|
||||
|
||||
|
||||
@@ -141,6 +141,14 @@ class EE_API UITabWidget : public UIWidget {
|
||||
|
||||
void setAllowRearrangeTabs( bool allowRearrangeTabs );
|
||||
|
||||
bool getAllowDragAndDropTabs() const;
|
||||
|
||||
void setAllowDragAndDropTabs( bool allowDragAndDropTabs );
|
||||
|
||||
const Float& getTabVerticalDragResistance() const;
|
||||
|
||||
void setTabVerticalDragResistance( const Float& tabVerticalDragResistance );
|
||||
|
||||
protected:
|
||||
friend class UITab;
|
||||
|
||||
@@ -153,17 +161,25 @@ class EE_API UITabWidget : public UIWidget {
|
||||
TabTryCloseCallback mTabTryCloseCallback;
|
||||
bool mHideTabBarOnSingleTab;
|
||||
bool mAllowRearrangeTabs;
|
||||
bool mAllowDragAndDropTabs;
|
||||
Float mTabVerticalDragResistance;
|
||||
|
||||
void onThemeLoaded();
|
||||
|
||||
UITab* createTab( const String& text, UINode* nodeOwned, Drawable* icon );
|
||||
|
||||
void removeTab( const Uint32& index, bool destroyOwnedNode, bool destroyTab = true );
|
||||
|
||||
void removeTab( UITab* tab, bool destroyOwnedNode, bool destroyTab );
|
||||
|
||||
virtual void onSizeChange();
|
||||
|
||||
virtual void onChildCountChange( Node* child, const bool& removed );
|
||||
|
||||
virtual void onPaddingChange();
|
||||
|
||||
virtual Uint32 onMessage( const NodeMessage* msg );
|
||||
|
||||
void setContainerSize();
|
||||
|
||||
void posTabs();
|
||||
|
||||
Reference in New Issue
Block a user