diff --git a/modules/editor/grapheditor/editor/graph/graphwidgets/nodewidget.cpp b/modules/editor/grapheditor/editor/graph/graphwidgets/nodewidget.cpp index 45a09062d..953372fe9 100644 --- a/modules/editor/grapheditor/editor/graph/graphwidgets/nodewidget.cpp +++ b/modules/editor/grapheditor/editor/graph/graphwidgets/nodewidget.cpp @@ -223,7 +223,7 @@ void NodeWidget::composePort(NodePort &port) { } } else { m_callLayout = new Layout; - m_callLayout->setDirection(Layout::Horizontal); + m_callLayout->setOrientation(Widget::Horizontal); m_callLayout->addTransform(portRect); layout->addLayout(m_callLayout); } diff --git a/modules/editor/texturetools/editor/actions/createsprite.cpp b/modules/editor/texturetools/editor/actions/createsprite.cpp new file mode 100644 index 000000000..5bf9801c8 --- /dev/null +++ b/modules/editor/texturetools/editor/actions/createsprite.cpp @@ -0,0 +1,24 @@ +#include "createsprite.h" + +CreateSprite::CreateSprite(const TextureImportSettings::Element &element, SpriteController *ctrl, UndoCommand *group) : + UndoCommand(QObject::tr("Create Sprite Element").toStdString(), group), + m_element(element), + m_controller(ctrl) { +} + +void CreateSprite::undo() { + TextureImportSettings *settings = m_controller->settings(); + if(settings) { + settings->removeElement(m_uuid); + m_controller->selectElement(m_key); + } +} + +void CreateSprite::redo() { + TextureImportSettings *settings = m_controller->settings(); + if(settings) { + m_uuid = settings->setElement(m_element, ""); + m_key = m_controller->selectedElement(); + m_controller->selectElement({m_uuid}); + } +} diff --git a/modules/editor/texturetools/editor/actions/createsprite.h b/modules/editor/texturetools/editor/actions/createsprite.h new file mode 100644 index 000000000..97fb50909 --- /dev/null +++ b/modules/editor/texturetools/editor/actions/createsprite.h @@ -0,0 +1,25 @@ +#ifndef CREATESPRITE_H +#define CREATESPRITE_H + +#include +#include "../spritecontroller.h" + +class SpriteController; + +class CreateSprite : public UndoCommand { +public: + CreateSprite(const TextureImportSettings::Element &element, SpriteController *ctrl, UndoCommand *group = nullptr); + void undo() override; + void redo() override; + +protected: + TextureImportSettings::Element m_element; + + TString m_uuid; + TString m_key; + + SpriteController *m_controller; + +}; + +#endif // CREATESPRITE_H diff --git a/modules/editor/texturetools/editor/actions/destroysprite.cpp b/modules/editor/texturetools/editor/actions/destroysprite.cpp new file mode 100644 index 000000000..fe491792e --- /dev/null +++ b/modules/editor/texturetools/editor/actions/destroysprite.cpp @@ -0,0 +1,27 @@ +#include "destroysprite.h" + +DestroySprite::DestroySprite(SpriteController *ctrl, UndoCommand *group) : + UndoCommand(QObject::tr("Destroy Sprite Element").toStdString(), group), + m_key(ctrl->selectedElement()), + m_controller(ctrl) { +} +void DestroySprite::undo() { + TextureImportSettings *settings = m_controller->settings(); + if(settings) { + settings->setElement(m_element, m_key); + + m_controller->selectElement(m_key); + } +} +void DestroySprite::redo() { + TextureImportSettings *settings = m_controller->settings(); + if(settings) { + auto element = settings->elements().find(m_key); + if(element != settings->elements().end()) { + m_element = element->second; + } + settings->removeElement(m_key); + + m_controller->selectElement({}); + } +} diff --git a/modules/editor/texturetools/editor/actions/destroysprite.h b/modules/editor/texturetools/editor/actions/destroysprite.h new file mode 100644 index 000000000..9eaa49cbf --- /dev/null +++ b/modules/editor/texturetools/editor/actions/destroysprite.h @@ -0,0 +1,22 @@ +#ifndef DESTROYSPRITE_H +#define DESTROYSPRITE_H + +#include +#include "../spritecontroller.h" + +class DestroySprite : public UndoCommand { +public: + DestroySprite(SpriteController *ctrl, UndoCommand *group = nullptr); + void undo() override; + void redo() override; + +protected: + TString m_key; + + TextureImportSettings::Element m_element; + + SpriteController *m_controller; + +}; + +#endif // DESTROYSPRITE_H diff --git a/modules/editor/texturetools/editor/actions/renamesprite.cpp b/modules/editor/texturetools/editor/actions/renamesprite.cpp new file mode 100644 index 000000000..d4c81f020 --- /dev/null +++ b/modules/editor/texturetools/editor/actions/renamesprite.cpp @@ -0,0 +1,30 @@ +#include "renamesprite.h" + +#include "../spritecontroller.h" + +RenameSprite::RenameSprite(const TString &oldKey, const TString &newKey, SpriteController *ctrl, UndoCommand *group) : + UndoCommand(QObject::tr("Rename Sprite Element").toStdString(), group), + m_oldKey(oldKey), + m_newKey(newKey), + m_controller(ctrl) { +} + +void RenameSprite::undo() { + redo(); +} + +void RenameSprite::redo() { + TextureImportSettings *settings = m_controller->settings(); + if(settings) { + auto element = settings->elements().find(m_oldKey); + if(element != settings->elements().end()) { + TextureImportSettings::Element temp = element->second; + settings->removeElement(m_oldKey); + settings->setElement(temp, m_newKey); + + m_controller->selectElement(m_newKey); + + std::swap(m_oldKey, m_newKey); + } + } +} diff --git a/modules/editor/texturetools/editor/actions/renamesprite.h b/modules/editor/texturetools/editor/actions/renamesprite.h new file mode 100644 index 000000000..ea43bb52f --- /dev/null +++ b/modules/editor/texturetools/editor/actions/renamesprite.h @@ -0,0 +1,22 @@ +#ifndef RENAMESPRITE_H +#define RENAMESPRITE_H + +#include + +class SpriteController; + +class RenameSprite : public UndoCommand { +public: + RenameSprite(const TString &oldKey, const TString &newKey, SpriteController *ctrl, UndoCommand *group = nullptr); + void undo() override; + void redo() override; + +protected: + TString m_newKey; + TString m_oldKey; + + SpriteController *m_controller; + +}; + +#endif // RENAMESPRITE_H diff --git a/modules/editor/texturetools/editor/actions/selectsprite.cpp b/modules/editor/texturetools/editor/actions/selectsprite.cpp new file mode 100644 index 000000000..7df3e99cf --- /dev/null +++ b/modules/editor/texturetools/editor/actions/selectsprite.cpp @@ -0,0 +1,19 @@ +#include "selectsprite.h" + +#include "../spritecontroller.h" + +SelectSprite::SelectSprite(const TString &key, SpriteController *ctrl, UndoCommand *group) : + UndoCommand(QObject::tr("Select Sprite Elements").toStdString(), group), + m_key(key), + m_controller(ctrl) { +} + +void SelectSprite::undo() { + redo(); +} + +void SelectSprite::redo() { + TString temp = m_controller->selectedElement(); + m_controller->selectElement(m_key); + m_key = temp; +} diff --git a/modules/editor/texturetools/editor/actions/selectsprite.h b/modules/editor/texturetools/editor/actions/selectsprite.h new file mode 100644 index 000000000..58b5ad220 --- /dev/null +++ b/modules/editor/texturetools/editor/actions/selectsprite.h @@ -0,0 +1,21 @@ +#ifndef SELECTSPRITE_H +#define SELECTSPRITE_H + +#include + +class SpriteController; + +class SelectSprite : public UndoCommand { +public: + SelectSprite(const TString &key, SpriteController *ctrl, UndoCommand *group = nullptr); + void undo() override; + void redo() override; + +protected: + TString m_key; + + SpriteController *m_controller; + +}; + +#endif // SELECTSPRITE_H diff --git a/modules/editor/texturetools/editor/actions/updatesprite.cpp b/modules/editor/texturetools/editor/actions/updatesprite.cpp new file mode 100644 index 000000000..511330cd4 --- /dev/null +++ b/modules/editor/texturetools/editor/actions/updatesprite.cpp @@ -0,0 +1,27 @@ +#include "updatesprite.h" + +UpdateSprite::UpdateSprite(const TextureImportSettings::Element &element, SpriteController *ctrl, UndoCommand *group) : + UndoCommand(QObject::tr("Update Sprite Element").toStdString(), group), + m_key(ctrl->selectedElement()), + m_element(element), + m_controller(ctrl) { +} + +void UpdateSprite::undo() { + redo(); +} + +void UpdateSprite::redo() { + TextureImportSettings *settings = m_controller->settings(); + if(settings) { + auto element = settings->elements().find(m_key); + if(element != settings->elements().end()) { + TextureImportSettings::Element temp = element->second; + settings->setElement(m_element, m_key); + m_element = temp; + + m_controller->selectElement(m_key); + m_controller->updated(); + } + } +} diff --git a/modules/editor/texturetools/editor/actions/updatesprite.h b/modules/editor/texturetools/editor/actions/updatesprite.h new file mode 100644 index 000000000..49ba95ff6 --- /dev/null +++ b/modules/editor/texturetools/editor/actions/updatesprite.h @@ -0,0 +1,22 @@ +#ifndef UPDATESPRITE_H +#define UPDATESPRITE_H + +#include +#include "../spritecontroller.h" + +class UpdateSprite : public UndoCommand { +public: + UpdateSprite(const TextureImportSettings::Element &element, SpriteController *ctrl, UndoCommand *group = nullptr); + void undo() override; + void redo() override; + +protected: + TString m_key; + + TextureImportSettings::Element m_element; + + SpriteController *m_controller; + +}; + +#endif // UPDATESPRITE_H diff --git a/modules/editor/texturetools/editor/spritecontroller.cpp b/modules/editor/texturetools/editor/spritecontroller.cpp index 802d1fe78..8f430630b 100644 --- a/modules/editor/texturetools/editor/spritecontroller.cpp +++ b/modules/editor/texturetools/editor/spritecontroller.cpp @@ -1,7 +1,5 @@ #include "spritecontroller.h" -#include - #include #include #include @@ -33,13 +31,6 @@ void SpriteController::setSettings(TextureImportSettings *settings) { void SpriteController::setSize(uint32_t width, uint32_t height) { m_width = width; m_height = height; - - Camera *cam = camera(); - if(cam) { - cam->transform()->setPosition(Vector3(m_width * 0.5f, m_height * 0.5f, 1.0f)); - cam->setOrthoSize(MAX(m_width, m_height)); - cam->setFocalDistance(m_height); - } } bool SpriteController::isSelected(const TString &key) const { @@ -78,108 +69,3 @@ void SpriteController::drawHandles() { m_spriteTool->update(false, true, Input::isKey(Input::KEY_LEFT_CONTROL)); } - -SelectSprite::SelectSprite(const TString &key, SpriteController *ctrl, UndoCommand *group) : - UndoSprite(ctrl, QObject::tr("Select Sprite Elements").toStdString(), group), - m_key(key) { -} -void SelectSprite::undo() { - redo(); -} -void SelectSprite::redo() { - TString temp = m_controller->selectedElement(); - m_controller->selectElement(m_key); - m_key = temp; -} - -CreateSprite::CreateSprite(const TextureImportSettings::Element &element, SpriteController *ctrl, UndoCommand *group) : - UndoSprite(ctrl, QObject::tr("Create Sprite Element").toStdString(), group), - m_element(element) { -} -void CreateSprite::undo() { - TextureImportSettings *settings = m_controller->settings(); - if(settings) { - settings->removeElement(m_uuid); - m_controller->selectElement(m_key); - } -} -void CreateSprite::redo() { - TextureImportSettings *settings = m_controller->settings(); - if(settings) { - m_uuid = settings->setElement(m_element, ""); - m_key = m_controller->selectedElement(); - m_controller->selectElement({m_uuid}); - } -} - -DestroySprite::DestroySprite(SpriteController *ctrl, UndoCommand *group) : - UndoSprite(ctrl, QObject::tr("Destroy Sprite Element").toStdString(), group), - m_key(ctrl->selectedElement()) { -} -void DestroySprite::undo() { - TextureImportSettings *settings = m_controller->settings(); - if(settings) { - settings->setElement(m_element, m_key); - - m_controller->selectElement(m_key); - } -} -void DestroySprite::redo() { - TextureImportSettings *settings = m_controller->settings(); - if(settings) { - auto element = settings->elements().find(m_key); - if(element != settings->elements().end()) { - m_element = element->second; - } - settings->removeElement(m_key); - - m_controller->selectElement({}); - } -} - -UpdateSprite::UpdateSprite(const TextureImportSettings::Element &element, SpriteController *ctrl, UndoCommand *group) : - UndoSprite(ctrl, QObject::tr("Update Sprite Element").toStdString(), group), - m_key(ctrl->selectedElement()), - m_element(element) { -} -void UpdateSprite::undo() { - redo(); -} -void UpdateSprite::redo() { - TextureImportSettings *settings = m_controller->settings(); - if(settings) { - auto element = settings->elements().find(m_key); - if(element != settings->elements().end()) { - TextureImportSettings::Element temp = element->second; - settings->setElement(m_element, m_key); - m_element = temp; - - m_controller->selectElement(m_key); - m_controller->updated(); - } - } -} - -RenameSprite::RenameSprite(const TString &oldKey, const TString &newKey, SpriteController *ctrl, UndoCommand *group) : - UndoSprite(ctrl, QObject::tr("Rename Sprite Element").toStdString(), group), - m_oldKey(oldKey), - m_newKey(newKey) { -} -void RenameSprite::undo() { - redo(); -} -void RenameSprite::redo() { - TextureImportSettings *settings = m_controller->settings(); - if(settings) { - auto element = settings->elements().find(m_oldKey); - if(element != settings->elements().end()) { - TextureImportSettings::Element temp = element->second; - settings->removeElement(m_oldKey); - settings->setElement(temp, m_newKey); - - m_controller->selectElement(m_newKey); - - std::swap(m_oldKey, m_newKey); - } - } -} diff --git a/modules/editor/texturetools/editor/spritecontroller.h b/modules/editor/texturetools/editor/spritecontroller.h index e4c80a17b..2c91881c7 100644 --- a/modules/editor/texturetools/editor/spritecontroller.h +++ b/modules/editor/texturetools/editor/spritecontroller.h @@ -1,7 +1,6 @@ #ifndef SPRITECONTROLLER_H #define SPRITECONTROLLER_H -#include #include #include "../converter/textureconverter.h" @@ -59,79 +58,5 @@ class SpriteController : public CameraController { bool m_drag; }; -class UndoSprite : public UndoCommand { -public: - UndoSprite(SpriteController *ctrl, const TString &text, UndoCommand *parent = nullptr) : - UndoCommand(text, parent), - m_controller(ctrl) { - - } - -protected: - SpriteController *m_controller; - -}; - -class SelectSprite : public UndoSprite { -public: - SelectSprite(const TString &key, SpriteController *ctrl, UndoCommand *group = nullptr); - void undo() override; - void redo() override; - -protected: - TString m_key; - -}; - -class CreateSprite : public UndoSprite { -public: - CreateSprite(const TextureImportSettings::Element &element, SpriteController *ctrl, UndoCommand *group = nullptr); - void undo() override; - void redo() override; - -protected: - TextureImportSettings::Element m_element; - - TString m_uuid; - TString m_key; - -}; - -class DestroySprite : public UndoSprite { -public: - DestroySprite(SpriteController *ctrl, UndoCommand *group = nullptr); - void undo() override; - void redo() override; - -protected: - TString m_key; - - TextureImportSettings::Element m_element; - -}; - -class UpdateSprite : public UndoSprite { -public: - UpdateSprite(const TextureImportSettings::Element &element, SpriteController *ctrl, UndoCommand *group = nullptr); - void undo() override; - void redo() override; - -protected: - TString m_key; - - TextureImportSettings::Element m_element; - -}; - -class RenameSprite : public UndoSprite { -public: - RenameSprite(const TString &oldKey, const TString &newKey, SpriteController *ctrl, UndoCommand *group = nullptr); - void undo() override; - void redo() override; - -protected: - TString m_newKey; - TString m_oldKey; -}; #endif // SPRITECONTROLLER_H diff --git a/modules/editor/texturetools/editor/spriteedit.cpp b/modules/editor/texturetools/editor/spriteedit.cpp index 1018100ef..c5bcd5164 100644 --- a/modules/editor/texturetools/editor/spriteedit.cpp +++ b/modules/editor/texturetools/editor/spriteedit.cpp @@ -132,6 +132,9 @@ void SpriteEdit::loadAsset(AssetConverterSettings *settings) { m_controller->setSettings(dynamic_cast(m_settings.front())); m_controller->setSize(size.x, size.y); + + float bottom; + m_controller->setFocusOn(m_render->actor(), bottom); } } diff --git a/modules/editor/texturetools/editor/spriteedit.h b/modules/editor/texturetools/editor/spriteedit.h index 0c4843d8e..54c3adcd4 100644 --- a/modules/editor/texturetools/editor/spriteedit.h +++ b/modules/editor/texturetools/editor/spriteedit.h @@ -25,6 +25,8 @@ class SpriteEdit : public AssetEditor { void onUpdateTemplate(); + + private: void loadAsset(AssetConverterSettings *settings) override; void saveAsset(const TString &) override; diff --git a/modules/editor/texturetools/editor/spriteelement.cpp b/modules/editor/texturetools/editor/spriteelement.cpp index 8131fb8ca..846ad7d8d 100644 --- a/modules/editor/texturetools/editor/spriteelement.cpp +++ b/modules/editor/texturetools/editor/spriteelement.cpp @@ -2,6 +2,9 @@ #include "spritecontroller.h" +#include "actions/renamesprite.h" +#include "actions/updatesprite.h" + SpriteElement::SpriteElement() : m_controller(nullptr), m_settings(nullptr) { diff --git a/modules/editor/texturetools/editor/tools/spritetool.cpp b/modules/editor/texturetools/editor/tools/spritetool.cpp index 949f7e9b0..16a880e9a 100644 --- a/modules/editor/texturetools/editor/tools/spritetool.cpp +++ b/modules/editor/texturetools/editor/tools/spritetool.cpp @@ -13,6 +13,10 @@ #include #include "../spritecontroller.h" +#include "../actions/selectsprite.h" +#include "../actions/updatesprite.h" +#include "../actions/createsprite.h" +#include "../actions/destroysprite.h" SpriteTool::SpriteTool(SpriteController *controller) : m_controller(controller), diff --git a/modules/uikit/includes/components/abstractbutton.h b/modules/uikit/includes/components/abstractbutton.h index a5af406b1..7c85c07a7 100644 --- a/modules/uikit/includes/components/abstractbutton.h +++ b/modules/uikit/includes/components/abstractbutton.h @@ -2,10 +2,9 @@ #define ABSTRACTBUTTON_H #include "widget.h" - -class Image; -class Frame; -class Label; +#include "frame.h" +#include "label.h" +#include "image.h" class UIKIT_EXPORT AbstractButton : public Widget { A_OBJECT(AbstractButton, Widget, General) @@ -25,6 +24,7 @@ class UIKIT_EXPORT AbstractButton : public Widget { A_SIGNAL(AbstractButton::clicked), A_SIGNAL(AbstractButton::toggled) ) + A_NOENUMS() public: AbstractButton(); diff --git a/modules/uikit/includes/components/button.h b/modules/uikit/includes/components/button.h index c734e9ef1..59f7e3164 100644 --- a/modules/uikit/includes/components/button.h +++ b/modules/uikit/includes/components/button.h @@ -8,6 +8,7 @@ class UIKIT_EXPORT Button : public AbstractButton { A_NOPROPERTIES() A_NOMETHODS() + A_NOENUMS() private: void composeComponent() override; diff --git a/modules/uikit/includes/components/checkbox.h b/modules/uikit/includes/components/checkbox.h index b287ec727..895206129 100644 --- a/modules/uikit/includes/components/checkbox.h +++ b/modules/uikit/includes/components/checkbox.h @@ -11,6 +11,7 @@ class UIKIT_EXPORT CheckBox : public AbstractButton { A_PROPERTYEX(Vector4, knobColor, CheckBox::knobColor, CheckBox::setKnobColor, "editor=Color") ) A_NOMETHODS() + A_NOENUMS() public: CheckBox(); diff --git a/modules/uikit/includes/components/floatinput.h b/modules/uikit/includes/components/floatinput.h index c448fc5df..efe88e483 100644 --- a/modules/uikit/includes/components/floatinput.h +++ b/modules/uikit/includes/components/floatinput.h @@ -24,6 +24,7 @@ class UIKIT_EXPORT FloatInput : public Widget { A_SLOT(FloatInput::onDecrease), A_SLOT(FloatInput::onEditingFinished) ) + A_NOENUMS() public: FloatInput(); diff --git a/modules/uikit/includes/components/foldout.h b/modules/uikit/includes/components/foldout.h index cfaebd9e7..5ad726905 100644 --- a/modules/uikit/includes/components/foldout.h +++ b/modules/uikit/includes/components/foldout.h @@ -19,6 +19,7 @@ class UIKIT_EXPORT Foldout : public Widget { A_METHODS( A_SLOT(Foldout::onExpand) ) + A_NOENUMS() public: Foldout(); diff --git a/modules/uikit/includes/components/label.h b/modules/uikit/includes/components/label.h index 98e4b8b8c..01ba455f2 100644 --- a/modules/uikit/includes/components/label.h +++ b/modules/uikit/includes/components/label.h @@ -23,6 +23,7 @@ class UIKIT_EXPORT Label : public Widget { A_PROPERTYEX(bool, kerning, Label::kerning, Label::setKerning, "css=font-kerning") ) A_NOMETHODS() + A_NOENUMS() public: Label(); diff --git a/modules/uikit/includes/components/layout.h b/modules/uikit/includes/components/layout.h index 17276ae62..29980becc 100644 --- a/modules/uikit/includes/components/layout.h +++ b/modules/uikit/includes/components/layout.h @@ -4,12 +4,6 @@ #include "widget.h" class UIKIT_EXPORT Layout { -public: - enum Direction { - Vertical, - Horizontal - }; - public: Layout(); ~Layout(); @@ -34,8 +28,8 @@ class UIKIT_EXPORT Layout { float spacing() const; void setSpacing(float spacing); - int direction() const; - void setDirection(int direction); + int orientation() const; + void setOrientation(int orientation); Vector2 sizeHint(); @@ -56,7 +50,7 @@ class UIKIT_EXPORT Layout { float m_spacing; - int m_direction; + int m_orientation; bool m_dirty; diff --git a/modules/uikit/includes/components/slider.h b/modules/uikit/includes/components/slider.h index d854b252d..bfb40a20c 100644 --- a/modules/uikit/includes/components/slider.h +++ b/modules/uikit/includes/components/slider.h @@ -15,6 +15,8 @@ class UIKIT_EXPORT Slider : public AbstractSlider { public: Slider(); + void setOrientation(int value) override; + ProgressBar *background() const; void setBackground(ProgressBar *background); @@ -22,8 +24,6 @@ class UIKIT_EXPORT Slider : public AbstractSlider { void setMinimum(int value) override; void setMaximum(int value) override; - void setOrientation(int value) override; - private: void update() override; diff --git a/modules/uikit/includes/components/switch.h b/modules/uikit/includes/components/switch.h index 1147d6a5f..9ed657fd2 100644 --- a/modules/uikit/includes/components/switch.h +++ b/modules/uikit/includes/components/switch.h @@ -12,6 +12,7 @@ class UIKIT_EXPORT Switch : public AbstractButton { A_PROPERTYEX(Vector4, knobColor, Switch::knobColor, Switch::setKnobColor, "editor=Color") ) A_NOMETHODS() + A_NOENUMS() public: Switch(); diff --git a/modules/uikit/includes/components/toolbutton.h b/modules/uikit/includes/components/toolbutton.h index 9bb06aa0d..61d8b4fae 100644 --- a/modules/uikit/includes/components/toolbutton.h +++ b/modules/uikit/includes/components/toolbutton.h @@ -14,6 +14,7 @@ class UIKIT_EXPORT ToolButton : public AbstractButton { A_SLOT(ToolButton::hideMenu), A_SLOT(ToolButton::onTriggered) ) + A_NOENUMS() ToolButton(); diff --git a/modules/uikit/includes/components/uiloader.h b/modules/uikit/includes/components/uiloader.h index 28915ed77..2131421a4 100644 --- a/modules/uikit/includes/components/uiloader.h +++ b/modules/uikit/includes/components/uiloader.h @@ -17,6 +17,7 @@ class UIKIT_EXPORT UiLoader : public Widget { A_METHOD(void, UiLoader::fromBuffer), A_SIGNAL(UiLoader::documentLoaded) ) + A_NOENUMS() public: UiLoader(); diff --git a/modules/uikit/includes/components/widget.h b/modules/uikit/includes/components/widget.h index d4f14b049..9e0f29408 100644 --- a/modules/uikit/includes/components/widget.h +++ b/modules/uikit/includes/components/widget.h @@ -17,6 +17,11 @@ class UIKIT_EXPORT Widget : public NativeBehaviour { A_SLOT(Widget::lower), A_SLOT(Widget::raise) ) +public: + enum Orentation { + Horizontal, + Vertical + }; public: Widget(); diff --git a/modules/uikit/src/components/button.cpp b/modules/uikit/src/components/button.cpp index 8cd2c155d..7966aab58 100644 --- a/modules/uikit/src/components/button.cpp +++ b/modules/uikit/src/components/button.cpp @@ -1,7 +1,5 @@ #include "components/button.h" -#include "components/label.h" -#include "components/image.h" #include "components/frame.h" #include "components/recttransform.h" diff --git a/modules/uikit/src/components/floatinput.cpp b/modules/uikit/src/components/floatinput.cpp index 1d2714861..851ea3935 100644 --- a/modules/uikit/src/components/floatinput.cpp +++ b/modules/uikit/src/components/floatinput.cpp @@ -1,10 +1,8 @@ #include "components/floatinput.h" -#include "components/layout.h" #include "components/recttransform.h" #include "components/button.h" #include "components/lineedit.h" -#include "components/label.h" #include "components/frame.h" #include "components/image.h" diff --git a/modules/uikit/src/components/foldout.cpp b/modules/uikit/src/components/foldout.cpp index 1dcd1b75d..90d2653cf 100644 --- a/modules/uikit/src/components/foldout.cpp +++ b/modules/uikit/src/components/foldout.cpp @@ -153,9 +153,7 @@ void Foldout::composeComponent() { containerRect->setAnchors(0.0f, 1.0f); containerRect->setPivot(Vector2(0.0f, 0.0f)); containerRect->setVerticalPolicy(RectTransform::Preferred); - - Layout *containerLayout = new Layout; - containerRect->setLayout(containerLayout); + containerRect->setLayout(new Layout); Actor *indicatorActor = Engine::composeActor