Reorganize code in widgets
This commit is contained in:
parent
837d8dc507
commit
e00dec67ba
31 changed files with 652 additions and 481 deletions
34
WidgetsNew/public/layouts/FloatingLayout.hpp
Normal file
34
WidgetsNew/public/layouts/FloatingLayout.hpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#pragma once
|
||||
|
||||
#include "BasicLayout.hpp"
|
||||
|
||||
namespace tp {
|
||||
class FloatingLayout : public BasicLayout {
|
||||
public:
|
||||
explicit FloatingLayout(Widget* widget) :
|
||||
BasicLayout(widget) {}
|
||||
|
||||
public:
|
||||
void startAction(const Vec2F& pointer);
|
||||
void updateAction(const Vec2F& pointer);
|
||||
void endAction();
|
||||
|
||||
bool isFloating() const { return mIsFloating; }
|
||||
|
||||
RectF resizeHandleRect();
|
||||
|
||||
public:
|
||||
void pickRect() override;
|
||||
|
||||
private:
|
||||
bool mIsFloating = false;
|
||||
bool mIsResizing = false;
|
||||
|
||||
Vec2F mPointerStart;
|
||||
Vec2F mPointerCurrent;
|
||||
|
||||
// TODO : remove?
|
||||
halnf mHandleSize = 10;
|
||||
halnf mHandlePadding = 2;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue