# Changes 0.2.4-1

- Add GIT_BRANCH (for development and stable)
- Write  Documentation of
  - pd-core (exept of vec.hpp)
  - pd-app
  - pd-drivers
  - pd-lib3ds
  - pd-image
  - pd-image
  - pd-ui7
This commit is contained in:
2025-03-02 21:11:58 +01:00
parent af3d3e0b5b
commit 7d3f619169
56 changed files with 2481 additions and 536 deletions

View File

@ -31,6 +31,9 @@ SOFTWARE.
#ifndef PALLADIUM_GIT_COMMIT
#define PALLADIUM_GIT_COMMIT "unknown"
#endif
#ifndef PALLADIUM_GIT_BRANCH
#define PALLADIUM_GIT_BRANCH "unknown"
#endif
const std::string PD::LibInfo::CompiledWith() {
return Strings::GetCompilerVersion();
@ -40,4 +43,5 @@ const std::string PD::LibInfo::CxxVersion() {
}
const std::string PD::LibInfo::BuildTime() { return __DATE__ " - " __TIME__; }
const std::string PD::LibInfo::Version() { return PALLADIUM_VERSION; }
const std::string PD::LibInfo::Commit() { return PALLADIUM_GIT_COMMIT; }
const std::string PD::LibInfo::Commit() { return PALLADIUM_GIT_COMMIT; }
const std::string PD::LibInfo::Branch() { return PALLADIUM_GIT_BRANCH; }

View File

@ -36,11 +36,11 @@ void Button::HandleInput(Hid::Ref inp) {
Assert(screen.get(), "Screen is not set up!");
if (screen->ScreenType() == Screen::Bottom) {
if (inp->IsHeld(inp->Touch) &&
LI::Renderer::InBox(inp->TouchPos(), vec4(pos, size))) {
LI::Renderer::InBox(inp->TouchPos(), vec4(FinalPos(), size))) {
color = UI7Color_ButtonHovered;
}
if (inp->IsUp(inp->Touch) &&
LI::Renderer::InBox(inp->TouchPosLast(), vec4(pos, size))) {
LI::Renderer::InBox(inp->TouchPosLast(), vec4(FinalPos(), size))) {
color = UI7Color_ButtonActive;
pressed = true;
}
@ -51,8 +51,8 @@ void Button::Draw() {
Assert(ren.get() && list.get() && theme,
"Did you run Container::Init correctly?");
ren->OnScreen(screen);
list->AddRectangle(pos, size, theme->Get(color));
list->AddText(pos + size * 0.5 - tdim * 0.5, label,
list->AddRectangle(FinalPos(), size, theme->Get(color));
list->AddText(FinalPos() + size * 0.5 - tdim * 0.5, label,
theme->Get(UI7Color_Text));
}
} // namespace UI7

View File

@ -35,11 +35,11 @@ void Checkbox::HandleInput(Hid::Ref inp) {
Assert(screen.get(), "Screen is not set up!");
if (screen->ScreenType() == Screen::Bottom) {
if (inp->IsHeld(inp->Touch) &&
LI::Renderer::InBox(inp->TouchPos(), vec4(pos, size))) {
LI::Renderer::InBox(inp->TouchPos(), vec4(FinalPos(), size))) {
color = UI7Color_FrameBackgroundHovered;
}
if (inp->IsUp(inp->Touch) &&
LI::Renderer::InBox(inp->TouchPosLast(), vec4(pos, size))) {
LI::Renderer::InBox(inp->TouchPosLast(), vec4(FinalPos(), size))) {
color = UI7Color_FrameBackgroundHovered;
usr_ref = !usr_ref;
}
@ -50,12 +50,12 @@ void Checkbox::Draw() {
Assert(ren.get() && list.get() && theme,
"Did you run Container::Init correctly?");
ren->OnScreen(screen);
list->AddRectangle(pos, cbs, theme->Get(color));
list->AddRectangle(FinalPos(), cbs, theme->Get(color));
if (usr_ref) {
list->AddRectangle(pos + 2, cbs - 4, theme->Get(UI7Color_Checkmark));
list->AddRectangle(FinalPos() + 2, cbs - 4, theme->Get(UI7Color_Checkmark));
}
list->AddText(pos + vec2(cbs.x() + 5, cbs.y() * 0.5 - tdim.y() * 0.5), label,
theme->Get(UI7Color_Text));
list->AddText(FinalPos() + vec2(cbs.x() + 5, cbs.y() * 0.5 - tdim.y() * 0.5),
label, theme->Get(UI7Color_Text));
}
} // namespace UI7
} // namespace PD

View File

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

View File

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

View File

@ -160,13 +160,12 @@ void UI7::Menu::PreHandler(UI7MenuFlags flags) {
this->flags = flags;
this->scrolling[0] = flags & UI7MenuFlags_HzScrolling;
this->scrolling[1] = flags & UI7MenuFlags_VtScrolling;
has_touch =
main->GetRenderer()->CurrentScreen()->ScreenType() == Screen::Bottom;
has_touch = main->ren->CurrentScreen()->ScreenType() == Screen::Bottom;
if (!(flags & UI7MenuFlags_NoBackground)) {
back->AddRectangle(0, view_area.zw(), theme->Get(UI7Color_Background));
}
if (!(flags & UI7MenuFlags_NoTitlebar)) {
tbh = front->GetRenderer()->TextScale() * 30.f;
tbh = front->ren->TextScale() * 30.f;
front->AddRectangle(0, vec2(view_area.z(), tbh),
theme->Get(UI7Color_Header));
vec2 tpos(5, tbh * 0.5 - front->ren->GetTextDimensions(name).y() * 0.5);
@ -314,7 +313,7 @@ void UI7::Menu::Separator() {
void UI7::Menu::SeparatorText(const std::string& label) {
vec2 size = vec2(view_area.z() - (scrollbar[1] ? 24 : 10), 1);
vec2 tdim = this->back->GetRenderer()->GetTextDimensions(label);
vec2 tdim = this->back->ren->GetTextDimensions(label);
vec2 pos = Cursor();
CursorMove(vec2(size.x(), tdim.y() - 4)); // Fix to make gap not to large
@ -412,5 +411,12 @@ void UI7::Menu::AfterAlign(UI7Align a) {
}
ref->SetPos(np);
}
void UI7::Menu::CreateParent() {
Assert(!tmp_parent, "There is already an existing Parent container!");
tmp_parent = Container::New();
tmp_parent->SetPos(0);
tmp_parent->SetSize(0);
}
} // namespace UI7
} // namespace PD