Added mini rotate wheel to toolbar

This commit is contained in:
Yousef Khadadeh 2025-09-28 16:32:57 +03:00
parent 7ad86c27fe
commit 658799610b
6 changed files with 148 additions and 0 deletions

View file

@ -6,6 +6,7 @@
#include <include/core/SkPath.h>
#include "Elements/SVGIcon.hpp"
#include "Elements/SelectableButton.hpp"
#include "Elements/RotateWheel.hpp"
#include "Elements/MovableTabList.hpp"
#include "Elements/Element.hpp"
#include <Helpers/ConvertVec.hpp>
@ -660,6 +661,18 @@ void GUIManager::scroll_bar_many_entries_area(const std::string& uniqueId, float
pop_id();
}
bool GUIManager::rotate_wheel(const std::string& id, double* angle, float size, const std::function<void()>& elemUpdate) {
bool toRet = false;
push_id(id);
CLAY ({.layout = {.sizing = {.width = CLAY_SIZING_FIXED(size), .height = CLAY_SIZING_FIXED(size) } } }) {
RotateWheel* e = insert_element<RotateWheel>();
e->update(*io, angle, elemUpdate);
toRet = e->selection.clicked;
}
pop_id();
return toRet;
}
void GUIManager::paint_circle_popup_menu(const std::string& id, const Vector2f& centerPos, const PaintCircleMenu::Data& val, const std::function<void()>& elemUpdate) {
float size = 300.0f;
push_id(id);