Skip to content

Commit

Permalink
[SUTK] Added one more RenderImage in THEME_LOAD test
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi688 committed Nov 24, 2024
1 parent f961fe6 commit e019345
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
16 changes: 16 additions & 0 deletions sutk/source/tests/ThemeLoadTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ namespace SUTK
m_renderRect = m_uiDriver->createRenderable<RenderImage>(m_renderRectContainer);
themeInt->bind<UIDriver::ImageReference>("Folder.Open", std::bind(&RenderImage::setImage, m_renderRect, std::placeholders::_1));

Container* emptyContainer1 = m_uiDriver->createContainer<Container>(rootContainer);
emptyContainer1->setRect({ 1.0f, 1.0f, 7.0f, 7.0f });
AnchorRect* anchor1 = emptyContainer1->getAnchorRect();
anchor1->setTopLeft({ 0, 0 });
anchor1->setBottomRight({ 1, 1 });
RenderableContainer* renderRectContainer1 = m_uiDriver->createContainer<RenderableContainer>(emptyContainer1);
renderRectContainer1->setRect({ 7.0f, 1.0f, 5, 5 });
anchor1 = renderRectContainer1->getAnchorRect();
anchor1->setTopLeft({ 1, 1 });
anchor1->setBottomRight({ 1, 1 });
emptyContainer1->setRect({ 1.0f, 1.0f, 9.0f, 7.0f });
emptyContainer1->setRect({ 1.0f, 1.0f, 11.0f, 7.0f });
RenderImage* renderImage = m_uiDriver->createRenderable<RenderImage>(renderRectContainer1);
themeInt->bind<UIDriver::ImageReference>("Folder.Open.VG", std::bind(&RenderImage::setImage, renderImage, std::placeholders::_1));
renderImage->setColor(Color4::white());

RenderableContainer* renderRectContainer2 = m_uiDriver->createContainer<RenderableContainer>(rootContainer);
RenderRectFill* renderRect2 = m_uiDriver->createRenderable<RenderRectFill>(renderRectContainer2);
renderRectContainer2->setRect({ 5.0f, 10.0f, 5.0f, 5.0f });
Expand Down
3 changes: 3 additions & 0 deletions sutk/svg_files/apple-svgrepo-com.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions sutk/themes/model.tmdl
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ ThemeModel
[Image]
Folder.Open;
[Image]
Folder.Open.VG;
[Image]
Folder.Close;
}
1 change: 1 addition & 0 deletions sutk/themes/theme1.theme
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ Theme
SmallButton.HoverColor = red { 1.0f };
SmallButton.PressColor = grey { 1.0f };
Folder.Open = "../textures/Thalita-Torres-Office-Archive-folders.512.png";
Folder.Open.VG = "svg_files/close-cross-symbol-in-a-circle-svgrepo-com.svg";
Folder.Close = "icons/Folder-Close.png";
}
1 change: 1 addition & 0 deletions sutk/themes/theme2.theme
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ Theme
SmallButton.HoverColor = red { 1.0f };
SmallButton.PressColor = grey { 1.0f };
Folder.Open = "../textures/Smile.bmp";
Folder.Open.VG = "svg_files/apple-svgrepo-com.svg";
Folder.Close = "icons/Folder-Close.png";
}

0 comments on commit e019345

Please sign in to comment.