Replace Old Widgets
This commit is contained in:
parent
03da5e41d6
commit
c41dc20132
81 changed files with 388 additions and 278 deletions
38
.back/WidBack/public/FloatingWidget.hpp
Normal file
38
.back/WidBack/public/FloatingWidget.hpp
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#pragma once
|
||||
|
||||
#include "CollapsableMenu.hpp"
|
||||
|
||||
namespace tp {
|
||||
class FloatingWidget : public CollapsableMenu {
|
||||
public:
|
||||
FloatingWidget();
|
||||
|
||||
void eventProcess(const Events& events) override;
|
||||
void eventDraw(Canvas& canvas) override;
|
||||
void eventUpdateConfiguration(WidgetManager& wm) override;
|
||||
|
||||
[[nodiscard]] bool isFloating() const;
|
||||
void stopFloating();
|
||||
|
||||
private:
|
||||
void checkFloating(const Events& events);
|
||||
void checkResizing(const Events& events);
|
||||
RectF getResizeHandle();
|
||||
|
||||
private:
|
||||
Vec2F mMinSize = { 70, 70 };
|
||||
|
||||
halnf mResizeHandleSize = 10;
|
||||
RGBA mResizeHandleColor = {};
|
||||
|
||||
bool mFloating = false;
|
||||
bool mResizing = false;
|
||||
|
||||
Vec2F mActionStartRelativePos = {};
|
||||
|
||||
public:
|
||||
bool mResizable = true;
|
||||
|
||||
bool mDropped = false;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue