Skip to content

Commit

Permalink
more tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
malytomas committed Oct 24, 2023
1 parent c594cf0 commit 985761e
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion externals/cage
Submodule cage updated 51 files
+1 −1 externals/assimp/assimp
+1 −1 externals/cubeb/cubeb
+1 −1 externals/fastnoise/fastnoise
+1 −1 externals/freetype/freetype
+1 −1 externals/gamenetworkingsockets/GameNetworkingSockets
+1 −1 externals/jpeg/CMakeLists.txt
+1 −1 externals/jpeg/jpeg
+1 −1 externals/msdfgen/msdfgen
+1 −1 externals/openxr-sdk/OpenXR-SDK
+1 −1 externals/plf/plf_colony
+1 −1 externals/plf/plf_list
+1 −1 externals/pmp/pmp
+1 −1 externals/png/png
+1 −1 externals/stb/stb
+1 −1 externals/tiff/tiff
+1 −1 externals/unordered_dense/unordered_dense
+1 −1 externals/utfcpp/utfcpp
+1 −1 externals/zlib-ng/zlib-ng
+1 −1 sources/include/cage-core/camera.h
+23 −23 sources/include/cage-core/collider.h
+9 −9 sources/include/cage-core/collisionStructure.h
+8 −0 sources/include/cage-core/core.h
+154 −161 sources/include/cage-core/geometry.h
+2 −2 sources/include/cage-core/mat3x4.h
+220 −256 sources/include/cage-core/math.h
+13 −13 sources/include/cage-core/spatialStructure.h
+5 −5 sources/include/cage-engine/guiComponents.h
+1 −1 sources/include/cage-engine/guiManager.h
+1 −9 sources/libcore/events.cpp
+65 −65 sources/libcore/geometry/aabbCone.cpp
+50 −57 sources/libcore/geometry/collider.cpp
+15 −15 sources/libcore/geometry/collisionStructure.cpp
+88 −88 sources/libcore/geometry/geometry.cpp
+3 −3 sources/libcore/geometry/linesDistances.cpp
+5 −5 sources/libcore/geometry/minimumBoundingSphere.cpp
+26 −26 sources/libcore/geometry/shapes.cpp
+33 −33 sources/libcore/geometry/spatialStructure.cpp
+8 −8 sources/libcore/geometry/triangleBox.cpp
+3 −106 sources/libcore/geometry/triangleTriangle.cpp
+2 −1 sources/libcore/image/exr.cpp
+1 −1 sources/libcore/math/camera.cpp
+64 −50 sources/libcore/math/matrices.cpp
+28 −18 sources/libcore/math/scalars.cpp
+15 −10 sources/libcore/math/transform.cpp
+63 −31 sources/libcore/math/vectors.cpp
+2 −0 sources/libcore/network/steam.cpp
+2 −1 sources/libengine/gui/gui.cpp
+4 −0 sources/libengine/gui/layouts/alignment.cpp
+2 −0 sources/libengine/gui/layouts/scrollbars.cpp
+86 −51 sources/libengine/gui/tooltips.cpp
+0 −8 sources/test-core/geometry.cpp
48 changes: 48 additions & 0 deletions sources/gui/widgets/tooltips.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,32 @@ void tooltipRecursive(uint32 depth, const GuiTooltipConfig &cfg)
e->value<GuiTooltipComponent>().tooltip.bind<uint32, &tooltipRecursive>(depth + 1);
}

void tooltipTall(const GuiTooltipConfig &cfg)
{
cfg.closeCondition = TooltipCloseConditionEnum::Modal;
Entity *f = cfg.tooltip->manager()->createUnique();
f->value<GuiParentComponent>().parent = cfg.tooltip->name();
f->value<GuiPanelComponent>();
f->value<GuiExplicitSizeComponent>().size = Vec2(120, 1000);
Entity *e = cfg.tooltip->manager()->createUnique();
e->value<GuiParentComponent>().parent = f->name();
e->value<GuiLabelComponent>();
e->value<GuiTextComponent>().value = "modal";
}

void tooltipWide(const GuiTooltipConfig &cfg)
{
cfg.closeCondition = TooltipCloseConditionEnum::Modal;
Entity *f = cfg.tooltip->manager()->createUnique();
f->value<GuiParentComponent>().parent = cfg.tooltip->name();
f->value<GuiPanelComponent>();
f->value<GuiExplicitSizeComponent>().size = Vec2(1000, 120);
Entity *e = cfg.tooltip->manager()->createUnique();
e->value<GuiParentComponent>().parent = f->name();
e->value<GuiLabelComponent>();
e->value<GuiTextComponent>().value = "modal";
}

class GuiTestImpl : public GuiTestClass
{
void initialize() override
Expand Down Expand Up @@ -224,6 +250,28 @@ class GuiTestImpl : public GuiTestClass
e->value<GuiTextComponent>().value = "label";
e->value<GuiTooltipComponent>().tooltip.bind<uint32, &tooltipRecursive>(1);
}

{ // tall
guiLabel(3, index, "tall");
Entity *e = ents->createUnique();
GuiParentComponent &p = e->value<GuiParentComponent>();
p.parent = 3;
p.order = index++;
e->value<GuiLabelComponent>();
e->value<GuiTextComponent>().value = "label";
e->value<GuiTooltipComponent>().tooltip.bind<tooltipTall>();
}

{ // wide
guiLabel(3, index, "wide");
Entity *e = ents->createUnique();
GuiParentComponent &p = e->value<GuiParentComponent>();
p.parent = 3;
p.order = index++;
e->value<GuiLabelComponent>();
e->value<GuiTextComponent>().value = "label";
e->value<GuiTooltipComponent>().tooltip.bind<tooltipWide>();
}
}
};

Expand Down

0 comments on commit 985761e

Please sign in to comment.