# 0.2.7-1 **HOTFIX**

- Fix nullptr->value access issue in UI7::Context
- Add UI7MenuFlags_NoMove to disable window movement
- Fix testapp to support the new DebugLabels standard
This commit is contained in:
tobid7 2025-03-06 20:22:13 +01:00
parent e45598f9f6
commit 85e12c45c0
5 changed files with 24 additions and 21 deletions

View File

@ -38,6 +38,7 @@ enum UI7MenuFlags_ {
UI7MenuFlags_NoBackground = 1 << 4, ///< Dont Render Menu Background UI7MenuFlags_NoBackground = 1 << 4, ///< Dont Render Menu Background
UI7MenuFlags_NoClipRect = 1 << 5, ///< Disable clip render area of the Menu UI7MenuFlags_NoClipRect = 1 << 5, ///< Disable clip render area of the Menu
UI7MenuFlags_NoCollapse = 1 << 6, ///< Disable Menu Collapse UI7MenuFlags_NoCollapse = 1 << 6, ///< Disable Menu Collapse
UI7MenuFlags_NoMove = 1 << 7, ///< Disable Window Movement
// Enable Horizontal and Vertical Scrolling // Enable Horizontal and Vertical Scrolling
UI7MenuFlags_Scrolling = UI7MenuFlags_HzScrolling | UI7MenuFlags_VtScrolling, UI7MenuFlags_Scrolling = UI7MenuFlags_HzScrolling | UI7MenuFlags_VtScrolling,
}; };

View File

@ -36,7 +36,7 @@ SOFTWARE.
* Major Minor Patch Build * Major Minor Patch Build
* 0x01010000 -> 1.1.0-0 * 0x01010000 -> 1.1.0-0
*/ */
#define UI7_VERSION 0x00020700 #define UI7_VERSION 0x00020701
namespace PD { namespace PD {
namespace UI7 { namespace UI7 {

View File

@ -228,23 +228,25 @@ void UI7::Menu::PreHandler(UI7MenuFlags flags) {
void UI7::Menu::PostHandler() { void UI7::Menu::PostHandler() {
TT::Scope st("MPOS_" + name); TT::Scope st("MPOS_" + name);
if (inp->IsDown(inp->Touch) && if (!(flags & UI7MenuFlags_NoMove)) {
LI::Renderer::InBox(inp->TouchPos(), if (inp->IsDown(inp->Touch) &&
vec4(pos + vec2(18, 0), vec2(view_area.z(), tbh))) && LI::Renderer::InBox(inp->TouchPos(), vec4(pos + vec2(18, 0),
has_touch) { vec2(view_area.z(), tbh))) &&
mouse = inp->TouchPos(); has_touch) {
} else if (inp->IsUp(inp->Touch) && mouse = inp->TouchPos();
LI::Renderer::InBox( } else if (inp->IsUp(inp->Touch) &&
inp->TouchPos(), LI::Renderer::InBox(
vec4(pos + vec2(18, 0), vec2(view_area.z(), tbh))) && inp->TouchPos(),
has_touch) { vec4(pos + vec2(18, 0), vec2(view_area.z(), tbh))) &&
mouse = 0; has_touch) {
} else if (inp->IsHeld(inp->Touch) && mouse = 0;
LI::Renderer::InBox( } else if (inp->IsHeld(inp->Touch) &&
inp->TouchPosLast(), LI::Renderer::InBox(
vec4(pos + vec2(18, 0), vec2(view_area.z(), tbh))) && inp->TouchPosLast(),
has_touch) { vec4(pos + vec2(18, 0), vec2(view_area.z(), tbh))) &&
pos = inp->TouchPos() - mouse; has_touch) {
pos = inp->TouchPos() - mouse;
}
} }
if (scrolling[1]) { if (scrolling[1]) {
scroll_allowed[1] = (max[1] > 235); scroll_allowed[1] = (max[1] > 235);

View File

@ -61,7 +61,7 @@ bool UI7::Context::BeginMenu(const ID& id, UI7MenuFlags flags) {
if (!this->current->is_open) { if (!this->current->is_open) {
this->current = nullptr; this->current = nullptr;
} }
return this->current->is_open; return this->current != nullptr;
} }
UI7::Menu::Ref UI7::Context::GetCurrentMenu() { UI7::Menu::Ref UI7::Context::GetCurrentMenu() {

View File

@ -57,7 +57,7 @@ class Test : public PD::App {
UI7MenuFlags_Scrolling | UI7MenuFlags_CenterTitle)) { UI7MenuFlags_Scrolling | UI7MenuFlags_CenterTitle)) {
auto m = ui7->GetCurrentMenu(); auto m = ui7->GetCurrentMenu();
m->SeparatorText("Menu Timings"); m->SeparatorText("Menu Timings");
m->DebugLabels(); PD::UI7::Menu::DebugLabels(m);
m->SeparatorText("Palladium Info"); m->SeparatorText("Palladium Info");
m->PushAlignment(UI7Align_Center); m->PushAlignment(UI7Align_Center);
m->Label("Version: " + PD::LibInfo::Version() + " [" + m->Label("Version: " + PD::LibInfo::Version() + " [" +
@ -82,7 +82,7 @@ class Test : public PD::App {
} }
m->SameLine(); m->SameLine();
if (m->Button("Palladium")) { if (m->Button("Palladium")) {
//sthis->FeatureDisable(AppFLags_UserLoop); // sthis->FeatureDisable(AppFLags_UserLoop);
Overlays()->Push(PD::New<PD::SettingsMenu>()); Overlays()->Push(PD::New<PD::SettingsMenu>());
} }
m->SeparatorText("SeparatorText"); m->SeparatorText("SeparatorText");