Skip to content

Commit e9a18fa

Browse files
committed
refactor: extract properties UI facade
1 parent bd3430d commit e9a18fa

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#pragma once
2+
3+
#include "MeshCraft/Scene/PropertiesPanel.hpp"
4+
5+
namespace MeshCraft::Application::UI {
6+
7+
class Properties final {
8+
public:
9+
static void draw(Scene::PropertiesPanel& panel, float x, float y, float width,
10+
float height, Scene::PropertiesContext& context);
11+
};
12+
13+
} // namespace MeshCraft::Application::UI

src/MeshCraft/Application/UI/Properties.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "MeshCraft/EditorAlgorithms.hpp"
22
#include "MeshCraft/Application/MeshCraftApplication.hpp"
3+
#include "MeshCraft/Application/UI/Properties.hpp"
34
#include "MeshCraft/Scene/PropertiesPanel.hpp"
45

56
#include <cstring>
@@ -57,7 +58,7 @@ void MeshCraftApplication::drawPropertiesPanel(float panelY, float panelH, int s
5758
},
5859
};
5960

60-
propertiesPanel_->draw(panelX, panelY, panelW, panelH, ctx);
61+
UI::Properties::draw(*propertiesPanel_, panelX, panelY, panelW, panelH, ctx);
6162
}
6263

6364
// SYS-W14-15: opens a native OS file-open dialog for a material's texture
@@ -89,3 +90,12 @@ std::string MeshCraftApplication::registerTextureFromPath(const std::string& pat
8990
}
9091

9192
} // namespace MeshCraft::Application
93+
94+
namespace MeshCraft::Application::UI {
95+
96+
void Properties::draw(Scene::PropertiesPanel& panel, float x, float y, float width,
97+
float height, Scene::PropertiesContext& context) {
98+
panel.draw(x, y, width, height, context);
99+
}
100+
101+
} // namespace MeshCraft::Application::UI

0 commit comments

Comments
 (0)