Cleanup widgets

This commit is contained in:
IlyaShurupov 2024-06-26 11:30:02 +03:00 committed by Ilya Shurupov
parent 242cd93589
commit da6990ddc8
30 changed files with 705 additions and 654 deletions

View file

@ -12,7 +12,7 @@ void FloatingWidget::eventProcess(const Events& events) {
mActionStartRelativePos = events.getPointerPrev() - this->mArea.pos;
checkFloating(events);
checkResizing(events);
if (mResizable) checkResizing(events);
CollapsableMenu::eventProcess(events);
}
@ -20,7 +20,7 @@ void FloatingWidget::eventProcess(const Events& events) {
void FloatingWidget::eventDraw(Canvas& canvas) {
CollapsableMenu::eventDraw(canvas);
if (!this->getCollapsed()) {
if (!this->getCollapsed() && mResizable) {
auto rect = getResizeHandle();
canvas.rect(rect, mResizeHandleColor, 0);
canvas.circle(rect.pos - this->mBorderSize, rect.w, this->mMenuColor);
@ -78,3 +78,9 @@ RectF FloatingWidget::getResizeHandle() {
auto pos = this->mArea.pos + this->mArea.size - size;
return { pos, size };
}
bool FloatingWidget::isFloating() const { return mFloating; }
void FloatingWidget::stopFloating() {
mFloating = false;
}