# Changes 0.2.8

- Fix Flickering problem in StaticText api
- Fix Lagacy and Container HandleScrolling InBox checks
- Add IO Flags define for future
- Implement Single Object Dragging API by IO Context
- Add TreeNodes
- Use ioMenuPadding and ItemSpace
- Add StyleEditorMenu
- Rework ContainerApi to take functions from IO and add an Update function template for Updating internal values if required
- Use new DragApi for MenuCollabse, MenuDragging, MenuResize, SliderDragging and TreeNodes Open/Close
- Add Helper Defines for Metrics Menu [INTERNAL]
- Add TimeTrace as Tree to Metrics as well as other new Data
- Add GetRawObject to StaticText for custom rendering like ui7
- Add DrawlistRegestry to correctly render Menus in their own layer ranges
This commit is contained in:
2025-03-08 13:52:11 +01:00
parent e282d0ec7e
commit 09b1937a8d
22 changed files with 536 additions and 266 deletions

View File

@ -48,12 +48,16 @@ void Button::HandleInput(Hid::Ref inp) {
inp_done = true;
}
void Button::Draw() {
Assert(ren.get() && list.get() && theme,
"Did you run Container::Init correctly?");
ren->OnScreen(screen);
list->AddRectangle(FinalPos(), size, theme->Get(color));
Assert(io.get() && list.get(), "Did you run Container::Init correctly?");
io->Ren->OnScreen(screen);
list->AddRectangle(FinalPos(), size, io->Theme->Get(color));
list->AddText(FinalPos() + size * 0.5 - tdim * 0.5, label,
theme->Get(UI7Color_Text));
io->Theme->Get(UI7Color_Text));
}
void Button::Update() {
Assert(io.get(), "Did you run Container::Init correctly?");
this->SetSize(tdim + io->FramePadding);
}
} // namespace UI7
} // namespace PD

View File

@ -47,15 +47,21 @@ void Checkbox::HandleInput(Hid::Ref inp) {
inp_done = true;
}
void Checkbox::Draw() {
Assert(ren.get() && list.get() && theme,
"Did you run Container::Init correctly?");
ren->OnScreen(screen);
list->AddRectangle(FinalPos(), cbs, theme->Get(color));
Assert(list.get() && io.get(), "Did you run Container::Init correctly?");
io->Ren->OnScreen(screen);
list->AddRectangle(FinalPos(), cbs, io->Theme->Get(color));
if (usr_ref) {
list->AddRectangle(FinalPos() + 2, cbs - 4, theme->Get(UI7Color_Checkmark));
list->AddRectangle(FinalPos() + 2, cbs - 4,
io->Theme->Get(UI7Color_Checkmark));
}
list->AddText(FinalPos() + vec2(cbs.x() + 5, cbs.y() * 0.5 - tdim.y() * 0.5),
label, theme->Get(UI7Color_Text));
list->AddText(FinalPos() + vec2(cbs.x() + io->ItemSpace.x(),
cbs.y() * 0.5 - tdim.y() * 0.5),
label, io->Theme->Get(UI7Color_Text));
}
void Checkbox::Update() {
Assert(io.get(), "Did you run Container::Init correctly?");
this->SetSize(cbs + vec2(tdim.x() + io->ItemSpace.x(), 0));
}
} // namespace UI7
} // namespace PD

View File

@ -32,7 +32,8 @@ void Container::HandleScrolling(vec2 scrolling, vec4 viewport) {
}
last_use = Sys::GetTime();
pos -= vec2(0, scrolling.y());
skippable = !LI::Renderer::InBox(pos, size, viewport);
skippable = !LI::Renderer::InBox(
pos, size, vec4(viewport.xy(), viewport.xy() + viewport.zw()));
}
} // namespace UI7
} // namespace PD

View File

@ -26,9 +26,9 @@ SOFTWARE.
namespace PD {
namespace UI7 {
void Image::Draw() {
Assert(ren.get() && list.get(), "Did you run Container::Init correctly?");
Assert(io.get() && list.get(), "Did you run Container::Init correctly?");
Assert(img.get(), "Image is nullptr!");
ren->OnScreen(screen);
io->Ren->OnScreen(screen);
list->AddImage(FinalPos(), img, newsize);
}
} // namespace UI7

View File

@ -26,10 +26,9 @@ SOFTWARE.
namespace PD {
namespace UI7 {
void Label::Draw() {
Assert(ren.get() && list.get() && theme,
"Did you run Container::Init correctly?");
ren->OnScreen(screen);
list->AddText(FinalPos(), label, theme->Get(UI7Color_Text));
Assert(io.get() && list.get(), "Did you run Container::Init correctly?");
io->Ren->OnScreen(screen);
list->AddText(FinalPos(), label, io->Theme->Get(UI7Color_Text));
}
} // namespace UI7
} // namespace PD